@oddington/sdk 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ Oddington SDK License
2
+
3
+ Copyright (c) 2026 Oddington. All rights reserved.
4
+
5
+ Subject to the terms governing your use of Oddington services, Oddington grants
6
+ you a limited, non-exclusive, non-transferable, revocable license to download,
7
+ install, copy as reasonably necessary for installation or backup, and use an
8
+ unmodified copy of this software solely to access Oddington services for which
9
+ you are authorized.
10
+
11
+ You may not distribute, sublicense, sell, modify, or create derivative works of
12
+ this software except with Oddington's prior written permission. You may not
13
+ reverse engineer or circumvent access controls except to the extent such a
14
+ restriction is prohibited by applicable law.
15
+
16
+ This software is provided "as is", without warranties of any kind, express or
17
+ implied. Oddington may update or withdraw it at any time.
package/README.md CHANGED
@@ -1,3 +1,69 @@
1
- # Temporary Holding Version
1
+ # Oddington SDK
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The importable client for Oddington routines and response handlers. Requires
4
+ Node.js 22.12.0 or later. Installing the package grants no authority.
5
+
6
+ ```sh
7
+ npm install @oddington/sdk
8
+ ```
9
+
10
+ ```ts
11
+ import { defineHandler, resolveAsk, routinePublicationClient } from '@oddington/sdk';
12
+
13
+ const inbox = routinePublicationClient();
14
+ ```
15
+
16
+ Managed routine launches supply workspace, scoped capability and working root.
17
+ The defaults read `ODDINGTON_ROUTINE_WORKSPACE`, `ODDINGTON_ROUTINE_RUN` and
18
+ `ODDINGTON_INBOX_WORKING_ROOT` (or the current directory). Callers may supply the
19
+ existing `workspace`, `capability` and `workingRoot` options. Runtime context
20
+ provides authority; callers cannot select repository remotes or expand grants.
21
+ The same calls prepare locally when launched with `os routine run --local`, and
22
+ the CLI owns explicit publication and recovery of that prepared run.
23
+
24
+ Retain evidence with `inbox.files.add({ path: 'evidence.txt' })`. Paths stay within
25
+ the invocation's working root and uploaded bytes are verified against the retained
26
+ file. Use `inbox.repository.readRecords`, `writeRecords`, `updateRecords` and
27
+ `deleteRecords` for shared Records capabilities. Writes require a trusted routine
28
+ launch and installed write grant. Carry the returned `receipt.commit` into a
29
+ subsequent `readRecords({ repository, refs, atCommit: receipt.commit })` to capture
30
+ the prepared version for review. Retrying writes or publication uses the same
31
+ request key and exact input; server boundaries own validation, effects and receipts.
32
+
33
+ Hosts publishing as a member supply the existing `request` option:
34
+
35
+ ```ts
36
+ const inbox = routinePublicationClient({ workspace, workingRoot, request });
37
+ ```
38
+
39
+ Here `request` is the host's authorized member transport. A member can publish an
40
+ initial handlerless Ask or Digest where allowed; a member login supplies no
41
+ routine repository-write authority. Login, session storage and refresh belong
42
+ to `@oddington/cli`.
43
+
44
+ The CLI consumes the same SDK and supplies its signed-in member transport to CLI
45
+ commands. The former `@oddington/cli/inbox` subpath is removed; routines import
46
+ this package root.
47
+
48
+ The managed response runner supplies the SDK to approved handler modules:
49
+
50
+ ```ts
51
+ export const handlers = [defineHandler({
52
+ id: 'review',
53
+ run: async () => resolveAsk({ outcome: 'Reviewed' }),
54
+ })];
55
+ ```
56
+
57
+ A self-contained module importing only the SDK needs no customer dependency
58
+ installation. Customer manifests cannot replace the runner-owned SDK. The runner
59
+ selects the approved code revision and handler, and supplies only scoped capability
60
+ transport. The package contains public runtime code, declarations, this README and
61
+ its license; it has no executable, operator/server code or infrastructure credentials.
62
+
63
+ From the product checkout, run `bun run --filter @oddington/sdk build`, then
64
+ `bun run --filter @oddington/sdk verify:package`. Verification installs the actual
65
+ tarball offline into a temporary consumer without the CLI, imports and typechecks
66
+ through `@oddington/sdk`, and exercises retained evidence, handlerless publication
67
+ and guarded repository calls. Set `PACKAGE_VERIFY_NODE` to the Node 22.12.0
68
+ executable for supported-baseline proof. The CLI's corresponding verifier installs
69
+ both local tarballs, checks `os --help` and refuses the removed subpath.