@tenderprompt/accounts 0.8.4 → 0.9.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.
Files changed (106) hide show
  1. package/README.md +6 -355
  2. package/cli.js +8 -0
  3. package/package.json +7 -29
  4. package/dist/api.d.ts +0 -109
  5. package/dist/api.d.ts.map +0 -1
  6. package/dist/api.js +0 -141
  7. package/dist/api.js.map +0 -1
  8. package/dist/artifact.d.ts +0 -8
  9. package/dist/artifact.d.ts.map +0 -1
  10. package/dist/artifact.js +0 -205
  11. package/dist/artifact.js.map +0 -1
  12. package/dist/auth-store.d.ts +0 -51
  13. package/dist/auth-store.d.ts.map +0 -1
  14. package/dist/auth-store.js +0 -242
  15. package/dist/auth-store.js.map +0 -1
  16. package/dist/cli.d.ts +0 -3
  17. package/dist/cli.d.ts.map +0 -1
  18. package/dist/cli.js +0 -4
  19. package/dist/cli.js.map +0 -1
  20. package/dist/contracts.d.ts +0 -226
  21. package/dist/contracts.d.ts.map +0 -1
  22. package/dist/contracts.js +0 -5
  23. package/dist/contracts.js.map +0 -1
  24. package/dist/errors.d.ts +0 -10
  25. package/dist/errors.d.ts.map +0 -1
  26. package/dist/errors.js +0 -19
  27. package/dist/errors.js.map +0 -1
  28. package/dist/files.d.ts +0 -22
  29. package/dist/files.d.ts.map +0 -1
  30. package/dist/files.js +0 -272
  31. package/dist/files.js.map +0 -1
  32. package/dist/index.d.ts +0 -4
  33. package/dist/index.d.ts.map +0 -1
  34. package/dist/index.js +0 -4
  35. package/dist/index.js.map +0 -1
  36. package/dist/main.d.ts +0 -37
  37. package/dist/main.d.ts.map +0 -1
  38. package/dist/main.js +0 -2131
  39. package/dist/main.js.map +0 -1
  40. package/dist/oauth.d.ts +0 -67
  41. package/dist/oauth.d.ts.map +0 -1
  42. package/dist/oauth.js +0 -187
  43. package/dist/oauth.js.map +0 -1
  44. package/dist/processes.d.ts +0 -12
  45. package/dist/processes.d.ts.map +0 -1
  46. package/dist/processes.js +0 -48
  47. package/dist/processes.js.map +0 -1
  48. package/dist/profile-bindings.d.ts +0 -26
  49. package/dist/profile-bindings.d.ts.map +0 -1
  50. package/dist/profile-bindings.js +0 -214
  51. package/dist/profile-bindings.js.map +0 -1
  52. package/dist/starter.d.ts +0 -20
  53. package/dist/starter.d.ts.map +0 -1
  54. package/dist/starter.js +0 -154
  55. package/dist/starter.js.map +0 -1
  56. package/skill/tender-accounts/SKILL.md +0 -372
  57. package/templates/shopify-customer-account/AGENTS.md +0 -15
  58. package/templates/shopify-customer-account/CLAUDE.md +0 -1
  59. package/templates/shopify-customer-account/README.md +0 -50
  60. package/templates/shopify-customer-account/apps/gateway/AGENTS.md +0 -10
  61. package/templates/shopify-customer-account/apps/gateway/CLAUDE.md +0 -1
  62. package/templates/shopify-customer-account/apps/gateway/README.md +0 -9
  63. package/templates/shopify-customer-account/apps/gateway/database-schema.json +0 -49
  64. package/templates/shopify-customer-account/apps/gateway/dot.dev.vars.example +0 -12
  65. package/templates/shopify-customer-account/apps/gateway/migrations/0001_customer_auth.sql +0 -76
  66. package/templates/shopify-customer-account/apps/gateway/package.json +0 -25
  67. package/templates/shopify-customer-account/apps/gateway/scripts/build-worker.mjs +0 -15
  68. package/templates/shopify-customer-account/apps/gateway/scripts/pack-tender-artifact.mjs +0 -85
  69. package/templates/shopify-customer-account/apps/gateway/src/platform/customer-auth/hostname-policy.ts +0 -66
  70. package/templates/shopify-customer-account/apps/gateway/src/platform/customer-auth/schema.ts +0 -90
  71. package/templates/shopify-customer-account/apps/gateway/src/platform/customer-auth/session-store.ts +0 -864
  72. package/templates/shopify-customer-account/apps/gateway/src/platform/customer-auth/shopify-route-adapter.ts +0 -1157
  73. package/templates/shopify-customer-account/apps/gateway/src/platform/runtime-hostname.ts +0 -46
  74. package/templates/shopify-customer-account/apps/gateway/src/portal-service.test.ts +0 -70
  75. package/templates/shopify-customer-account/apps/gateway/src/portal-service.ts +0 -71
  76. package/templates/shopify-customer-account/apps/gateway/src/runtime-config.test.ts +0 -30
  77. package/templates/shopify-customer-account/apps/gateway/src/runtime-config.ts +0 -56
  78. package/templates/shopify-customer-account/apps/gateway/src/worker.ts +0 -85
  79. package/templates/shopify-customer-account/apps/gateway/tender-accounts.json +0 -10
  80. package/templates/shopify-customer-account/apps/gateway/tender-app.config.json +0 -40
  81. package/templates/shopify-customer-account/apps/gateway/tsconfig.json +0 -13
  82. package/templates/shopify-customer-account/apps/gateway/vitest.config.ts +0 -8
  83. package/templates/shopify-customer-account/apps/gateway/worker-configuration.d.ts +0 -26
  84. package/templates/shopify-customer-account/apps/gateway/wrangler.jsonc +0 -42
  85. package/templates/shopify-customer-account/apps/portal/AGENTS.md +0 -10
  86. package/templates/shopify-customer-account/apps/portal/CLAUDE.md +0 -1
  87. package/templates/shopify-customer-account/apps/portal/README.md +0 -7
  88. package/templates/shopify-customer-account/apps/portal/index.html +0 -13
  89. package/templates/shopify-customer-account/apps/portal/package.json +0 -33
  90. package/templates/shopify-customer-account/apps/portal/scripts/build-worker.mjs +0 -11
  91. package/templates/shopify-customer-account/apps/portal/scripts/pack-tender-artifact.mjs +0 -63
  92. package/templates/shopify-customer-account/apps/portal/scripts/portal-worker.mjs +0 -84
  93. package/templates/shopify-customer-account/apps/portal/scripts/portal-worker.test.mjs +0 -14
  94. package/templates/shopify-customer-account/apps/portal/src/App.tsx +0 -111
  95. package/templates/shopify-customer-account/apps/portal/src/main.tsx +0 -10
  96. package/templates/shopify-customer-account/apps/portal/src/styles.css +0 -54
  97. package/templates/shopify-customer-account/apps/portal/tender-accounts.json +0 -10
  98. package/templates/shopify-customer-account/apps/portal/tender-app.config.json +0 -19
  99. package/templates/shopify-customer-account/apps/portal/tsconfig.json +0 -14
  100. package/templates/shopify-customer-account/apps/portal/vite.config.ts +0 -7
  101. package/templates/shopify-customer-account/apps/portal/worker-configuration.d.ts +0 -11
  102. package/templates/shopify-customer-account/apps/portal/wrangler.jsonc +0 -22
  103. package/templates/shopify-customer-account/dot.dev.vars.example +0 -4
  104. package/templates/shopify-customer-account/dot.gitignore +0 -9
  105. package/templates/shopify-customer-account/package.json +0 -22
  106. package/templates/shopify-customer-account/scripts/artifact-contract.mjs +0 -109
package/README.md CHANGED
@@ -1,357 +1,8 @@
1
- # `@tenderprompt/accounts`
1
+ # Andeo compatibility CLI
2
2
 
3
- Developer CLI for merchant-owned customer-account applications on Tender.
3
+ Tender Accounts is now Andeo. New installations use `npx @withandeo/cli`
4
+ or the `andeo` executable. This package retains `tender-accounts` and its
5
+ legacy API default while both domains are supported.
4
6
 
5
- The package exposes `tender-accounts`. It runs the validation and packaging commands committed by your repository, verifies the resulting portable artifact, and creates exact previews for review. Your application keeps its own framework, architecture, commerce integrations, and source repository.
6
-
7
- ## Requirements
8
-
9
- - Node.js 22 or newer
10
- - a Tender Accounts project
11
- - a Tender identity with developer access to the project you are changing
12
-
13
- ## Install
14
-
15
- Install the public package as a development dependency:
16
-
17
- ```sh
18
- npm install --save-dev @tenderprompt/accounts
19
- ```
20
-
21
- Verify the installation:
22
-
23
- ```sh
24
- npx @tenderprompt/accounts --version
25
- npx @tenderprompt/accounts --help
26
- ```
27
-
28
- ## Start from the template
29
-
30
- The optional starter creates a merchant-owned two-service repository: a stable Shopify authentication gateway and an independently deployable React portal connected through `PORTAL_UI`.
31
-
32
- Inspect the plan first, then create the project in an empty directory:
33
-
34
- ```sh
35
- npx @tenderprompt/accounts init --name "Acme customer account" --directory ./acme-account --dry-run --json
36
- npx @tenderprompt/accounts init --name "Acme customer account" --directory ./acme-account --json
37
- ```
38
-
39
- The starter includes:
40
-
41
- - Shopify Customer Account authentication with S256 PKCE;
42
- - secure, exact-host shopper sessions;
43
- - a React portal that receives shopper data through the gateway without holding confidential credentials;
44
- - local development configuration and an explicit signed-out development state;
45
- - independent `tender-accounts.json` contracts for the gateway and portal;
46
- - immutable artifact packers, checks, `AGENTS.md`, and the bundled Tender Accounts agent skill.
47
-
48
- The starter does not install dependencies, initialize Git, link a Tender project, contact Tender, or write credentials. Existing applications do not need to use it.
49
-
50
- ## Connect an existing application
51
-
52
- Commit `tender-accounts.json` at the root of each independently deployable application:
53
-
54
- ```json
55
- {
56
- "schema": "tender.accounts-cli/v1",
57
- "commands": {
58
- "dev": "npm run dev",
59
- "check": "npm run check",
60
- "package": "npm run pack:tender"
61
- },
62
- "artifactDirectory": ".tender/artifacts/current",
63
- "returnPath": "/account"
64
- }
65
- ```
66
-
67
- The commands remain yours:
68
-
69
- - `dev` starts the repository's normal local development environment;
70
- - `check` runs the checks that must pass before delivery;
71
- - `package` writes the portable Tender artifact to `artifactDirectory`.
72
-
73
- Run `npx @tenderprompt/accounts config example --json` to print the current contract.
74
-
75
- ## Authenticate and link the checkout
76
-
77
- For a normal terminal, sign in through Tender. Give each merchant or work context a short profile name. The CLI opens a browser, uses Authorization Code with S256 PKCE, and asks you to select one organization and the exact apps this profile may preview:
78
-
79
- ```sh
80
- npx @tenderprompt/accounts auth create acme
81
- ```
82
-
83
- For a coding agent or headless terminal, start a device authorization instead:
84
-
85
- ```sh
86
- npx @tenderprompt/accounts auth create acme --device --no-open --json
87
- ```
88
-
89
- Open the returned URL, approve the organization and apps, then exchange the same pending request:
90
-
91
- ```sh
92
- npx @tenderprompt/accounts auth status --profile acme --json
93
- ```
94
-
95
- The returned pending result includes the exact profile-aware `auth status` command to run after approval. Refreshable profiles are stored in one private mode-0600 user file outside the repository. Set `TENDER_ACCOUNTS_AUTH_FILE` to choose another private location. Access tokens last 15 minutes and rotate from a 30-day login; changing the human's project access takes effect on the next refresh or request authorization check.
96
-
97
- When an agent already knows the exact project, use that project ID as a stable profile name and authorization hint:
98
-
99
- ```sh
100
- npx @tenderprompt/accounts auth create prj_... --device --project prj_... --no-open --json
101
- ```
102
-
103
- List local profiles without exposing their credentials:
104
-
105
- ```sh
106
- npx @tenderprompt/accounts auth list --json
107
- ```
108
-
109
- Activate the profile for this directory tree, validate it, then link the checkout:
110
-
111
- ```sh
112
- npx @tenderprompt/accounts auth activate acme
113
- npx @tenderprompt/accounts auth status --profile acme --json
114
- npx @tenderprompt/accounts link --json
115
- npx @tenderprompt/accounts doctor --json
116
- ```
117
-
118
- The activation applies to this directory and all descendants; a closer child activation wins. It is stored outside the repository, so another terminal can work in a different merchant tree at the same time without changing this one. Set `TENDER_ACCOUNTS_PROFILE_BINDINGS_FILE` only when a controlled environment needs another private machine-local binding file. The link stores only the API origin and exact project ID, which remains a fail-closed target guard; a link containing `authProfile` is rejected because repository content cannot select a local identity. For one command, set `TENDER_ACCOUNTS_PROFILE=acme` or pass `--profile acme`. If named profiles exist but neither a directory activation nor the default profile selects one, the CLI fails closed instead of guessing.
119
-
120
- If the credential can access more than one project, select the intended project explicitly:
121
-
122
- ```sh
123
- npx @tenderprompt/accounts link --project prj_... --json
124
- ```
125
-
126
- CI may still supply an explicitly issued `TENDER_ACCOUNTS_TOKEN` from its protected secret store or over standard input:
127
-
128
- ```sh
129
- printf '%s' "$TENDER_ACCOUNTS_TOKEN" | npx @tenderprompt/accounts auth status --token-stdin --json
130
- ```
131
-
132
- Revoke the stored login when the machine should no longer have access:
133
-
134
- ```sh
135
- npx @tenderprompt/accounts auth delete acme --json
136
- ```
137
-
138
- `auth create` replaces only the named profile; `auth login --force` replaces only the default. `auth delete` removes one named profile and its directory activations. Removing every profile requires the explicit `auth logout --all` command. Refresh, replacement, and deletion use a per-profile compare-and-swap so a late refresh cannot recreate a profile after logout. Concurrent commands may reuse a winning refresh rotation only when the stored tenant, user, and exact project grants are unchanged; a real login/logout/profile race still fails closed as `auth_profile_changed` and revokes any losing newly issued session.
139
-
140
- ## Use Tender-managed Git
141
-
142
- Managed Git is available to every linked deployable project, including a
143
- protected account gateway and an independently editable service. Connect it
144
- from the app directory after authentication and linking:
145
-
146
- ```sh
147
- npx @tenderprompt/accounts source connect --publication preview-only --json
148
- npx @tenderprompt/accounts source status --json
149
- ```
150
-
151
- If the repository is already connected but the developer starts in an empty
152
- workspace, authenticate to the exact project and let the CLI discover, clone,
153
- and link it:
154
-
155
- ```sh
156
- npx @tenderprompt/accounts source status --project prj_... --json
157
- npx @tenderprompt/accounts source pull --project prj_... --dry-run --json
158
- npx @tenderprompt/accounts source pull --project prj_... --json
159
- ```
160
-
161
- The same `source pull` command fast-forwards an existing clean checkout when
162
- one of its remotes exactly matches the connected managed repository. It refuses
163
- dirty, detached, mismatched, paused, and non-empty non-Git workspaces. The
164
- repository credential is scoped to that one project, lives for 15 minutes, and
165
- is passed only to the Git child process; the remote URL and local link contain
166
- no credential. Merchant-hosted Git repositories remain merchant-owned and must
167
- be opened through their own Git provider before `tender-accounts link`.
168
-
169
- The CLI derives the working directory, validation command, package command,
170
- and portable artifact path from this checkout and `tender-accounts.json`. It
171
- adds a token-free `tender` Git remote by default. In a monorepo, run the command
172
- with the same `--cwd` used for `doctor` and `preview`.
173
-
174
- Push the current committed revision without storing a repository credential:
175
-
176
- ```sh
177
- npx @tenderprompt/accounts source push --json
178
- ```
179
-
180
- For repositories with reviewed changes enabled, `source push` uploads a bounded
181
- Git bundle through Tender. The trusted runner verifies the exact commit and
182
- expected feature-branch ref before applying it; the CLI never receives a write
183
- credential and the default branch is protected. Repositories that have not yet
184
- enabled reviewed changes retain the legacy short-lived push credential during
185
- migration. Uncommitted files are never included. `source token` is read-only:
186
-
187
- ```sh
188
- npx @tenderprompt/accounts source token --ttl-seconds 3600 --json
189
- ```
190
-
191
- Use the review flow once an administrator enables reviewed changes:
192
-
193
- ```sh
194
- npx @tenderprompt/accounts source push --branch feature/account-copy --json
195
- npx @tenderprompt/accounts source change create \
196
- --head feature/account-copy \
197
- --title "Update account copy" --json
198
- npx @tenderprompt/accounts source change list --state open --json
199
- npx @tenderprompt/accounts source change show --change scr_... --json
200
- ```
201
-
202
- Tender attaches validation, the immutable release, and exact preview to the
203
- current feature-branch snapshot. A merchant administrator opens that exact
204
- preview, approves it, and selects **Land in main** in the admin. Approval is
205
- invalidated if the base or head moves. Landing uses a compare-and-swap
206
- fast-forward. Landing never publishes directly; the repository's already
207
- configured default-branch policy may publish the same exact preview only after
208
- the resulting `main` validation succeeds. Protected gateways remain
209
- preview-only.
210
-
211
- Inspect the managed repository without cloning it:
212
-
213
- ```sh
214
- npx @tenderprompt/accounts source branches --json
215
- npx @tenderprompt/accounts source log --branch main --limit 20 --json
216
- npx @tenderprompt/accounts source compare --base main --head feature/account-copy --json
217
- ```
218
-
219
- These commands use an ephemeral read-only credential in a temporary Git
220
- process. They report Tender's authoritative default branch separately from the
221
- provider's create-time default and never persist or print the credential.
222
-
223
- Before reviewed changes are enabled, a merchant source administrator can use
224
- the lower-level migration command to promote an already-previewed branch into
225
- the current default with an exact expected-SHA lease:
226
-
227
- ```sh
228
- npx @tenderprompt/accounts source promote \
229
- --head feature/account-copy \
230
- --expected-current <current-main-sha> \
231
- --dry-run --json
232
- npx @tenderprompt/accounts source promote \
233
- --head feature/account-copy \
234
- --expected-current <current-main-sha> \
235
- --idempotency-key account-copy-v1 --json
236
- ```
237
-
238
- `source default set` changes only Tender's default-branch metadata. The
239
- exceptional `source history replace` command is for repository migrations: it
240
- requires the exact repository ID, a successful preview of the proposed head,
241
- an expected current SHA, and a dry run. Tender archives the previous target ref
242
- before an exact compare-and-swap replacement and always suppresses automatic
243
- production publication for that migration. There is no generic force-push
244
- command.
245
-
246
- ```sh
247
- npx @tenderprompt/accounts source history replace \
248
- --head app-only-main \
249
- --expected-current <current-main-sha> \
250
- --confirm src_... \
251
- --dry-run --json
252
- ```
253
-
254
- Every source mutation returns a durable `sop_` operation. Inspect it with
255
- `source operation status`. If a transient provider or runner failure leaves
256
- that exact operation failed or pending, resume the stored intent by ID; Tender
257
- does not ask the caller to reconstruct branches, SHAs, or confirmation values:
258
-
259
- ```sh
260
- npx @tenderprompt/accounts source operation status --operation sop_... --json
261
- npx @tenderprompt/accounts source operation retry --operation sop_... --json
262
- ```
263
-
264
- Source administration can create validation, builds, releases, and exact
265
- previews. It does not directly publish a shopper-facing composition. Protected
266
- gateways remain preview-only, and multi-repository portal/gateway work is
267
- reviewed as one exact composition after each repository produces its immutable
268
- release.
269
-
270
- Protected gateways are always preview-only and require a merchant
271
- administrator to publish a reviewed exact composition. A service repository
272
- may be connected with `--publication default-branch`; that policy promotes the
273
- same successful default-branch preview without rebuilding it.
274
-
275
- ## Develop and preview
276
-
277
- Use the same loop locally or from a coding agent:
278
-
279
- ```sh
280
- npx @tenderprompt/accounts dev
281
- npx @tenderprompt/accounts check --json
282
- npx @tenderprompt/accounts preview --dry-run --json
283
- npx @tenderprompt/accounts preview --json
284
- ```
285
-
286
- `preview --dry-run` runs the repository checks, packages the app, and verifies the complete artifact without uploading it. A normal preview creates an immutable release and returns an exact preview URL. It does not change production.
287
-
288
- In a monorepo, target one independently deployable application with `--cwd`:
289
-
290
- ```sh
291
- npx @tenderprompt/accounts doctor --cwd apps/portal --json
292
- npx @tenderprompt/accounts preview --cwd apps/portal --json
293
- ```
294
-
295
- One activated profile can serve independently linked descendant apps invoked with `--cwd`, and multiple merchant profiles can coexist safely. Each app has its own explicit `.tender/link.json` containing only its project guard; the machine-local directory binding selects the profile. CI may place one fallback `TENDER_ACCOUNTS_TOKEN` in an ignored Git-root `.dev.vars`, and credential discovery never searches beyond that repository boundary.
296
-
297
- ## Inspect or retry a delivery
298
-
299
- When a preview is still running, inspect it by its `dly_` developer-delivery ID:
300
-
301
- ```sh
302
- npx @tenderprompt/accounts delivery status --delivery dly_... --json
303
- ```
304
-
305
- Retry a requested or failed delivery idempotently:
306
-
307
- ```sh
308
- npx @tenderprompt/accounts delivery retry --delivery dly_... --json
309
- ```
310
-
311
- Mint a fresh 15-minute preview session for a completed delivery:
312
-
313
- ```sh
314
- npx @tenderprompt/accounts delivery preview --delivery dly_... --return-path /account --json
315
- ```
316
-
317
- Do not pass a `dwf_` production workflow ID to these commands. Production workflows are shown separately in Tender Activity; a merchant administrator can resume a waiting exact publish there without rebuilding or substituting a release.
318
-
319
- ## Stream runtime logs
320
-
321
- Stream the exact preview produced by one completed developer delivery:
322
-
323
- ```sh
324
- npx @tenderprompt/accounts tail --delivery dly_... --json
325
- ```
326
-
327
- Merchant administrators can stream the current production runtime for the linked project:
328
-
329
- ```sh
330
- npx @tenderprompt/accounts tail --production --status error --json
331
- ```
332
-
333
- Optional filters include `--status ok,error,canceled`, `--method GET,POST`, `--search TEXT`, and `--sampling-rate 0.25`. A tail session lasts at most 15 minutes and closes on Ctrl+C. JSON mode writes one sanitized event per stdout line; lifecycle messages go to stderr.
334
-
335
- Sanitized fetch events include `correlation.rayId`. When the runtime supplies native trace context, JSON output also includes `correlation.traceId` and `correlation.spanId`; human output renders the available values as `ray=`, `trace=`, and `span=`. The current Tail Worker contract guarantees the request Ray ID but does not guarantee trace/span IDs for every event.
336
-
337
- Tender resolves the sealed preview composition or current production composition server-side. The CLI never receives infrastructure account IDs, Worker names, provider credentials, or a provider WebSocket URL. Request headers are omitted, secret-shaped object fields and sensitive query parameters are redacted, events are not persisted by the relay, and session capabilities are stored only as digests. Merchant application logs can still contain sensitive values when application code logs them as unlabelled strings, so do not log credentials or customer data.
338
-
339
- ## Install the coding-agent skill
340
-
341
- The package includes a skill that teaches a fresh Codex or Claude agent how to use the repository contract and preview workflow:
342
-
343
- ```sh
344
- npx @tenderprompt/accounts skill install --agent codex --json
345
- npx @tenderprompt/accounts skill install --agent claude --json
346
- ```
347
-
348
- Installation is global for the current user by default: `~/.agents/skills` for Codex and `~/.claude/skills` for Claude. This lets one reviewed skill serve every merchant checkout without committing a machine-specific copy to a repository.
349
-
350
- Use `--force` only when you intentionally want to replace an installed copy.
351
- Use `--directory PATH` only when you explicitly need a custom or repository-local destination.
352
-
353
- ## Production delivery
354
-
355
- The developer CLI intentionally has no production publish command. Developer credentials can prepare and preview changes, while production publication remains controlled by the merchant's connected default-branch workflow or an authorized administrator in Tender Accounts.
356
-
357
- Run `npx @tenderprompt/accounts <command> --help` for the layered command reference and `--json` for machine-readable output.
7
+ Existing project links, login profiles, artifact schemas and `.tender` paths
8
+ remain supported. No credentials are moved between API origins automatically.
package/cli.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { runCli } from "@withandeo/cli/cli";
3
+
4
+ // Preserve the old command's default during the parallel-domain rollout.
5
+ // Explicit flags, linked project URLs and stored profiles retain their precedence.
6
+ process.exitCode = await runCli(process.argv.slice(2), {
7
+ defaultApiUrl: "https://agents.tenderprompt.dev",
8
+ });
package/package.json CHANGED
@@ -1,34 +1,12 @@
1
1
  {
2
2
  "name": "@tenderprompt/accounts",
3
- "version": "0.8.4",
4
- "description": "Project-scoped developer CLI for Tender Accounts applications",
3
+ "version": "0.9.0",
4
+ "description": "Compatibility command for the Andeo CLI (formerly Tender Accounts)",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
7
- "bin": {
8
- "tender-accounts": "dist/cli.js"
9
- },
10
- "files": [
11
- "dist",
12
- "skill",
13
- "templates",
14
- "!templates/**/node_modules/**",
15
- "README.md"
16
- ],
17
- "engines": {
18
- "node": ">=22.0.0"
19
- },
20
- "scripts": {
21
- "build": "tsc -p tsconfig.build.json && node ./scripts/ensure-cli-executable.mjs",
22
- "check": "npm run typecheck && npm run test && npm run build",
23
- "sync:starter": "node ./scripts/sync-starter-template.mjs",
24
- "test": "vitest run",
25
- "test:coverage": "vitest run --coverage",
26
- "typecheck": "tsc --noEmit -p tsconfig.json",
27
- "prepack": "npm run sync:starter && npm run check"
28
- },
29
- "devDependencies": {
30
- "@types/node": "^26.2.0",
31
- "typescript": "^7.0.2",
32
- "vitest": "^4.1.11"
33
- }
7
+ "bin": { "tender-accounts": "cli.js" },
8
+ "files": ["cli.js", "README.md"],
9
+ "engines": { "node": ">=22.0.0" },
10
+ "dependencies": { "@withandeo/cli": "0.9.0" },
11
+ "publishConfig": { "access": "public" }
34
12
  }
package/dist/api.d.ts DELETED
@@ -1,109 +0,0 @@
1
- import type { AgentPrincipal, ArtifactSubmissionResponse, DeveloperDeliveryResponse, ManagedSourceRepositoryResponse, ManagedSourceChangeRequestResponse, ManagedSourceOperationResponse, ManagedSourcePushResponse, ManagedSourceTokenResponse, RuntimeLogSessionResponse } from "./contracts.js";
2
- export declare class AgentApiClient {
3
- private readonly baseUrl;
4
- private readonly token;
5
- private readonly fetcher;
6
- constructor(baseUrl: string, token: string, fetcher?: typeof fetch);
7
- whoami(): Promise<AgentPrincipal>;
8
- sourceRepository(projectId: string): Promise<{
9
- repository: ManagedSourceRepositoryResponse | null;
10
- }>;
11
- connectSourceRepository(projectId: string, input: {
12
- repoName: string;
13
- defaultBranch: string;
14
- installCommand: string;
15
- validateCommand: string;
16
- buildCommand: string;
17
- workingDirectory: string;
18
- artifactLatestPath: string;
19
- autoPublishDefaultBranch: boolean;
20
- }): Promise<{
21
- repository: ManagedSourceRepositoryResponse;
22
- }>;
23
- sourceToken(repositoryId: string, ttlSeconds: number, scope?: "read" | "write"): Promise<ManagedSourceTokenResponse>;
24
- createSourcePush(repositoryId: string, input: {
25
- idempotencyKey: string;
26
- branch: string;
27
- expectedCurrentSha: string | null;
28
- sourceRevision: string;
29
- bundleSha256: string;
30
- bundleBytes: number;
31
- }): Promise<{
32
- created: boolean;
33
- push: ManagedSourcePushResponse;
34
- }>;
35
- uploadSourceBundle(submissionId: string, bytes: Uint8Array): Promise<{
36
- push: ManagedSourcePushResponse;
37
- }>;
38
- sourcePush(submissionId: string): Promise<{
39
- push: ManagedSourcePushResponse;
40
- }>;
41
- createSourceChangeRequest(repositoryId: string, input: {
42
- title: string;
43
- description: string;
44
- baseBranch: string;
45
- headBranch: string;
46
- baseSha: string;
47
- headSha: string;
48
- }): Promise<{
49
- created: boolean;
50
- changeRequest: ManagedSourceChangeRequestResponse;
51
- }>;
52
- sourceChangeRequests(repositoryId: string, state?: "open" | "closed" | "all"): Promise<{
53
- changeRequests: ManagedSourceChangeRequestResponse[];
54
- }>;
55
- sourceChangeRequest(changeRequestId: string): Promise<{
56
- changeRequest: ManagedSourceChangeRequestResponse;
57
- }>;
58
- closeSourceChangeRequest(changeRequestId: string): Promise<{
59
- changeRequest: ManagedSourceChangeRequestResponse;
60
- }>;
61
- createSourceOperation(repositoryId: string, input: {
62
- kind: "set_default" | "promote" | "history_replace";
63
- idempotencyKey: string;
64
- targetBranch: string;
65
- headBranch?: string;
66
- expectedCurrentSha?: string;
67
- expectedDefaultBranch?: string;
68
- dryRun: boolean;
69
- }): Promise<{
70
- created: boolean;
71
- operation: ManagedSourceOperationResponse;
72
- }>;
73
- sourceOperation(operationId: string): Promise<{
74
- operation: ManagedSourceOperationResponse;
75
- }>;
76
- retrySourceOperation(operationId: string): Promise<{
77
- operation: ManagedSourceOperationResponse;
78
- }>;
79
- createSubmission(projectId: string, input: {
80
- idempotencyKey: string;
81
- envelope: unknown;
82
- }): Promise<ArtifactSubmissionResponse>;
83
- uploadFile(submissionId: string, fileIndex: number, bytes: Uint8Array): Promise<unknown>;
84
- finalizeSubmission(submissionId: string): Promise<ArtifactSubmissionResponse>;
85
- createDelivery(projectId: string, input: {
86
- submissionId: string;
87
- idempotencyKey: string;
88
- }): Promise<DeveloperDeliveryResponse>;
89
- delivery(deliveryId: string): Promise<DeveloperDeliveryResponse>;
90
- retryDelivery(deliveryId: string): Promise<unknown>;
91
- previewSession(deliveryId: string, returnPath: string): Promise<{
92
- url: string;
93
- grantId: string;
94
- expiresAt: number;
95
- }>;
96
- createRuntimeLogSession(projectId: string, input: {
97
- environment: "preview" | "production";
98
- deliveryId?: string;
99
- filters: {
100
- statuses: string[];
101
- methods: string[];
102
- search: string | null;
103
- samplingRate: number;
104
- };
105
- }): Promise<RuntimeLogSessionResponse>;
106
- closeRuntimeLogSession(sessionId: string): Promise<unknown>;
107
- private json;
108
- }
109
- //# sourceMappingURL=api.d.ts.map
package/dist/api.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,EAC/B,kCAAkC,EAClC,8BAA8B,E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AC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAKnH;IAED,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE;QAChD,WAAW,EAAE,SAAS,GAAG,YAAY,CAAC;QACtC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE;YAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;YAAC,OAAO,EAAE,MAAM,EAAE,CAAC;YAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,YAAY,EAAE,MAAM,CAAA;SAAE,CAAC;KACjG,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAKrC;IAED,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE1D;YAEa,IAAI;CAsBnB"}
package/dist/api.js DELETED
@@ -1,141 +0,0 @@
1
- import { CliApiError } from "./errors.js";
2
- export class AgentApiClient {
3
- baseUrl;
4
- token;
5
- fetcher;
6
- constructor(baseUrl, token, fetcher = fetch) {
7
- this.baseUrl = baseUrl;
8
- this.token = token;
9
- this.fetcher = fetcher;
10
- }
11
- whoami() {
12
- return this.json("/v1/whoami");
13
- }
14
- sourceRepository(projectId) {
15
- return this.json(`/v1/projects/${encodeURIComponent(projectId)}/source-repository`);
16
- }
17
- connectSourceRepository(projectId, input) {
18
- return this.json(`/v1/projects/${encodeURIComponent(projectId)}/source-repository`, {
19
- method: "POST",
20
- body: JSON.stringify(input),
21
- });
22
- }
23
- sourceToken(repositoryId, ttlSeconds, scope = "write") {
24
- return this.json(`/v1/source-repositories/${encodeURIComponent(repositoryId)}/tokens`, {
25
- method: "POST",
26
- body: JSON.stringify({ ttlSeconds, scope }),
27
- });
28
- }
29
- createSourcePush(repositoryId, input) {
30
- return this.json(`/v1/source-repositories/${encodeURIComponent(repositoryId)}/pushes`, {
31
- method: "POST",
32
- body: JSON.stringify(input),
33
- });
34
- }
35
- uploadSourceBundle(submissionId, bytes) {
36
- const body = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
37
- return this.json(`/v1/source-pushes/${encodeURIComponent(submissionId)}/bundle`, {
38
- method: "PUT",
39
- headers: { "content-type": "application/x-git-bundle" },
40
- body,
41
- });
42
- }
43
- sourcePush(submissionId) {
44
- return this.json(`/v1/source-pushes/${encodeURIComponent(submissionId)}`);
45
- }
46
- createSourceChangeRequest(repositoryId, input) {
47
- return this.json(`/v1/source-repositories/${encodeURIComponent(repositoryId)}/change-requests`, {
48
- method: "POST",
49
- body: JSON.stringify(input),
50
- });
51
- }
52
- sourceChangeRequests(repositoryId, state = "open") {
53
- return this.json(`/v1/source-repositories/${encodeURIComponent(repositoryId)}/change-requests?state=${state}`);
54
- }
55
- sourceChangeRequest(changeRequestId) {
56
- return this.json(`/v1/source-change-requests/${encodeURIComponent(changeRequestId)}`);
57
- }
58
- closeSourceChangeRequest(changeRequestId) {
59
- return this.json(`/v1/source-change-requests/${encodeURIComponent(changeRequestId)}/close`, { method: "POST" });
60
- }
61
- createSourceOperation(repositoryId, input) {
62
- return this.json(`/v1/source-repositories/${encodeURIComponent(repositoryId)}/operations`, {
63
- method: "POST",
64
- body: JSON.stringify(input),
65
- });
66
- }
67
- sourceOperation(operationId) {
68
- return this.json(`/v1/source-operations/${encodeURIComponent(operationId)}`);
69
- }
70
- retrySourceOperation(operationId) {
71
- return this.json(`/v1/source-operations/${encodeURIComponent(operationId)}/retry`, { method: "POST" });
72
- }
73
- createSubmission(projectId, input) {
74
- return this.json(`/v1/projects/${encodeURIComponent(projectId)}/artifact-submissions`, {
75
- method: "POST",
76
- body: JSON.stringify(input),
77
- });
78
- }
79
- uploadFile(submissionId, fileIndex, bytes) {
80
- const body = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
81
- return this.json(`/v1/artifact-submissions/${encodeURIComponent(submissionId)}/files/${fileIndex}`, {
82
- method: "PUT",
83
- headers: { "content-type": "application/octet-stream" },
84
- body,
85
- });
86
- }
87
- finalizeSubmission(submissionId) {
88
- return this.json(`/v1/artifact-submissions/${encodeURIComponent(submissionId)}/finalize`, { method: "POST" });
89
- }
90
- createDelivery(projectId, input) {
91
- return this.json(`/v1/projects/${encodeURIComponent(projectId)}/deliveries`, {
92
- method: "POST",
93
- body: JSON.stringify(input),
94
- });
95
- }
96
- delivery(deliveryId) {
97
- return this.json(`/v1/deliveries/${encodeURIComponent(deliveryId)}`);
98
- }
99
- retryDelivery(deliveryId) {
100
- return this.json(`/v1/deliveries/${encodeURIComponent(deliveryId)}/retry`, { method: "POST" });
101
- }
102
- previewSession(deliveryId, returnPath) {
103
- return this.json(`/v1/deliveries/${encodeURIComponent(deliveryId)}/preview-session`, {
104
- method: "POST",
105
- body: JSON.stringify({ returnPath }),
106
- });
107
- }
108
- createRuntimeLogSession(projectId, input) {
109
- return this.json(`/v1/projects/${encodeURIComponent(projectId)}/runtime-log-sessions`, {
110
- method: "POST",
111
- body: JSON.stringify(input),
112
- });
113
- }
114
- closeRuntimeLogSession(sessionId) {
115
- return this.json(`/v1/runtime-log-sessions/${encodeURIComponent(sessionId)}`, { method: "DELETE" });
116
- }
117
- async json(path, init = {}) {
118
- const headers = new Headers(init.headers);
119
- headers.set("accept", "application/json");
120
- headers.set("authorization", `Bearer ${this.token}`);
121
- if (typeof init.body === "string")
122
- headers.set("content-type", "application/json");
123
- const response = await this.fetcher(new URL(path, this.baseUrl), { ...init, headers, redirect: "error" });
124
- let value;
125
- try {
126
- value = await response.json();
127
- }
128
- catch {
129
- throw new CliApiError("invalid_api_response", `Tender Accounts returned HTTP ${response.status} without JSON.`);
130
- }
131
- if (!response.ok) {
132
- const error = isRecord(value) && isRecord(value.error) ? value.error : null;
133
- throw new CliApiError(typeof error?.code === "string" ? error.code : "api_request_failed", typeof error?.message === "string" ? error.message : `Tender Accounts returned HTTP ${response.status}.`, typeof error?.requestId === "string" ? error.requestId : response.headers.get("x-request-id") ?? undefined);
134
- }
135
- return value;
136
- }
137
- }
138
- function isRecord(value) {
139
- return typeof value === "object" && value !== null && !Array.isArray(value);
140
- }
141
- //# sourceMappingURL=api.js.map