diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 193238c..6ad10d9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -105,7 +105,7 @@ jobs: run: | set -euo pipefail version=$(node -p 'JSON.parse(require("fs").readFileSync("package.json")).version') - package_spec="@clone-ai/tab-completion@$version" + package_spec="@clone-ai/prompt-prediction@$version" unset NPM_TOKEN NODE_AUTH_TOKEN export NPM_CONFIG_USERCONFIG="$RUNNER_TEMP/anonymous-user.npmrc" export NPM_CONFIG_GLOBALCONFIG="$RUNNER_TEMP/anonymous-global.npmrc" @@ -121,10 +121,10 @@ jobs: consumer="$RUNNER_TEMP/npm-consumer" npm install --prefix "$consumer" --ignore-scripts --prefer-online "$package_spec" cd "$consumer" - node --input-type=module -e 'await import("@clone-ai/tab-completion"); await import("@clone-ai/tab-completion/server")' + node --input-type=module -e 'await import("@clone-ai/prompt-prediction"); await import("@clone-ai/prompt-prediction/server")' npm audit signatures registry_tarball=$(npm pack "$package_spec" --pack-destination "$RUNNER_TEMP" --json | node -e 'let s=""; process.stdin.on("data",c=>s+=c).on("end",()=>console.log(JSON.parse(s)[0].filename))') - cmp "$RUNNER_TEMP/$registry_tarball" "$GITHUB_WORKSPACE/release/clone-ai-tab-completion-$version.tgz" + cmp "$RUNNER_TEMP/$registry_tarball" "$GITHUB_WORKSPACE/release/clone-ai-prompt-prediction-$version.tgz" pypi: if: inputs.registry == 'pypi' needs: [release_check, validate] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62c07da..50d8bec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,4 +48,4 @@ jobs: (cd "$download_dir" && sha256sum --check ./*.sha256) npm install --prefix "$consumer_dir" --ignore-scripts "$download_dir"/*.tgz cd "$consumer_dir" - node --input-type=module -e 'await import("@clone-ai/tab-completion"); await import("@clone-ai/tab-completion/server")' + node --input-type=module -e 'await import("@clone-ai/prompt-prediction"); await import("@clone-ai/prompt-prediction/server")' diff --git a/CHANGELOG.md b/CHANGELOG.md index 0af7179..d1e284b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.7.0 + +- Publish the JavaScript SDK as `@clone-ai/prompt-prediction`. Update imports, generated integration examples, archive names, npm verification and installation guides. Runtime exports and prediction behavior remain unchanged. + # 0.6.4 - Include public npm installation instructions in the distributed README and integration guides. Keep exact package versions and checksum-verified archive alternatives aligned, and point billing guidance to the API pricing page. diff --git a/README.md b/README.md index 26a7a38..36daf1c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Add next-prompt prediction and Tab completion to your existing composer. Suggestions appear as ghost text. **Tab inserts; your application decides when to send.** -**SDK 0.6.4:** instant display remains the default. Set `presentation="typewriter"` for a cancellable display animation after the complete JSON response arrives; the API does not stream. These options and Clone mode are absent from the 0.3.1 package. Keep ordinary typing and sending available when predictions are loading, fail, or never return. See the [rendering contract](docs/agent-integration.md#suggestion-rendering-contract) before building a custom editor adapter. +**SDK 0.7.0:** instant display remains the default. Set `presentation="typewriter"` for a cancellable display animation after the complete JSON response arrives; the API does not stream. These options and Clone mode are absent from the 0.3.1 package. Keep ordinary typing and sending available when predictions are loading, fail, or never return. See the [rendering contract](docs/agent-integration.md#suggestion-rendering-contract) before building a custom editor adapter. Use your product's conversation, selected artifact and user preferences as context. Your end users do not need a Clone account. Connecting a user's Clone context is optional. @@ -34,7 +34,7 @@ Node **22.13+**, ESM. React integrations support **18 and 19**. The headless con Install the public npm package. Existing integrations can keep their pinned version while validating an upgrade: ```sh -npm install --save-exact @clone-ai/tab-completion@0.6.4 +npm install --save-exact @clone-ai/prompt-prediction@0.7.0 ``` Use your project's package manager and commit its lockfile. Verified [GitHub release archives](docs/releases.md#download-and-install) remain available. Hosted API access requires a separate app key. @@ -42,8 +42,8 @@ Use your project's package manager and commit its lockfile. Verified [GitHub rel ```tsx 'use client'; import { useState } from 'react'; -import { createPredictionTransport } from '@clone-ai/tab-completion'; -import { TabCompletionInput } from '@clone-ai/tab-completion/react'; +import { createPredictionTransport } from '@clone-ai/prompt-prediction'; +import { TabCompletionInput } from '@clone-ai/prompt-prediction/react'; const transport = createPredictionTransport('/api/clone/predict'); @@ -70,7 +70,7 @@ export function Composer({ threadId, contextRevision }: { } ``` -Implement `/api/clone/predict` in your authenticated backend using `CloneClient` from `@clone-ai/tab-completion/server`. Derive the user ID from the server session. Keep the app key on the server, never in browser code or `VITE_*` / `NEXT_PUBLIC_*` variables. Pass your real conversation and advance `context_revision` when it changes. +Implement `/api/clone/predict` in your authenticated backend using `CloneClient` from `@clone-ai/prompt-prediction/server`. Derive the user ID from the server session. Keep the app key on the server, never in browser code or `VITE_*` / `NEXT_PUBLIC_*` variables. Pass your real conversation and advance `context_revision` when it changes. For complete setup and verification, follow the [integration guide](docs/start.md). @@ -94,10 +94,10 @@ For a connected proxy, outage testing and private measurements, follow [pilot va | Import | Use it for | | --- | --- | -| `@clone-ai/tab-completion` | Controller, browser transport, errors and public types | -| `@clone-ai/tab-completion/react` | `useTabCompletion` or `TabCompletionInput` | -| `@clone-ai/tab-completion/assistant-ui` | `CloneComposerInput` inside an existing assistant-ui composer | -| `@clone-ai/tab-completion/server` | `CloneClient` and optional PKCE connection flow | +| `@clone-ai/prompt-prediction` | Controller, browser transport, errors and public types | +| `@clone-ai/prompt-prediction/react` | `useTabCompletion` or `TabCompletionInput` | +| `@clone-ai/prompt-prediction/assistant-ui` | `CloneComposerInput` inside an existing assistant-ui composer | +| `@clone-ai/prompt-prediction/server` | `CloneClient` and optional PKCE connection flow | The React input uses a native textarea. Rich-text editors need an insertion and Undo adapter around the controller. The assistant-ui adapter targets `@assistant-ui/react@0.15.21` and uses its `unstable_useComposerInput` hook; verify compatibility before upgrading it. @@ -118,4 +118,4 @@ See [Contributing](CONTRIBUTING.md) for the repository layout and validation com ## Feedback loop -SDK 0.6.4 can return explicit rejection, evaluations, edited successful submissions and host-observed outcomes to the API. Wire the packaged tracker to your host send and authenticated proxy. Text collection is off by default. See [feedback integration](docs/feedback.md) for scoped memory, delivery, expiry and clearing. These features require the API feedback deployment; event collection alone is not model learning. +SDK 0.7.0 can return explicit rejection, evaluations, edited successful submissions and host-observed outcomes to the API. Wire the packaged tracker to your host send and authenticated proxy. Text collection is off by default. See [feedback integration](docs/feedback.md) for scoped memory, delivery, expiry and clearing. These features require the API feedback deployment; event collection alone is not model learning. diff --git a/docs/agent-integration.md b/docs/agent-integration.md index 0f2ce19..743d7a2 100644 --- a/docs/agent-integration.md +++ b/docs/agent-integration.md @@ -2,11 +2,11 @@ Implement next-prompt prediction and Tab Completion in the existing customer composer using product context by default, preserving its submission behavior. No Clone end-user account, consent screen or callback is required for this basic path. Offer Clone personalization separately in settings only if desired. Read `README.md`, exported types and `openapi.json`. Do not infer that the customer uses assistant-ui just because the optional adapter exists. -Begin with [start.md](start.md), which covers agent-led self-service app registration and callback updates. This guide supplies the detailed implementation contract for SDK 0.6.4. Verify installed types; 0.3.1 has no typewriter option or Clone mode. +Begin with [start.md](start.md), which covers agent-led self-service app registration and callback updates. This guide supplies the detailed implementation contract for SDK 0.7.0. Verify installed types; 0.3.1 has no typewriter option or Clone mode. ## Prerequisites -- The public `@clone-ai/tab-completion@0.6.4` npm package, Node 22.13+, React 18 or 19. Follow the [installation instructions](releases.md#download-and-install). Checksum-verified GitHub archives are also available. +- The public `@clone-ai/prompt-prediction@0.7.0` npm package, Node 22.13+, React 18 or 19. Follow the [installation instructions](releases.md#download-and-install). Checksum-verified GitHub archives are also available. - A Clone app key (`clnp_...`) for the chosen production or sandbox app and its API base URL. Use an isolated sandbox app for synthetic integration tests. Only optional personalization needs an exact registered HTTPS callback (HTTP loopback is local/test only). The agent obtains these through self-service onboarding; the customer need not prepare them in advance. - An existing authenticated customer session and server-side session storage. - Only for optional personalization: a Clone test account with selected profile/Goal context already synced. Basic verification needs no Clone test account. Local-only unsynced content is unavailable. @@ -16,7 +16,7 @@ The app key is required for API verification; a callback and Clone account are r ## Server integration -Import `CloneClient` and `ConnectionFlow` from `@clone-ai/tab-completion/server`. Create the client once in a server-only module: +Import `CloneClient` and `ConnectionFlow` from `@clone-ai/prompt-prediction/server`. Create the client once in a server-only module: ```ts const clone = new CloneClient({ apiKey: process.env.CLONE_APP_KEY!, baseUrl: process.env.CLONE_API_URL! }); @@ -72,13 +72,13 @@ Use the bubbling `onInput` observer shown in the example. Updating observation s The example distinguishes the SDK insertion from a later edit, removes attribution after clearing or Undo back to the original draft, and associates a submission with the most recently accepted suggestion. It does not measure how much suggested text remains or every suggestion used in a draft. `presented` means the controller offered a candidate; it does not prove the user read it. Adapt these observation boundaries explicitly if your editor behaves differently. No draft or completion text is included in the transmitted `{event_id, request_id, kind}`. -Telemetry is best effort and must not block input or send. The example shows local `pending`/`recorded`/`failed` delivery receipts; fixture receipts are labelled separately. SDK 0.6.4 uses bounded retries with the same event ID/body; it does not persist a durable retry queue. Reset the tracker on account/context changes to abort old-scope delivery. Report failed/missing deliveries instead of treating them as zero engagement. Verify acceptance without send, edited submission, Undo followed by an unrelated manual send, context change, telemetry failure, duplicate delivery, and unchanged billable usage. These event records alone do not establish coverage, usefulness, suggestion quality or human acceptance. +Telemetry is best effort and must not block input or send. The example shows local `pending`/`recorded`/`failed` delivery receipts; fixture receipts are labelled separately. SDK 0.7.0 uses bounded retries with the same event ID/body; it does not persist a durable retry queue. Reset the tracker on account/context changes to abort old-scope delivery. Report failed/missing deliveries instead of treating them as zero engagement. Verify acceptance without send, edited submission, Undo followed by an unrelated manual send, context change, telemetry failure, duplicate delivery, and unchanged billable usage. These event records alone do not establish coverage, usefulness, suggestion quality or human acceptance. ## Suggestion rendering contract The prediction endpoint returns one complete JSON object, not SSE or token deltas. `createPredictionTransport` waits for that response, the controller validates it, and the controller validates the complete candidate. By default `useTabCompletion` exposes the full `completion` immediately and `TabCompletionInput` renders it as ghost text. With `presentation: "typewriter"`, the hook exposes a visible prefix until the animation completes; `canAccept` remains false until then. The complete candidate remains in `state.candidate`. This is the default for both empty-composer next prompts and draft completions. -Do not add per-character timers, progressively slice `completion`, or route it through an assistant-message streaming renderer by default. A typewriter animation is an optional presentation choice, not evidence that the API streams. In 0.6.4 set `presentation: "typewriter"` only when the customer's stated preference or an AskUserQuestion answer calls for it; do not ask again for a choice already supplied. The entire candidate must be visible before offering Tab acceptance; never accept only a partial string or send unseen text. Cancel any animation on edits, selection/context changes, dismissal, or expiry. Ordinary manual sending must stay available throughout. +Do not add per-character timers, progressively slice `completion`, or route it through an assistant-message streaming renderer by default. A typewriter animation is an optional presentation choice, not evidence that the API streams. In 0.7.0 set `presentation: "typewriter"` only when the customer's stated preference or an AskUserQuestion answer calls for it; do not ask again for a choice already supplied. The entire candidate must be visible before offering Tab acceptance; never accept only a partial string or send unseen text. Cancel any animation on edits, selection/context changes, dismissal, or expiry. Ordinary manual sending must stay available throughout. Verify the installed package version and lockfile, inspect the actual composer adapter, and check the response format before attributing progressive display to the SDK or customer code. A recording alone cannot establish which layer produced an effect. Return evidence that the default renderer shows a complete candidate, Tab inserts it exactly once without sending, and only the host's explicit-send action submits it. diff --git a/docs/billing.md b/docs/billing.md index 2f85ad7..98204a1 100644 --- a/docs/billing.md +++ b/docs/billing.md @@ -1,6 +1,6 @@ # Pricing and billing -SDK 0.6.4 supports both sandbox and pay-as-you-go (PAYG) usage, including an optional company spending limit. Install the verified [0.6.4 release](https://github.com/cloneisyou/clone-sdk/releases/tag/v0.6.4). Hosted paid activation is available only when the developer console offers it; installing the SDK never enables payment. +SDK 0.7.0 supports both sandbox and pay-as-you-go (PAYG) usage, including an optional company spending limit. Install the verified [0.7.0 release](https://github.com/cloneisyou/clone-sdk/releases/tag/v0.7.0). Hosted paid activation is available only when the developer console offers it; installing the SDK never enables payment. The company operating your product pays for hosted predictions. End users need no Clone account or personal subscription. SDK code is MIT licensed. The public catalog is [API pricing](https://clone.is/api-platform/pricing); availability depends on rollout, and existing individually negotiated contracts remain unchanged. diff --git a/docs/clone-mode.md b/docs/clone-mode.md index 8033bdf..95caa64 100644 --- a/docs/clone-mode.md +++ b/docs/clone-mode.md @@ -9,7 +9,7 @@ Default bounds are three sends and five minutes. The host can choose one to 100 ## Headless integration ```ts -import { CloneModeController } from '@clone-ai/tab-completion'; +import { CloneModeController } from '@clone-ai/prompt-prediction'; const mode = new CloneModeController({ transport, onSubmit: async (text, { requestId, origin, signal }) => { diff --git a/docs/feedback.md b/docs/feedback.md index 20538b9..6e38905 100644 --- a/docs/feedback.md +++ b/docs/feedback.md @@ -5,7 +5,7 @@ SDK 0.6.2 adds `FeedbackTracker`, bounded event delivery, explicit rejection/eva ## Host integration ```ts -import { FeedbackTracker, createEventTransport } from '@clone-ai/tab-completion'; +import { FeedbackTracker, createEventTransport } from '@clone-ai/prompt-prediction'; const feedback = new FeedbackTracker(createEventTransport('/api/clone/events'), { collectSubmittedText: false, // default: no submitted text collection diff --git a/docs/releases.md b/docs/releases.md index 37d8133..fdd6d45 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -4,16 +4,16 @@ During 0.x, breaking public contract changes increment the minor version; compatible fixes increment the patch. Once 1.0 is reached, use SemVer major/minor/patch rules. The public contract includes exported types and documented behavior such as Tab insertion, events, cancellation, and submission ownership. Never overwrite a published version or move its tag. -## SDK 0.6.4 +## SDK 0.7.0 -Version 0.6.4 updates the packaged npm installation guides. Version 0.6.3 keeps pilot measurements tied to the original prediction source, including late observations after a fault changes. Version 0.6.2 added the packaged feedback tracker, explicit evaluations and outcomes, feedback revision and clearing. Content-free diagnostics and pilot validation from 0.5.0 remain available. Feedback memory requires the matching API deployment; see [feedback](feedback.md). Python client 0.2.0 is distributed separately as a wheel and source archive. Optional presentation and Clone mode from 0.4.0 remain available; instant suggestions and manual submission remain the defaults. The older 0.3.1 artifact does not contain these features. Keep the installed archive and lockfile pinned until the upgrade passes in your own composer. `npm run test:package` builds, checks and installs the actual archive into independent React 18 and 19 examples. +Version 0.7.0 publishes the JavaScript SDK as `@clone-ai/prompt-prediction` and updates its install and import paths. Runtime exports and prediction behavior are unchanged. Version 0.6.4 updated the packaged npm installation guides. Version 0.6.3 keeps pilot measurements tied to the original prediction source, including late observations after a fault changes. Version 0.6.2 added the packaged feedback tracker, explicit evaluations and outcomes, feedback revision and clearing. Content-free diagnostics and pilot validation from 0.5.0 remain available. Feedback memory requires the matching API deployment; see [feedback](feedback.md). Python client 0.2.0 is distributed separately as a wheel and source archive. Optional presentation and Clone mode from 0.4.0 remain available; instant suggestions and manual submission remain the defaults. The older 0.3.1 artifact does not contain these features. Keep the installed archive and lockfile pinned until the upgrade passes in your own composer. `npm run test:package` builds, checks and installs the actual archive into independent React 18 and 19 examples. ## Download and install -The current release is [v0.6.4](https://github.com/cloneisyou/clone-sdk/releases/tag/v0.6.4). Install its public npm package with your existing package manager: +The current release is [v0.7.0](https://github.com/cloneisyou/clone-sdk/releases/tag/v0.7.0). Install its public npm package with your existing package manager: ```sh -npm install --save-exact @clone-ai/tab-completion@0.6.4 +npm install --save-exact @clone-ai/prompt-prediction@0.7.0 ``` Commit the lockfile. To install a checksum-verified GitHub archive instead, download its `.tgz` and `.sha256` into `vendor/clone-sdk`. @@ -22,25 +22,25 @@ When the repository is public, no GitHub credential is needed: ```sh mkdir -p vendor/clone-sdk -release_url=https://github.com/cloneisyou/clone-sdk/releases/download/v0.6.4 -curl --fail --location "$release_url/clone-ai-tab-completion-0.6.4.tgz" \ - --output vendor/clone-sdk/clone-ai-tab-completion-0.6.4.tgz -curl --fail --location "$release_url/clone-ai-tab-completion-0.6.4.tgz.sha256" \ - --output vendor/clone-sdk/clone-ai-tab-completion-0.6.4.tgz.sha256 +release_url=https://github.com/cloneisyou/clone-sdk/releases/download/v0.7.0 +curl --fail --location "$release_url/clone-ai-prompt-prediction-0.7.0.tgz" \ + --output vendor/clone-sdk/clone-ai-prompt-prediction-0.7.0.tgz +curl --fail --location "$release_url/clone-ai-prompt-prediction-0.7.0.tgz.sha256" \ + --output vendor/clone-sdk/clone-ai-prompt-prediction-0.7.0.tgz.sha256 ``` If GitHub reports restricted access, use an account with repository read access: ```sh -gh release download v0.6.4 --repo cloneisyou/clone-sdk \ - --pattern 'clone-ai-tab-completion-0.6.4.tgz*' --dir vendor/clone-sdk +gh release download v0.7.0 --repo cloneisyou/clone-sdk \ + --pattern 'clone-ai-prompt-prediction-0.7.0.tgz*' --dir vendor/clone-sdk ``` Then verify and install with your existing package manager: ```sh -(cd vendor/clone-sdk && shasum -a 256 -c clone-ai-tab-completion-0.6.4.tgz.sha256) -npm install ./vendor/clone-sdk/clone-ai-tab-completion-0.6.4.tgz +(cd vendor/clone-sdk && shasum -a 256 -c clone-ai-prompt-prediction-0.7.0.tgz.sha256) +npm install ./vendor/clone-sdk/clone-ai-prompt-prediction-0.7.0.tgz ``` On Linux, use `sha256sum -c` in place of `shasum -a 256 -c`. Commit the lockfile. Do not put access tokens in package URLs or lockfiles. @@ -59,7 +59,7 @@ On Linux, use `sha256sum -c` in place of `shasum -a 256 -c`. Commit the lockfile The first public npm release, `@clone-ai/tab-completion@0.6.3`, passed an independent anonymous installation and matched its verified GitHub release. It used an authenticated local CLI and has no CI provenance. GitHub release archives remain available. The registry workflow refuses to run while the repository is private. -The npm trusted publisher is configured for owner `cloneisyou`, repository `clone-sdk`, workflow `publish.yml` and environment `npm`, and `NPM_PUBLISH_ENABLED=true`. It allows direct `npm publish`. Distribution-tag management is not granted. Choose `next` (the default) for a preview or `latest` for a stable package when dispatching the workflow; the selected tag is assigned by publication itself. The manual workflow accepts an existing release tag and registry, repeats validation, compares all installed release content with the tested package, and uses OIDC instead of a stored npm token. See [npm's trusted publisher documentation](https://docs.npmjs.com/trusted-publishers/). +Starting with 0.7.0, npm releases use `@clone-ai/prompt-prediction`. Publication requires a package-level trusted publisher for owner `cloneisyou`, repository `clone-sdk`, workflow `publish.yml` and environment `npm`, and `NPM_PUBLISH_ENABLED=true`. It allows direct `npm publish`. Distribution-tag management is not granted. Choose `next` (the default) for a preview or `latest` for a stable package when dispatching the workflow; the selected tag is assigned by publication itself. The manual workflow accepts an existing release tag and registry, repeats validation, compares all installed release content with the tested package, and uses OIDC instead of a stored npm token. See [npm's trusted publisher documentation](https://docs.npmjs.com/trusted-publishers/). The Python distribution is `clone-sdk`. Before the first PyPI publication, configure a pending trusted publisher with owner `cloneisyou`, repository `clone-sdk`, workflow `publish.yml`, environment `pypi` and the account owner's verified email. For an existing project, configure its publisher on that project instead. Enable `PYPI_PUBLISH_ENABLED=true` only after configuration. The PyPI job requires wheel and source bytes to match the release and verifies a fresh anonymous installation after publishing. See [PyPI publisher setup](https://docs.pypi.org/trusted-publishers/adding-a-publisher/). diff --git a/docs/reliability.md b/docs/reliability.md index a448c10..b66fb2c 100644 --- a/docs/reliability.md +++ b/docs/reliability.md @@ -4,7 +4,7 @@ Mount the editor and process typing, attachments, Undo, IME and manual send independently of Clone. Never await prediction in the normal send path, disable the input during prediction, or gate the whole product on Clone health. Hide suggestions on failures. Telemetry is best effort. -SDK 0.6.4 uses a 15-second default client deadline (configurable up to 30 seconds) including response-body reads. The reusable server client limits concurrent requests to 16 by default and fails fast on saturation. The controller drops expired, canceled and identity-mismatched results. Recovery does not send anything automatically. A request whose outcome is unknown must retain its ID and body for reconciliation. +SDK 0.7.0 uses a 15-second default client deadline (configurable up to 30 seconds) including response-body reads. The reusable server client limits concurrent requests to 16 by default and fails fast on saturation. The controller drops expired, canceled and identity-mismatched results. Recovery does not send anything automatically. A request whose outcome is unknown must retain its ID and body for reconciliation. ## Configured limits are not measured capacity diff --git a/docs/start.md b/docs/start.md index b539c99..5e407a0 100644 --- a/docs/start.md +++ b/docs/start.md @@ -2,7 +2,7 @@ This is the entry point for your coding agent. Implement next-prompt prediction and Tab Completion using the product’s own context by default, then run automated verification. End users need no Clone account. Offer Clone account personalization only as an optional enhancement in settings; do not put a Connect screen before the composer. Preserve the product's authentication, composer, explicit send behavior and agent execution. Automatic submission is a separate, optional Clone mode with explicit end-user start and bounded scope. -This guide targets **SDK 0.6.4**. Version 0.3.1 lacks the presentation, deadline and Clone mode options; inspect the installed version before using them. Onboarding documentation can change independently of that immutable package. Read this guide, [agent integration](agent-integration.md), [context mapping](context-mapping.md), [service boundaries](data-and-service.md), and the installed package's exported types and `openapi.json`. The types and schema define the wire contract. Do not stop after writing a plan or building a separate demo. +This guide targets **SDK 0.7.0**. Version 0.3.1 lacks the presentation, deadline and Clone mode options; inspect the installed version before using them. Onboarding documentation can change independently of that immutable package. Read this guide, [agent integration](agent-integration.md), [context mapping](context-mapping.md), [service boundaries](data-and-service.md), and the installed package's exported types and `openapi.json`. The types and schema define the wire contract. Do not stop after writing a plan or building a separate demo. ## Start from one prompt @@ -59,7 +59,7 @@ For the explicitly chosen sandbox path, save the key and continue without a card Install the public npm package using the product's existing package manager: ```sh -npm install --save-exact @clone-ai/tab-completion@0.6.4 +npm install --save-exact @clone-ai/prompt-prediction@0.7.0 ``` Commit the appropriate lockfile. Node 22.13+, ESM and React 18/19 are supported. Do not upgrade the entire host application without establishing compatibility. A Git submodule is not required. diff --git a/package.json b/package.json index 144b3e8..b466432 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@clone-ai/tab-completion", - "version": "0.6.4", + "name": "@clone-ai/prompt-prediction", + "version": "0.7.0", "description": "Context-aware composer suggestions with optional presentation and explicitly started Clone mode.", "type": "module", "sideEffects": false, diff --git a/scripts/create-example.mjs b/scripts/create-example.mjs index 207124b..5b8cbb1 100644 --- a/scripts/create-example.mjs +++ b/scripts/create-example.mjs @@ -11,10 +11,10 @@ const files = ['scripts/pilot-metrics.mjs', 'examples/react/demo.tsx', 'examples for (const file of files) { let text = await readFile(resolve(root, file), 'utf8'); for (const [from, to] of Object.entries({ - '../../src/react.js': '@clone-ai/tab-completion/react', '../../src/assistant-ui.js': '@clone-ai/tab-completion/assistant-ui', - '../../src/transport.js': '@clone-ai/tab-completion', '../../src/types.js': '@clone-ai/tab-completion', - '../../src/feedback.js': '@clone-ai/tab-completion', - '../../src/server.js': '@clone-ai/tab-completion/server', + '../../src/react.js': '@clone-ai/prompt-prediction/react', '../../src/assistant-ui.js': '@clone-ai/prompt-prediction/assistant-ui', + '../../src/transport.js': '@clone-ai/prompt-prediction', '../../src/types.js': '@clone-ai/prompt-prediction', + '../../src/feedback.js': '@clone-ai/prompt-prediction', + '../../src/server.js': '@clone-ai/prompt-prediction/server', })) text = text.replaceAll(from, to); await mkdir(dirname(resolve(target, file)), { recursive: true }); await writeFile(resolve(target, file), text); @@ -25,7 +25,7 @@ await writeFile(resolve(target, 'tsconfig.json'), JSON.stringify({ compilerOptio }, include: ['examples'] }, null, 2)); await writeFile(resolve(target, 'package.json'), JSON.stringify({ name: 'clone-tab-integration-example', private: true, type: 'module', scripts: { dev: 'vite --config examples/react/vite.config.ts', build: 'tsc && vite build --config examples/react/vite.config.ts', test: 'playwright test' }, - dependencies: { '@clone-ai/tab-completion': 'file:' + resolve(tarball), '@assistant-ui/react': '0.15.21', react: '19.2.4', 'react-dom': '19.2.4' }, + dependencies: { '@clone-ai/prompt-prediction': 'file:' + resolve(tarball), '@assistant-ui/react': '0.15.21', react: '19.2.4', 'react-dom': '19.2.4' }, devDependencies: { vite: '8.0.16', typescript: '5.9.3', '@playwright/test': '1.60.0', '@types/node': '24.12.2', '@types/react': '19.2.14', '@types/react-dom': '19.2.3' }, }, null, 2)); console.log('Created independent example at', target); diff --git a/scripts/test-package.mjs b/scripts/test-package.mjs index bcc7880..6fa31c1 100644 --- a/scripts/test-package.mjs +++ b/scripts/test-package.mjs @@ -12,7 +12,7 @@ function run(command, args, cwd = root) { execFileSync(command, args, { cwd, stdio: 'inherit', env: process.env }); } run('npm', ['pack', '--pack-destination', artifacts]); -const filename = `clone-ai-tab-completion-${pkg.version}.tgz`; +const filename = `clone-ai-prompt-prediction-${pkg.version}.tgz`; const tarball = resolve(artifacts, filename); const checksum = createHash('sha256').update(await readFile(tarball)).digest('hex'); await writeFile(tarball + '.sha256', `${checksum} ${filename}\n`); diff --git a/tests/browser/composer.spec.ts b/tests/browser/composer.spec.ts index 8c7639e..0056ab5 100644 --- a/tests/browser/composer.spec.ts +++ b/tests/browser/composer.spec.ts @@ -1,5 +1,5 @@ import { expect, test } from '@playwright/test'; -import type { CompletionRequest } from '@clone-ai/tab-completion'; +import type { CompletionRequest } from '@clone-ai/prompt-prediction'; for (const assistant of [false, true]) { test.describe(assistant ? 'assistant-ui' : 'React textarea', () => {