Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ type: software
authors:
- family-names: Oswald
given-names: Jamie
version: 0.1.12
date-released: 2026-09-25
version: 0.1.24
date-released: 2026-10-03
url: "https://onceexec.com/"
repository-code: "https://github.com/stringsofthemind-oss/once"
license: MIT
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# @once-agent/sdk

> **Automatic Connect:** `@once-agent/sdk@0.1.22` publishes the tested
> **Natural Placement (SDK 0.1.24):** `wrapTool(callback, semantics)` protects a
> host-owned tool callback using the existing local safety engine. Supply stable
> logical identity, complete effect/account binding and authoritative reconciliation.
> Requires Node.js 24.15+ and one durable same-machine SQLite authority; `UNKNOWN`
> blocks redispatch. Opaque callback retries and connector-only model access remain
> outside this boundary. See [the integration examples](./examples/natural-placement/README.md).

> **Automatic Connect:** `@once-agent/sdk@0.1.24` publishes the tested
> `@once-agent/sdk/connect` path for classifying supported agent tools as
> `BYPASS`, `PROTECT`, or fail-closed `UNKNOWN`, then wiring whole local tool
> registries with trusted logical identity and effect binding. It also includes
Expand Down Expand Up @@ -28,7 +35,7 @@ Once helps protect supported refunds, bookings, payments and other externally vi
- Automatic Connect guide: [`docs/CONNECT_AUTO.md`](./docs/CONNECT_AUTO.md)
- MCP idempotency guide: https://onceexec.com/mcp-idempotency/
- AI agent retry safety: https://onceexec.com/ai-agent-retry-safety/
- TypeScript SDK: [`@once-agent/sdk@0.1.22`](https://www.npmjs.com/package/@once-agent/sdk)
- TypeScript SDK: [`@once-agent/sdk@0.1.24`](https://www.npmjs.com/package/@once-agent/sdk)
- Python SDK: [`once-agent-sdk==0.1.1`](https://pypi.org/project/once-agent-sdk/)
- MCP package: `@once-agent/mcp@0.1.5`
- MCP Registry: `io.github.stringsofthemind-oss/once`
Expand Down
2 changes: 1 addition & 1 deletion docs/GATEWAY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Once Gateway

Status: available in the published `@once-agent/sdk@0.1.13` package.
Status: available in the current published `@once-agent/sdk@0.1.24` package (introduced in 0.1.13).

The Once Gateway selectively routes an agent/runtime's **already-selected tool subset** without copying the global Tool Graph into model context.

Expand Down
203 changes: 203 additions & 0 deletions docs/PUBLIC_CONSISTENCY_0_1_24_AUDIT.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions docs/agent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Once — Agent-Readable Product Guide

> **Automatic Connect:** `@once-agent/sdk@0.1.14` publishes the tested
> **Natural Placement (SDK 0.1.24):** `wrapTool(callback, semantics)` protects a host-owned unary callback. Supply stable logical identity, complete effect/account binding and authoritative reconciliation. Requires Node.js 24.15+ and one durable same-machine SQLite authority. `UNKNOWN` blocks redispatch; opaque internal retries and connector-only model access are outside the boundary. See https://github.com/stringsofthemind-oss/once/tree/main/examples/natural-placement.

> **Automatic Connect:** `@once-agent/sdk@0.1.24` publishes the tested
> `@once-agent/sdk/connect` toolset integration path. It can classify supported
> agent tools as `BYPASS`, `PROTECT`, or fail-closed `UNKNOWN`, bind trusted
> logical intent identity and effect payload, and return a connected local tool
Expand All @@ -24,7 +26,7 @@ Canonical site: https://onceexec.com/

Repository: https://github.com/stringsofthemind-oss/once

TypeScript SDK: `@once-agent/sdk@0.1.14`
TypeScript SDK: `@once-agent/sdk@0.1.24`

npm: https://www.npmjs.com/package/@once-agent/sdk

Expand Down
2 changes: 1 addition & 1 deletion docs/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h3>With Once · protected boundary</h3>
</main>
<footer class="footer wrap">
<span
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.22</span> · Python <span data-version="python">0.1.1</span> ·
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.24</span> · Python <span data-version="python">0.1.1</span> ·
MCP <span data-version="mcp">0.1.5</span></span
>
<nav aria-label="Footer">
Expand Down
2 changes: 1 addition & 1 deletion docs/evidence/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h2>Review the source and safety tests</h2>
</main>
<footer class="footer wrap">
<span
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.22</span> · Python <span data-version="python">0.1.1</span> ·
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.24</span> · Python <span data-version="python">0.1.1</span> ·
MCP <span data-version="mcp">0.1.5</span></span
>
<nav aria-label="Footer">
Expand Down
11 changes: 6 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@type": "SoftwareApplication",
"name": "Once",
"applicationCategory": "DeveloperApplication",
"softwareVersion": "0.1.22",
"softwareVersion": "0.1.24",
"url": "https://onceexec.com/",
"codeRepository": "https://github.com/stringsofthemind-oss/once",
"license": "https://opensource.org/license/mit",
Expand Down Expand Up @@ -248,9 +248,10 @@ <h2>Install is the beginning.<br />Verification is the goal.</h2>
<button type="button" data-copy-target="home-install" data-copy-label="Copy install command" data-copy-event="install_copied">
Copy install command
</button>
<pre><code id="home-install">npm install @once-agent/sdk@0.1.22</code></pre>
<pre><code id="home-install">npm install @once-agent/sdk@0.1.24</code></pre>
</div>
<p class="small">Node.js 24.15+ · Durable state on one machine · No Once API key</p>
<p>Natural Placement in SDK 0.1.24: <code>wrapTool(callback, semantics)</code> wraps a host-owned tool callback with stable logical identity, complete effect binding and authoritative reconciliation. <code>UNKNOWN</code> blocks redispatch.</p>
<p class="small">Node.js 24.15+ · Durable state on one machine · No Once API key · Opaque internal retries and connector-only model access are outside the boundary.</p>
<div class="actions">
<a class="btn primary" href="/quickstart/" data-event="quickstart_started">Start the complete quickstart</a
><a href="/quickstart/#real-action">Then wire a real action →</a>
Expand Down Expand Up @@ -278,7 +279,7 @@ <h3>Crash and retry labs</h3>
</article>
<article class="card">
<h3>Published source</h3>
<p>Current TypeScript SDK: <span data-version="ts">0.1.22</span>. Historical evidence stays labelled and pinned.</p>
<p>Current TypeScript SDK: <span data-version="ts">0.1.24</span>. Historical evidence stays labelled and pinned.</p>
<a href="https://github.com/stringsofthemind-oss/once/releases" data-event="github_click">View releases →</a>
</article>
</div>
Expand Down Expand Up @@ -426,7 +427,7 @@ <h2>Protect one action.<br />Prove it survives a retry.</h2>
</main>
<footer class="footer wrap">
<span
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.22</span> · Python <span data-version="python">0.1.1</span> ·
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.24</span> · Python <span data-version="python">0.1.1</span> ·
MCP <span data-version="mcp">0.1.5</span></span
>
<nav aria-label="Footer">
Expand Down
6 changes: 4 additions & 2 deletions docs/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ https://onceexec.com/
Repository:
https://github.com/stringsofthemind-oss/once

TYPESCRIPT SDK: @once-agent/sdk@0.1.14
TYPESCRIPT SDK: @once-agent/sdk@0.1.24
Install: npm install @once-agent/sdk
npm: https://www.npmjs.com/package/@once-agent/sdk

PYTHON SDK: once-agent-sdk==0.1.1
Install: pip install once-agent-sdk
PyPI: https://pypi.org/project/once-agent-sdk/

AUTOMATIC CONNECT: published in @once-agent/sdk@0.1.14. It can classify supported agent-tool descriptors as BYPASS, PROTECT, or fail-closed UNKNOWN; plan and connect whole local tool registries; resolve trusted intent/idempotency identity; bind effect payload; and structurally wrap OpenAI Agents FunctionTools. Automatic protected local execution requires Node 24.15+ and shared same-machine SQLite state. It is not a multi-host or universal exactly-once guarantee.
NATURAL PLACEMENT: SDK 0.1.24 provides wrapTool(callback, semantics) for a host-owned unary callback. Supply stable logical identity, complete effect/account binding and authoritative reconciliation. Requires Node 24.15+ and one durable same-machine SQLite authority. UNKNOWN blocks redispatch. Opaque internal retries and connector-only model access remain outside this boundary.

AUTOMATIC CONNECT: published in @once-agent/sdk@0.1.24. It can classify supported agent-tool descriptors as BYPASS, PROTECT, or fail-closed UNKNOWN; plan and connect whole local tool registries; resolve trusted intent/idempotency identity; bind effect payload; and structurally wrap OpenAI Agents FunctionTools. Automatic protected local execution requires Node 24.15+ and shared same-machine SQLite state. It is not a multi-host or universal exactly-once guarantee.
LOCAL PROTECTION: protectLocal(existingAsyncFunction, {id, payload}) keeps the call shape and receiver, snapshots ordinary data arguments, and uses durable same-machine SQLite on Node 24.15+. It validates a narrow plain-data domain. UNKNOWN and CONFLICT block; do not infer ABSENT from a timeout. See examples/local-function/README.md in the repository. For separate hosts use a supported distributed Once integration.
MCP package: @once-agent/mcp@0.1.5
MCP Registry: io.github.stringsofthemind-oss/once
Expand Down
2 changes: 1 addition & 1 deletion docs/published-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ts": "0.1.22",
"ts": "0.1.24",
"mcp": "0.1.5"
}
4 changes: 2 additions & 2 deletions docs/quickstart/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h2>1. Check Node and install</h2>
mkdir once-first-action
cd once-first-action
npm init -y
npm install @once-agent/sdk@0.1.22</code></pre>
npm install @once-agent/sdk@0.1.24</code></pre>
</div>
<p>
If Node is older than 24.15, update it before running local protection. The general hosted SDK has a different requirement; this
Expand Down Expand Up @@ -356,7 +356,7 @@ <h2>Keep protection active</h2>
</main>
<footer class="footer wrap">
<span
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.22</span> · Python <span data-version="python">0.1.1</span> ·
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.24</span> · Python <span data-version="python">0.1.1</span> ·
MCP <span data-version="mcp">0.1.5</span></span
>
<nav aria-label="Footer">
Expand Down
2 changes: 1 addition & 1 deletion docs/retry-exposure/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h1>Estimate retry exposure.</h1>
</main>
<footer class="footer wrap">
<span
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.22</span> · Python <span data-version="python">0.1.1</span> ·
>Once · Open source · MIT<br />TypeScript <span data-version="ts">0.1.24</span> · Python <span data-version="python">0.1.1</span> ·
MCP <span data-version="mcp">0.1.5</span></span
>
<nav aria-label="Footer">
Expand Down
12 changes: 9 additions & 3 deletions examples/natural-placement/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Natural placement (unreleased branch API)
# Natural placement (SDK 0.1.24)

Node 24.15+; build the branch SDK, then install its packed tarball in your application. This API is not in the published 0.1.23 package.
Requires Node.js 24.15+. Install the published SDK in your application:

`host-callback.mjs` and `mcp-client.mjs` are reusable integration examples. Copy them into an application that has installed the branch tarball and supply its fixed host/client and authoritative lookup.
```bash
npm install @once-agent/sdk
```

`wrapTool` is available in SDK 0.1.24.

`host-callback.mjs` and `mcp-client.mjs` are reusable integration examples. Copy them into an application that has installed SDK 0.1.24 or later and supply its fixed host/client and authoritative lookup.

## Ordinary host callback

Expand Down
4 changes: 2 additions & 2 deletions mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The tool descriptions are intentionally explicit about mutation:
- assessment and planning tools are marked read-only;
- setup/protection tools are marked destructive and require explicit confirmation tokens;
- the API key is inherited from `ONCE_API_KEY` and is never intentionally returned by the MCP server;
- the helper server shells out to the pinned `@once-agent/sdk@0.1.13` CLI rather than reimplementing Once protection logic.
- the helper server shells out to the package-pinned `@once-agent/sdk@0.1.14` CLI (the independent MCP 0.1.5 dependency, not the current standalone SDK version) rather than reimplementing Once protection logic.

## Current claim boundary

Expand Down Expand Up @@ -88,7 +88,7 @@ Do not commit API keys to configuration files that will be published.
The default command starts the Once helper server. To protect calls to a reviewed local MCP stdio server, start the proxy explicitly:

```bash
npx -y @once-agent/mcp@0.1.4 proxy --config .once/mcp.json
npx -y @once-agent/mcp@0.1.5 proxy --config .once/mcp.json
```

The config must name the upstream command, pin the SHA-256 digest of its reviewed complete `tools/list` catalog, and specify protection decisions and identity/effect fields for consequential tools. It requires `serverId`, `command`, `args`, `statePath`, `expectedCatalogSha256`, and `tools`; each tool policy sets `decision` to `PROTECT` or `BYPASS`. The proxy refuses a changed catalog and preserves an unknown outcome after an ambiguous upstream error. Keep its SQLite state path durable and private. The [source regression](https://github.com/stringsofthemind-oss/once/blob/main/mcp/scripts/phase13b-stdio-e2e.mjs) includes a disposable example config.
Expand Down
10 changes: 5 additions & 5 deletions plugins/openai/once/skills/protect-consequential-writes/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ Never make an operation ID unique by adding a timestamp, random retry token, age

1. **Assess after the gate passes** — once a qualifying external-write candidate has already been identified, call `once_assess_project` with the absolute project path. If MCP is unavailable, run the pinned CLI fallback:

`npx --yes --package=@once-agent/sdk@0.1.22 once scan <project>`
`npx --yes --package=@once-agent/sdk@0.1.24 once scan <project>`

2. **Explain applicability** — for each high-signal candidate, verify the four routing conditions. Use `once_explain_risk` when helpful. Do not equate every POST, write, retry loop, or MCP action with a Once requirement.

3. **Plan before mutation** — call `once_plan_setup` and/or `once_plan_protection`. If using the CLI, prefer read-only planning commands such as:

- `npx --yes --package=@once-agent/sdk@0.1.22 once setup <project> --plan`
- `npx --yes --package=@once-agent/sdk@0.1.22 once protect <project>`
- `npx --yes --package=@once-agent/sdk@0.1.22 once protect <project> --all --patch`
- `npx --yes --package=@once-agent/sdk@0.1.24 once setup <project> --plan`
- `npx --yes --package=@once-agent/sdk@0.1.24 once protect <project>`
- `npx --yes --package=@once-agent/sdk@0.1.24 once protect <project> --all --patch`

4. **Show the plan** — identify the exact operation, why it qualifies, the stable identity inputs, the provider/reconciliation assumption, and the files or callsites that would change.

Expand All @@ -60,7 +60,7 @@ Never make an operation ID unique by adding a timestamp, random retry token, age

7. **Verify** — run `once_verify_connection` when Cloud verification is relevant, or use:

`npx --yes --package=@once-agent/sdk@0.1.22 once doctor`
`npx --yes --package=@once-agent/sdk@0.1.24 once doctor`

Do not expose `ONCE_API_KEY` in output, source code, patches, logs, or committed configuration.

Expand Down
8 changes: 8 additions & 0 deletions scripts/check-site-surface.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ const claudeReadme = read("plugins/claude-code/once/README.md");
const pythonVersion = pythonProject.match(/^version\s*=\s*"([^"]+)"/m)?.[1];
assert.ok(pythonVersion, "could not read Python SDK version");

for (const file of ["docs/agent.md", "docs/llms.txt", "docs/GATEWAY.md"]) {
const current = read(file);
assert.ok(current.includes(`@once-agent/sdk@${published.ts}`), `${file}: current SDK must match published metadata`);
assert.doesNotMatch(current, /@once-agent\/sdk@0\.1\.(14|22)\b/, `${file}: obsolete current SDK reference`);
}
assert.match(rootReadme, /Natural Placement[\s\S]*wrapTool/, "root README must expose Natural Placement");
assert.match(homepage, /Natural Placement[\s\S]*wrapTool/, "homepage must expose Natural Placement");

const siteTs = homepage.match(/data-version="ts">([^<]+)/)?.[1];
const sitePython = homepage.match(/data-version="python">([^<]+)/)?.[1];
const siteMcp = homepage.match(/data-version="mcp">([^<]+)/)?.[1];
Expand Down
9 changes: 5 additions & 4 deletions scripts/website-browser-check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
import assert from 'node:assert/strict';
import { createServer } from 'node:http';
import { readFileSync, existsSync, statSync, mkdirSync } from 'node:fs';
import { resolve, extname } from 'node:path';
import { resolve, extname, sep } from 'node:path';
import { fileURLToPath } from 'node:url';
const root = fileURLToPath(new URL('../', import.meta.url));
const docs = resolve(root, 'docs');
const published = JSON.parse(readFileSync(resolve(docs, 'published-versions.json'), 'utf8'));
const artifacts = process.env.ONCE_WEBSITE_ARTIFACTS || resolve(root, '.website-check');
mkdirSync(artifacts, { recursive: true });
const { chromium } = await import(process.env.ONCE_PLAYWRIGHT_MODULE || 'playwright');
const server = createServer((req, res) => {
let file = resolve(docs, '.' + new URL(req.url, 'http://localhost').pathname);
if (!file.startsWith(docs + '/') && file !== docs) {
if (!file.startsWith(docs + sep) && file !== docs) {
res.writeHead(403).end();
return;
}
Expand Down Expand Up @@ -89,11 +90,11 @@ try {
});
});
await page.getByRole('button', { name: 'Copy setup commands', exact: true }).click();
assert.match(await page.evaluate(() => window.testCopied), /npm install @once-agent\/sdk@0.1.22/);
assert.ok((await page.evaluate(() => window.testCopied)).includes(`npm install @once-agent/sdk@${published.ts}`));
assert.equal(await page.locator('[data-copy-status]').innerText(), 'Copied to clipboard.');
await page.locator('summary').first().click();
const sample = await page.locator('#example').innerText();
assert.equal(sample, readFileSync(resolve(docs, 'quickstart/first-action.mjs'), 'utf8'));
assert.equal(sample, readFileSync(resolve(docs, 'quickstart/first-action.mjs'), 'utf8').replaceAll('\r\n', '\n'));
await page.screenshot({ path: resolve(artifacts, 'quickstart.png') });
await page.goto(base + '/retry-exposure/');
await page.getByRole('button', { name: 'Estimate exposure' }).click();
Expand Down
2 changes: 1 addition & 1 deletion sdk/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Keep all effect-bearing inputs in `effect.args`; transport metadata may be suppl
separately as `metadata`. This requires one preserved local authority across retries.
Full source contract: [PROTECT_TOOL_CALL.md](../../docs/PROTECT_TOOL_CALL.md).

> **Automatic Connect in 0.1.12:** this SDK version includes the
> **Automatic Connect (introduced in 0.1.12):** the current SDK includes the
> `@once-agent/sdk/connect` public surface for automatic tool classification,
> whole-toolset wiring, trusted intent identity, conservative effect binding,
> and OpenAI Agents FunctionTool wrapping. It has passed source, packed-package,
Expand Down
2 changes: 1 addition & 1 deletion sdk/typescript/examples/GITHUB_ISSUE_RECOVERY.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export ONCE_STATE_PATH="$PWD/.once/github-issues.sqlite"
```

For an installed-package consumer, copy `github-issue-recovery.mjs` into your
own project and install `@once-agent/sdk@0.1.21`. It imports the public package
own project and run `npm install @once-agent/sdk` (current SDK 0.1.24). It imports the public package
by name; no private source imports or extra runtime dependencies are needed.

Persist this input as `intent.json` **before** the first call:
Expand Down
2 changes: 1 addition & 1 deletion workers/playground/src/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading