iterate 0.2.7 → 0.3.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/README.md +86 -76
- package/THIRD_PARTY_NOTICES.md +55 -0
- package/bin/iterate.js +11 -3
- package/dist/api-url-B6404M82.mjs +17 -0
- package/dist/api-url-B6404M82.mjs.map +1 -0
- package/dist/app-ref-BipL0feU.mjs +35 -0
- package/dist/app-ref-BipL0feU.mjs.map +1 -0
- package/dist/app-ref-C1CrgXqX.mjs +7 -0
- package/dist/app-ref-C1CrgXqX.mjs.map +1 -0
- package/dist/app-ref-DYai_om1.mjs +7 -0
- package/dist/app-ref-DYai_om1.mjs.map +1 -0
- package/dist/cli-D0c-pDL_.mjs +1010 -0
- package/dist/cli-D0c-pDL_.mjs.map +1 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.mjs +4 -0
- package/dist/cloudflare-BTm90gQ4.mjs +951 -0
- package/dist/cloudflare-BTm90gQ4.mjs.map +1 -0
- package/dist/contract-s4FW4eES.mjs +309 -0
- package/dist/contract-s4FW4eES.mjs.map +1 -0
- package/dist/document-review/index.d.ts +5 -0
- package/dist/document-review/types.d.ts +107 -0
- package/dist/document-review.mjs +7015 -0
- package/dist/document-review.mjs.map +1 -0
- package/dist/durable-object-processor-durability-CNsTjAJS.mjs +205 -0
- package/dist/durable-object-processor-durability-CNsTjAJS.mjs.map +1 -0
- package/dist/idempotency-DleloJNt.mjs +28 -0
- package/dist/idempotency-DleloJNt.mjs.map +1 -0
- package/dist/index.mjs +1 -1
- package/dist/itx/api-url.d.ts +6 -0
- package/dist/itx/itx-node-client.d.ts +65 -0
- package/dist/itx/itx-session.d.ts +215 -0
- package/dist/itx/owned-rpc-session.d.ts +14 -0
- package/dist/itx/query-client.d.ts +10 -0
- package/dist/itx-api.generated.d.ts +6195 -0
- package/dist/itx-session-sjud8GiT.mjs +534 -0
- package/dist/itx-session-sjud8GiT.mjs.map +1 -0
- package/dist/live-state-BJNqOwFw.mjs +299 -0
- package/dist/live-state-BJNqOwFw.mjs.map +1 -0
- package/dist/next/api.d.ts +479 -0
- package/dist/next/api.mjs +0 -0
- package/dist/next/app-server.d.ts +44 -0
- package/dist/next/app-server.mjs +479 -0
- package/dist/next/app-server.mjs.map +1 -0
- package/dist/next/app-session.d.ts +49 -0
- package/dist/next/app-session.mjs +238 -0
- package/dist/next/app-session.mjs.map +1 -0
- package/dist/next/app.d.ts +29 -0
- package/dist/next/app.mjs +141 -0
- package/dist/next/app.mjs.map +1 -0
- package/dist/next/client/live-state.d.ts +63 -0
- package/dist/next/client/oauth.d.ts +12 -0
- package/dist/next/client/react.d.ts +109 -0
- package/dist/next/client/socket.d.ts +6 -0
- package/dist/next/client.mjs +156 -0
- package/dist/next/client.mjs.map +1 -0
- package/dist/next/expression.d.ts +146 -0
- package/dist/next/expression.mjs +399 -0
- package/dist/next/expression.mjs.map +1 -0
- package/dist/next/lib.d.ts +56 -0
- package/dist/next/lib.mjs +199 -0
- package/dist/next/lib.mjs.map +1 -0
- package/dist/next/oauth-scopes.d.ts +32 -0
- package/dist/next/oauth-scopes.mjs +40 -0
- package/dist/next/oauth-scopes.mjs.map +1 -0
- package/dist/next/oauth.mjs +29 -0
- package/dist/next/oauth.mjs.map +1 -0
- package/dist/next/principal.d.ts +64 -0
- package/dist/next/principal.mjs +98 -0
- package/dist/next/principal.mjs.map +1 -0
- package/dist/next/project-ingress.d.ts +37 -0
- package/dist/next/project-ingress.mjs +75 -0
- package/dist/next/project-ingress.mjs.map +1 -0
- package/dist/next/react.mjs +285 -0
- package/dist/next/react.mjs.map +1 -0
- package/dist/next/sdk/auth.d.ts +5 -0
- package/dist/next/sdk/index.d.ts +112 -0
- package/dist/next/sdk.mjs +139 -0
- package/dist/next/sdk.mjs.map +1 -0
- package/dist/next/stream/processor.d.ts +378 -0
- package/dist/next/stream/processor.mjs +582 -0
- package/dist/next/stream/processor.mjs.map +1 -0
- package/dist/next/stream/run.d.ts +58 -0
- package/dist/next/stream/run.mjs +40 -0
- package/dist/next/stream/run.mjs.map +1 -0
- package/dist/next-node.d.ts +15 -0
- package/dist/next-node.mjs +51 -0
- package/dist/next-node.mjs.map +1 -0
- package/dist/node.d.ts +3 -0
- package/dist/node.mjs +185 -0
- package/dist/node.mjs.map +1 -0
- package/dist/processor-host-capabilities-BMFH3KTM.mjs +56 -0
- package/dist/processor-host-capabilities-BMFH3KTM.mjs.map +1 -0
- package/dist/processors/cloudflare.d.ts +3 -0
- package/dist/processors/durable-object-processor-durability.d.ts +79 -0
- package/dist/processors/event-consumption-metrics.d.ts +82 -0
- package/dist/processors/idempotency.d.ts +13 -0
- package/dist/processors/index.d.ts +12 -0
- package/dist/processors/processor-contracts.d.ts +342 -0
- package/dist/processors/processor-facet.d.ts +186 -0
- package/dist/processors/processor-host-capabilities.d.ts +60 -0
- package/dist/processors/prompt-sections.d.ts +17 -0
- package/dist/processors/rpc-types.d.ts +515 -0
- package/dist/processors/schemas.d.ts +102 -0
- package/dist/processors/stream-handle.d.ts +45 -0
- package/dist/processors/stream-processor-keepalive.d.ts +95 -0
- package/dist/processors/stream-processor-registry.d.ts +233 -0
- package/dist/processors/stream-processor-runner.d.ts +289 -0
- package/dist/processors/stream-processor.d.ts +339 -0
- package/dist/processors/stream-runtime-metrics.d.ts +107 -0
- package/dist/processors/testing.d.ts +302 -0
- package/dist/processors-BoNyeBfQ.mjs +10 -0
- package/dist/processors-BoNyeBfQ.mjs.map +1 -0
- package/dist/processors-cloudflare.mjs +3 -0
- package/dist/processors-testing.mjs +435 -0
- package/dist/processors-testing.mjs.map +1 -0
- package/dist/processors.mjs +52 -0
- package/dist/processors.mjs.map +1 -0
- package/dist/protocol-DnK_f2m6.mjs +251 -0
- package/dist/protocol-DnK_f2m6.mjs.map +1 -0
- package/dist/sdk/capnweb/index.d.ts +2 -0
- package/dist/sdk/capnweb/live-state/compact.d.ts +5 -0
- package/dist/sdk/capnweb/live-state/diff.d.ts +41 -0
- package/dist/sdk/capnweb/live-state/engine.d.ts +44 -0
- package/dist/sdk/capnweb/live-state/index.d.ts +41 -0
- package/dist/sdk/capnweb/live-state/protocol.d.ts +87 -0
- package/dist/sdk/capnweb/live-state/retain.d.ts +23 -0
- package/dist/sdk/capnweb/live-state/store.d.ts +20 -0
- package/dist/sdk/capnweb/live-state/types.d.ts +11 -0
- package/dist/sdk/capnweb/react.d.ts +45 -0
- package/dist/sdk/capnweb/react.mjs +316 -0
- package/dist/sdk/capnweb/react.mjs.map +1 -0
- package/dist/sdk/capnweb.mjs +4 -0
- package/dist/sdk/itx/react.d.ts +191 -0
- package/dist/sdk/itx/react.mjs +383 -0
- package/dist/sdk/itx/react.mjs.map +1 -0
- package/dist/sdk-DMB-IM11.mjs +933 -0
- package/dist/sdk-DMB-IM11.mjs.map +1 -0
- package/dist/sdk.d.ts +339 -0
- package/dist/sdk.mjs +2 -0
- package/dist/serve-itx.d.ts +46 -0
- package/dist/starter-apps/flake-dashboard/app-ref.d.ts +31 -0
- package/dist/starter-apps/flake-dashboard/configured-worker.mjs +1055 -0
- package/dist/starter-apps/flake-dashboard/configured-worker.mjs.map +1 -0
- package/dist/starter-apps/flake-dashboard/contract.d.ts +4839 -0
- package/dist/starter-apps/flake-dashboard/contract.mjs +2 -0
- package/dist/starter-apps/flake-dashboard/index.d.ts +17 -0
- package/dist/starter-apps/flake-dashboard/index.mjs +56 -0
- package/dist/starter-apps/flake-dashboard/index.mjs.map +1 -0
- package/dist/starter-apps/flake-dashboard/worker.d.ts +4607 -0
- package/dist/starter-apps/github-ai-linter/ai-linter.d.ts +8914 -0
- package/dist/starter-apps/github-ai-linter/configured-worker.mjs +17987 -0
- package/dist/starter-apps/github-ai-linter/configured-worker.mjs.map +1 -0
- package/dist/starter-apps/github-ai-linter/contract.d.ts +9193 -0
- package/dist/starter-apps/github-ai-linter/index.d.ts +10 -0
- package/dist/starter-apps/github-ai-linter/index.mjs +36 -0
- package/dist/starter-apps/github-ai-linter/index.mjs.map +1 -0
- package/dist/starter-apps/github-ai-linter/prompt.d.ts +13 -0
- package/dist/starter-apps/github-ai-linter/review-bot.d.ts +808 -0
- package/dist/starter-apps/github-ai-linter/rules.d.ts +34 -0
- package/dist/starter-apps/github-ai-linter/worker-ref.d.ts +19 -0
- package/dist/starter-apps/github-ai-linter/worker.d.ts +19 -0
- package/dist/starter-apps/github-ai-linter/worker.mjs +947 -0
- package/dist/starter-apps/github-ai-linter/worker.mjs.map +1 -0
- package/dist/starter-apps/guestbook/app-ref.d.ts +27 -0
- package/dist/starter-apps/guestbook/client.d.ts +7 -0
- package/dist/starter-apps/guestbook/client.mjs +59 -0
- package/dist/starter-apps/guestbook/configured-worker.mjs +205 -0
- package/dist/starter-apps/guestbook/configured-worker.mjs.map +1 -0
- package/dist/starter-apps/guestbook/index.d.ts +9 -0
- package/dist/starter-apps/guestbook/index.mjs +31 -0
- package/dist/starter-apps/guestbook/index.mjs.map +1 -0
- package/dist/starter-apps/guestbook/processor.d.ts +2267 -0
- package/dist/starter-apps/guestbook/worker.d.ts +26 -0
- package/dist/starter-apps/guestbook/worker.mjs +191 -0
- package/dist/starter-apps/guestbook/worker.mjs.map +1 -0
- package/dist/starter-apps/media/configured-worker.mjs +577 -0
- package/dist/starter-apps/media/configured-worker.mjs.map +1 -0
- package/dist/starter-apps/media/index.mjs +36 -0
- package/dist/starter-apps/media/index.mjs.map +1 -0
- package/dist/starter-apps/media/ref.mjs +20 -0
- package/dist/starter-apps/media/ref.mjs.map +1 -0
- package/dist/starter-apps/media/worker.mjs +579 -0
- package/dist/starter-apps/media/worker.mjs.map +1 -0
- package/dist/starter-apps/notes/configured-worker.mjs +6134 -0
- package/dist/starter-apps/notes/configured-worker.mjs.map +1 -0
- package/dist/starter-apps/notes/index.mjs +23 -0
- package/dist/starter-apps/notes/index.mjs.map +1 -0
- package/dist/starter-apps/notes/ref.mjs +21 -0
- package/dist/starter-apps/notes/ref.mjs.map +1 -0
- package/dist/starter-apps/notes/worker.mjs +427 -0
- package/dist/starter-apps/notes/worker.mjs.map +1 -0
- package/dist/starter-apps/todo/client.mjs +59 -0
- package/dist/starter-apps/todo/configured-worker.mjs +2864 -0
- package/dist/starter-apps/todo/configured-worker.mjs.map +1 -0
- package/dist/starter-apps/todo/index.d.ts +8 -0
- package/dist/starter-apps/todo/index.mjs +29 -0
- package/dist/starter-apps/todo/index.mjs.map +1 -0
- package/dist/stream-processor-keepalive-DAQTP6m3.mjs +2082 -0
- package/dist/stream-processor-keepalive-DAQTP6m3.mjs.map +1 -0
- package/dist/usingCtx-inzbY1Qz.mjs +57 -0
- package/dist/usingCtx-mZx5nsAW.mjs +11800 -0
- package/dist/usingCtx-mZx5nsAW.mjs.map +1 -0
- package/dist/worker-ref-DZxPDmb_.mjs +390 -0
- package/dist/worker-ref-DZxPDmb_.mjs.map +1 -0
- package/menubar/Iterate.entitlements +12 -0
- package/menubar/Iterate.swift +914 -0
- package/menubar/IterateIcon.swift +145 -0
- package/menubar/README.md +28 -0
- package/menubar/build-menubar-app.sh +59 -0
- package/package.json +235 -18
- package/dist/cli-DMS4kJph.mjs +0 -868
- package/dist/cli-DMS4kJph.mjs.map +0 -1
- package/dist/config-DtnR7Lv7.mjs +0 -170
- package/dist/config-DtnR7Lv7.mjs.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/stream-tui/agent-chat-terminal.d.mts +0 -1
- package/dist/stream-tui/agent-chat-terminal.mjs +0 -933
- package/dist/stream-tui/agent-chat-terminal.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,97 +1,107 @@
|
|
|
1
1
|
# iterate
|
|
2
2
|
|
|
3
|
-
CLI for
|
|
3
|
+
CLI for OS Next (`apps/os-next`). Requires Node >=22.15; no Bun runtime.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
```sh
|
|
6
|
+
npx iterate # offline help
|
|
7
|
+
npx iterate login # browser OAuth with project consent
|
|
8
|
+
npx iterate projects list
|
|
9
|
+
npx iterate orgs list
|
|
10
|
+
npx iterate ping
|
|
11
|
+
npx iterate repl --project my-project # local Node REPL
|
|
12
|
+
npx iterate itx run --project my-project --eval 'return await itx.whoami();'
|
|
13
|
+
npx iterate use-my-computer --project my-project --name myComputer
|
|
14
|
+
npx iterate menubar --project my-project # macOS app
|
|
15
|
+
npx iterate logout
|
|
16
|
+
```
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
The default server is `https://os.iterate2.com`. Login uses that server's OAuth
|
|
19
|
+
issuer, PKCE and a loopback callback. Tokens refresh automatically before a
|
|
20
|
+
command when close to expiry. `ITERATE_BEARER_TOKEN` supplies a token for scripts;
|
|
21
|
+
`APP_CONFIG_ADMIN_API_SECRET` supplies operator credentials and takes precedence.
|
|
22
|
+
`ITERATE_SKIP_BROWSER_OPEN=1` prints the login URL without opening a browser.
|
|
23
|
+
|
|
24
|
+
## Running scripts
|
|
25
|
+
|
|
26
|
+
`itx run` executes a JavaScript function body on OS Next with `itx` in scope.
|
|
27
|
+
Use `return` for the result. The server records the run and its settlement;
|
|
28
|
+
the CLI never retries a script automatically. Scripts execute on the server,
|
|
29
|
+
so local Node APIs and local filesystem access are unavailable.
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
iterate itx run --project my-project --context /notes --eval '
|
|
33
|
+
await itx.append({ type: "note", payload: { text: "hello" } });
|
|
34
|
+
return await itx.readEvents(0, 10);
|
|
35
|
+
'
|
|
36
|
+
iterate itx run --project my-project --file ./script.js
|
|
37
|
+
cat script.js | iterate itx run --project my-project --file -
|
|
38
|
+
```
|
|
12
39
|
|
|
13
|
-
|
|
14
|
-
|
|
40
|
+
Specify exactly one of `--eval` or `--file`. `--context` is a project-local path
|
|
41
|
+
(default `/`). `--project` accepts an id or slug; otherwise the CLI uses the
|
|
42
|
+
config's `defaultProject`, or the only project accessible to the session.
|
|
15
43
|
|
|
16
|
-
##
|
|
44
|
+
## Use my computer
|
|
17
45
|
|
|
18
|
-
|
|
46
|
+
`use-my-computer` shares a Mac as a live OS Next capability until Ctrl-C:
|
|
19
47
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
48
|
+
- `itx.myComputer.ask({ question, buttons? })`: native choice dialog.
|
|
49
|
+
- `itx.myComputer.notify({ message, title? })`: desktop notification.
|
|
50
|
+
- `itx.myComputer.runSwift({ code })`: Swift with the owner's local permissions.
|
|
51
|
+
- `itx.myComputer.__describe()`: usage instructions and method signatures.
|
|
23
52
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
53
|
+
The command requires macOS, AppleScript and Swift. Share only with a project
|
|
54
|
+
you trust: its callers can run local code. The capability belongs to the live
|
|
55
|
+
connection and is released on exit. A disconnect or token expiry ends sharing
|
|
56
|
+
with an error; rerun the command to refresh authentication and reconnect.
|
|
27
57
|
|
|
28
|
-
|
|
29
|
-
npx iterate chat
|
|
30
|
-
```
|
|
58
|
+
## Configs and migration
|
|
31
59
|
|
|
32
|
-
|
|
60
|
+
Configs live in `${XDG_CONFIG_HOME:-~/.config}/iterate/config.json`. Selection
|
|
61
|
+
order is `--config`, a parent-directory workspace mapping, the default config,
|
|
62
|
+
a single saved config, then built-in `prd`.
|
|
33
63
|
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
64
|
+
```sh
|
|
65
|
+
iterate config set --name next --os-base-url https://os.iterate2.com \
|
|
66
|
+
--default-project my-project --set-default
|
|
67
|
+
iterate --config next login
|
|
68
|
+
iterate config set --name local --os-base-url http://localhost:8787 --set-workspace
|
|
69
|
+
iterate config list
|
|
70
|
+
iterate config get
|
|
39
71
|
```
|
|
40
72
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- `iterate chat` - open the Iterate agent chat terminal UI
|
|
45
|
-
- `iterate login` - authenticate with browser-based OAuth
|
|
46
|
-
- `iterate logout` - remove the stored session for the current config
|
|
47
|
-
- `iterate orgs list`
|
|
48
|
-
- `iterate config ...`
|
|
49
|
-
- `iterate os ...`
|
|
50
|
-
|
|
51
|
-
## Config file
|
|
52
|
-
|
|
53
|
-
Config path:
|
|
54
|
-
|
|
55
|
-
`${XDG_CONFIG_HOME:-~/.config}/iterate/config.json`
|
|
56
|
-
|
|
57
|
-
Config shape:
|
|
58
|
-
|
|
59
|
-
```json
|
|
60
|
-
{
|
|
61
|
-
"configs": {
|
|
62
|
-
"default": {
|
|
63
|
-
"osBaseUrl": "https://os.iterate.com",
|
|
64
|
-
"authBaseUrl": "https://auth.iterate.com",
|
|
65
|
-
"defaultProject": "my-project"
|
|
66
|
-
},
|
|
67
|
-
"dev": {
|
|
68
|
-
"osBaseUrl": "http://localhost:54896",
|
|
69
|
-
"authBaseUrl": "http://localhost:7101"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"default": "default",
|
|
73
|
-
"workspaces": {
|
|
74
|
-
"/absolute/workspace/path": "dev"
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
```
|
|
73
|
+
Existing configs keep their server URL. For a config that targets the old OS,
|
|
74
|
+
set its `--os-base-url` to an OS Next deployment and log in again. Changing the
|
|
75
|
+
server clears that config's session. There is no separate `authBaseUrl` setting.
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
The old chat TUI and remotely discovered `iterate os ...` commands are removed.
|
|
78
|
+
The menu bar supports sign-in and computer sharing. Approval code is retained
|
|
79
|
+
but dormant until OS Next supports it. Use `iterate itx run` for scripts;
|
|
80
|
+
its `--project` selects the project and `--context` selects a path within it.
|
|
80
81
|
|
|
81
|
-
##
|
|
82
|
+
## Node REPL
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
`iterate repl` opens a local Node REPL with the authenticated session as `itx`
|
|
85
|
+
(try `await itx.projects.list()`) and the transport's `RpcTarget` constructor.
|
|
86
|
+
Pass `--project my-project --context /` to bind `itx` to a project context;
|
|
87
|
+
a configured `defaultProject` also selects a project. Top-level `await`, Node APIs and `.load` are available. The bindings remain available after `.clear`; `.exit` releases the context and connection. A lost connection
|
|
88
|
+
ends the REPL visibly; it never silently repeats your commands.
|
|
85
89
|
|
|
86
|
-
##
|
|
90
|
+
## Node connections
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
`iterate/next/node` exposes a connection owner for OS Next scripts and live
|
|
93
|
+
providers. It uses the same protocol and cleanup as the CLI:
|
|
89
94
|
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
```js
|
|
96
|
+
import { connectOsNext } from "iterate/next/node";
|
|
97
|
+
|
|
98
|
+
using connection = await connectOsNext({
|
|
99
|
+
baseUrl: "https://os.iterate2.com",
|
|
100
|
+
auth: { type: "bearer", token: process.env.ITERATE_BEARER_TOKEN },
|
|
101
|
+
});
|
|
102
|
+
using project = await connection.session.projects.get("my-project");
|
|
103
|
+
console.log(await project.run("async (itx) => await itx.whoami()"));
|
|
97
104
|
```
|
|
105
|
+
|
|
106
|
+
The package launcher delegates to repository source during development and
|
|
107
|
+
uses the published build when installed through `npx`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
`dist/document-review.mjs` bundles the following third-party software.
|
|
4
|
+
|
|
5
|
+
## Roughdraft 0.1.10
|
|
6
|
+
|
|
7
|
+
- Source: https://github.com/Lex-Inc/roughdraft
|
|
8
|
+
- Author: Nathan Baschez
|
|
9
|
+
- License: MIT, as declared by Roughdraft's published package manifest and source README.
|
|
10
|
+
|
|
11
|
+
The Roughdraft source tree and published package manifest do not include a copyright notice. The MIT license text is reproduced below without adding one.
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
MIT License
|
|
15
|
+
|
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
18
|
+
in the Software without restriction, including without limitation the rights
|
|
19
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
21
|
+
furnished to do so, subject to the following conditions:
|
|
22
|
+
|
|
23
|
+
The above copyright notice and this permission notice shall be included in all
|
|
24
|
+
copies or substantial portions of the Software.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
32
|
+
SOFTWARE.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## yaml 2.9.0
|
|
36
|
+
|
|
37
|
+
- Source: https://github.com/eemeli/yaml/tree/v2.9.0
|
|
38
|
+
- Author: Eemeli Aro <eemeli@gmail.com>
|
|
39
|
+
- License: ISC
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
Copyright Eemeli Aro <eemeli@gmail.com>
|
|
43
|
+
|
|
44
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
45
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
46
|
+
and this permission notice appear in all copies.
|
|
47
|
+
|
|
48
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
49
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
50
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
51
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
52
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
53
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
54
|
+
THIS SOFTWARE.
|
|
55
|
+
```
|
package/bin/iterate.js
CHANGED
|
@@ -35,6 +35,11 @@ const isEphemeralPackageRunner = () =>
|
|
|
35
35
|
process.env.npm_command === "exec" &&
|
|
36
36
|
(process.env.npm_lifecycle_event === "npx" || process.env.npm_lifecycle_event === "bunx");
|
|
37
37
|
|
|
38
|
+
// The black-box PTY lane builds the package, then exercises this same public
|
|
39
|
+
// bin while the monorepo source tree is still present. Force the published
|
|
40
|
+
// artifact path so that test cannot accidentally fall back to TypeScript.
|
|
41
|
+
const forceBuiltPackage = process.env.ITERATE_FORCE_BUILT_PACKAGE === "1";
|
|
42
|
+
|
|
38
43
|
/**
|
|
39
44
|
* Find a local version of the iterate CLI that differs from the currently
|
|
40
45
|
* running script. Returns an importable module path, or null.
|
|
@@ -60,7 +65,10 @@ const findLocalModule = () => {
|
|
|
60
65
|
// 2. Check for a local node_modules install
|
|
61
66
|
const nmRoot = findUp("node_modules/.bin/iterate");
|
|
62
67
|
if (nmRoot) {
|
|
63
|
-
|
|
68
|
+
// pnpm's .bin entry is a shell shim, so compare the package's actual bin.
|
|
69
|
+
// Comparing the shim itself mistakes our own package for another install
|
|
70
|
+
// and sends repository development to a stale dist build.
|
|
71
|
+
const nmScript = join(nmRoot, "node_modules/iterate/bin/iterate.js");
|
|
64
72
|
if (existsSync(nmScript) && realpathSync(nmScript) !== selfReal) {
|
|
65
73
|
// Published package — use dist
|
|
66
74
|
const nmDist = join(nmRoot, "node_modules/iterate/dist/index.mjs");
|
|
@@ -71,7 +79,7 @@ const findLocalModule = () => {
|
|
|
71
79
|
return null;
|
|
72
80
|
};
|
|
73
81
|
|
|
74
|
-
const localModule = isEphemeralPackageRunner() ? null : findLocalModule();
|
|
82
|
+
const localModule = isEphemeralPackageRunner() || forceBuiltPackage ? null : findLocalModule();
|
|
75
83
|
if (localModule) {
|
|
76
84
|
const { runCli } = await import(localModule);
|
|
77
85
|
await runCli();
|
|
@@ -80,7 +88,7 @@ if (localModule) {
|
|
|
80
88
|
// In monorepo dev: src/index.ts exists. Published: dist/index.mjs exists.
|
|
81
89
|
const srcPath = join(pkgRoot, "src/index.ts");
|
|
82
90
|
const distPath = join(pkgRoot, "dist/index.mjs");
|
|
83
|
-
const modulePath = existsSync(srcPath) ? srcPath : distPath;
|
|
91
|
+
const modulePath = !forceBuiltPackage && existsSync(srcPath) ? srcPath : distPath;
|
|
84
92
|
const { runCli } = await import(modulePath);
|
|
85
93
|
await runCli();
|
|
86
94
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/itx/api-url.ts
|
|
2
|
+
/**
|
|
3
|
+
* An OS deployment's `/api` WebSocket URL from its http(s) base — the ONE
|
|
4
|
+
* place that knows the path and the ws/wss protocol swap, shared by the
|
|
5
|
+
* shared session and the one-shot Node client.
|
|
6
|
+
*/
|
|
7
|
+
function apiWebSocketUrl(baseUrl) {
|
|
8
|
+
const base = baseUrl.trim().replace(/\/+$/, "");
|
|
9
|
+
if (!base) throw new Error("an OS deployment base URL is required (the config's APP_CONFIG_BASE_URL)");
|
|
10
|
+
const url = new URL("/api", base);
|
|
11
|
+
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
|
12
|
+
return url;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { apiWebSocketUrl as t };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=api-url-B6404M82.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-url-B6404M82.mjs","names":[],"sources":["../src/itx/api-url.ts"],"sourcesContent":["/**\n * An OS deployment's `/api` WebSocket URL from its http(s) base — the ONE\n * place that knows the path and the ws/wss protocol swap, shared by the\n * shared session and the one-shot Node client.\n */\nexport function apiWebSocketUrl(baseUrl: string): URL {\n const base = baseUrl.trim().replace(/\\/+$/, \"\");\n if (!base) {\n throw new Error(\"an OS deployment base URL is required (the config's APP_CONFIG_BASE_URL)\");\n }\n const url = new URL(\"/api\", base);\n url.protocol = url.protocol === \"https:\" ? \"wss:\" : \"ws:\";\n return url;\n}\n"],"mappings":";;;;;;AAKA,SAAgB,gBAAgB,SAAsB;CACpD,MAAM,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,QAAQ,EAAE;CAC9C,IAAI,CAAC,MACH,MAAM,IAAI,MAAM,0EAA0E;CAE5F,MAAM,MAAM,IAAI,IAAI,QAAQ,IAAI;CAChC,IAAI,WAAW,IAAI,aAAa,WAAW,SAAS;CACpD,OAAO;AACT"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/starter-apps/guestbook/app-ref.ts
|
|
2
|
+
const guestbookStreamPath = "/guestbook";
|
|
3
|
+
const guestbookWorkerRef = {
|
|
4
|
+
className: "GuestbookApp",
|
|
5
|
+
durableWorkerKey: "app-guestbook-stream",
|
|
6
|
+
path: "/",
|
|
7
|
+
source: { createWorker: {
|
|
8
|
+
entryPoint: "node_modules/iterate/dist/starter-apps/guestbook/configured-worker.mjs",
|
|
9
|
+
files: {
|
|
10
|
+
include: ["package.json"],
|
|
11
|
+
repoPath: "/repos/config",
|
|
12
|
+
type: "repo"
|
|
13
|
+
}
|
|
14
|
+
} },
|
|
15
|
+
type: "stateful"
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The Guestbook's creation facts. The project worker owns committed event
|
|
19
|
+
* delivery through GuestbookApp.processEvent; no stream ever carries an
|
|
20
|
+
* app-specific subscription for the Guestbook (streams that predate the
|
|
21
|
+
* current subscription model are recreated, not migrated), so there is no
|
|
22
|
+
* retirement fact to append — removing a key that was never configured is a
|
|
23
|
+
* hard error.
|
|
24
|
+
*/
|
|
25
|
+
function guestbookCreationEvents() {
|
|
26
|
+
return [{
|
|
27
|
+
type: "events.iterate.com/guestbook/created",
|
|
28
|
+
payload: { config: { title: "Guestbook" } },
|
|
29
|
+
idempotencyKey: "guestbook/created"
|
|
30
|
+
}];
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { guestbookStreamPath as n, guestbookWorkerRef as r, guestbookCreationEvents as t };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=app-ref-BipL0feU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-ref-BipL0feU.mjs","names":[],"sources":["../src/starter-apps/guestbook/app-ref.ts"],"sourcesContent":["// The Guestbook's physical identity. Keeping the durable key stable preserves\n// its processor storage while the implementation moves out of config repos.\nimport type { StreamEventInput } from \"../../processors/index.ts\";\nimport type { StatefulDynamicWorkerRef } from \"../../sdk.ts\";\n\nexport const guestbookStreamPath = \"/guestbook\";\n\nexport const guestbookWorkerRef = {\n className: \"GuestbookApp\",\n // \"-stream\" keeps clear of a retired predecessor's durable identity.\n durableWorkerKey: \"app-guestbook-stream\",\n path: \"/\",\n source: {\n createWorker: {\n entryPoint: \"node_modules/iterate/dist/starter-apps/guestbook/configured-worker.mjs\",\n files: {\n include: [\"package.json\"],\n repoPath: \"/repos/config\",\n type: \"repo\",\n },\n },\n },\n type: \"stateful\",\n} satisfies StatefulDynamicWorkerRef;\n\n/**\n * The Guestbook's creation facts. The project worker owns committed event\n * delivery through GuestbookApp.processEvent; no stream ever carries an\n * app-specific subscription for the Guestbook (streams that predate the\n * current subscription model are recreated, not migrated), so there is no\n * retirement fact to append — removing a key that was never configured is a\n * hard error.\n */\nexport function guestbookCreationEvents(): StreamEventInput[] {\n return [\n {\n type: \"events.iterate.com/guestbook/created\",\n payload: { config: { title: \"Guestbook\" } },\n idempotencyKey: \"guestbook/created\",\n },\n ];\n}\n"],"mappings":";AAKA,MAAa,sBAAsB;AAEnC,MAAa,qBAAqB;CAChC,WAAW;CAEX,kBAAkB;CAClB,MAAM;CACN,QAAQ,EACN,cAAc;EACZ,YAAY;EACZ,OAAO;GACL,SAAS,CAAC,cAAc;GACxB,UAAU;GACV,MAAM;EACR;CACF,EACF;CACA,MAAM;AACR;;;;;;;;;AAUA,SAAgB,0BAA8C;CAC5D,OAAO,CACL;EACE,MAAM;EACN,SAAS,EAAE,QAAQ,EAAE,OAAO,YAAY,EAAE;EAC1C,gBAAgB;CAClB,CACF;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { notesWorkerRef as notesWorkerRef$1 } from "./starter-apps/notes/ref.mjs";
|
|
2
|
+
//#region src/starter-apps/notes/app-ref.ts
|
|
3
|
+
const notesWorkerRef = notesWorkerRef$1;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { notesWorkerRef as t };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=app-ref-C1CrgXqX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-ref-C1CrgXqX.mjs","names":["notesWorkerRefLiteral"],"sources":["../src/starter-apps/notes/app-ref.ts"],"sourcesContent":["// The NotesApp's physical identity: a stable durable key preserves its\n// processor storage across implementation updates. The literal lives in\n// ref.ts (dependency-free for the mobile app); this module holds the\n// satisfies check against the real ref type.\nimport type { StatefulDynamicWorkerRef } from \"../../sdk.ts\";\nimport { notesWorkerRef as notesWorkerRefLiteral } from \"./ref.ts\";\n\nexport { notesRepoPath, notesWorkspacePath } from \"./ref.ts\";\n\nexport const notesWorkerRef = notesWorkerRefLiteral satisfies StatefulDynamicWorkerRef;\n"],"mappings":";;AASA,MAAa,iBAAiBA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { mediaWorkerRef as mediaWorkerRef$1 } from "./starter-apps/media/ref.mjs";
|
|
2
|
+
//#region src/starter-apps/media/app-ref.ts
|
|
3
|
+
const mediaWorkerRef = mediaWorkerRef$1;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { mediaWorkerRef as t };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=app-ref-DYai_om1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-ref-DYai_om1.mjs","names":["mediaWorkerRefLiteral"],"sources":["../src/starter-apps/media/app-ref.ts"],"sourcesContent":["// The MediaApp's physical identity: a stable durable key preserves its\n// processor storage across implementation updates. The literal lives in\n// ref.ts (dependency-free for the mobile e2e); this module holds the\n// satisfies check against the real ref type.\nimport type { StatefulDynamicWorkerRef } from \"../../sdk.ts\";\nimport { mediaWorkerRef as mediaWorkerRefLiteral } from \"./ref.ts\";\n\nexport { mediaStreamPath } from \"./ref.ts\";\n\nexport const mediaWorkerRef = mediaWorkerRefLiteral satisfies StatefulDynamicWorkerRef;\n"],"mappings":";;AASA,MAAa,iBAAiBA"}
|