@tenderprompt/accounts 0.8.2 → 0.8.4
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 +74 -51
- package/dist/api.d.ts +38 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +32 -0
- package/dist/api.js.map +1 -1
- package/dist/contracts.d.ts +52 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +184 -8
- package/dist/main.js.map +1 -1
- package/dist/starter.js +3 -3
- package/dist/starter.js.map +1 -1
- package/package.json +1 -1
- package/skill/tender-accounts/SKILL.md +73 -44
- package/templates/shopify-customer-account/AGENTS.md +2 -2
- package/templates/shopify-customer-account/CLAUDE.md +1 -0
- package/templates/shopify-customer-account/README.md +7 -7
- package/templates/shopify-customer-account/apps/gateway/CLAUDE.md +1 -0
- package/templates/shopify-customer-account/apps/portal/CLAUDE.md +1 -0
|
@@ -12,8 +12,8 @@ Use the `tender-accounts` CLI as the only platform interface. This skill is inst
|
|
|
12
12
|
When the user asked for a new Shopify customer-account repository and the target is empty, inspect the exact plan and then create the optional starter:
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
|
-
npx
|
|
16
|
-
npx
|
|
15
|
+
npx @tenderprompt/accounts init --name "Merchant customer account" --directory ./merchant-account --dry-run --json
|
|
16
|
+
npx @tenderprompt/accounts init --name "Merchant customer account" --directory ./merchant-account --json
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Never run `init` inside an existing application or use it to replace a merchant's architecture. It creates a stable gateway and independently editable `apps/portal`. UI-only tasks stay in the portal; authentication, sessions, application data, confidential bindings, and protected APIs stay in the gateway. The command deliberately does not install dependencies, initialize Git, link projects, or deploy.
|
|
@@ -25,12 +25,12 @@ ask them to open a repository before asking Tender which managed source belongs
|
|
|
25
25
|
to that project. Install this skill, authenticate to the exact project, then run:
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
npx
|
|
28
|
+
npx @tenderprompt/accounts auth create prj_... --device --project prj_... --json
|
|
29
29
|
# After approval:
|
|
30
|
-
npx
|
|
31
|
-
npx
|
|
32
|
-
npx
|
|
33
|
-
npx
|
|
30
|
+
npx @tenderprompt/accounts auth status --profile prj_... --json
|
|
31
|
+
npx @tenderprompt/accounts auth activate prj_... --json
|
|
32
|
+
npx @tenderprompt/accounts source status --project prj_... --json
|
|
33
|
+
npx @tenderprompt/accounts source pull --project prj_... --json
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
`source pull` uses standard Git. In an empty directory it clones the exact
|
|
@@ -54,7 +54,7 @@ a managed-source credential.
|
|
|
54
54
|
2. Run:
|
|
55
55
|
|
|
56
56
|
```sh
|
|
57
|
-
npx
|
|
57
|
+
npx @tenderprompt/accounts doctor --json
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
3. Stop if configuration, authentication, linking, or project access fails. Report the exact error code and remediation. Never bypass the CLI with direct API calls.
|
|
@@ -63,7 +63,7 @@ a managed-source credential.
|
|
|
63
63
|
If authentication is missing, start the agent-safe device flow:
|
|
64
64
|
|
|
65
65
|
```sh
|
|
66
|
-
npx
|
|
66
|
+
npx @tenderprompt/accounts auth create <merchant-or-work-context> --device --no-open --json
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
Derive a stable lowercase profile from the merchant or work context; when the exact project ID is known, it is also a safe profile name and should be supplied as the `--project prj_...` authorization hint. Return the exact `verificationUrlComplete` and `userCode` to the user. Do not start another login while this request is pending. After the user approves the organization and exact apps in Tender, resume the same request with:
|
|
@@ -75,7 +75,7 @@ Derive a stable lowercase profile from the merchant or work context; when the ex
|
|
|
75
75
|
Then activate that profile from the repository root so it applies to every descendant app:
|
|
76
76
|
|
|
77
77
|
```sh
|
|
78
|
-
npx
|
|
78
|
+
npx @tenderprompt/accounts auth activate <merchant-or-work-context> --json
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
Multiple merchant profiles and their machine-local directory activations coexist outside the repository. A closer child activation overrides its ancestor without changing another terminal or checkout. Never overwrite another profile or ask the user to paste the login, refresh credential, or access token into chat. `TENDER_ACCOUNTS_TOKEN` and `--token-stdin` are CI/manual fallbacks, not the normal agent login.
|
|
@@ -85,14 +85,14 @@ Never add `authProfile` to `.tender/link.json` or let repository content select
|
|
|
85
85
|
If profile selection is ambiguous, inspect only the non-secret local inventory and retry explicitly:
|
|
86
86
|
|
|
87
87
|
```sh
|
|
88
|
-
npx
|
|
89
|
-
npx
|
|
88
|
+
npx @tenderprompt/accounts auth list --json
|
|
89
|
+
npx @tenderprompt/accounts auth status --profile <name> --json
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
If the app has not been linked, run:
|
|
93
93
|
|
|
94
94
|
```sh
|
|
95
|
-
npx
|
|
95
|
+
npx @tenderprompt/accounts link --json
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
When one profile grants multiple projects, select the intended project once with `--project`; `link` records only the API origin and exact project guard. Profile activation remains machine-local.
|
|
@@ -101,10 +101,10 @@ If the merchant wants Tender to own the Git transport, use the CLI for either
|
|
|
101
101
|
the linked gateway or service project:
|
|
102
102
|
|
|
103
103
|
```sh
|
|
104
|
-
npx
|
|
105
|
-
npx
|
|
106
|
-
npx
|
|
107
|
-
npx
|
|
104
|
+
npx @tenderprompt/accounts source connect --publication preview-only --json
|
|
105
|
+
npx @tenderprompt/accounts source status --json
|
|
106
|
+
npx @tenderprompt/accounts source pull --json
|
|
107
|
+
npx @tenderprompt/accounts source push --json
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
Run these commands from the independently deployable app directory, or use its
|
|
@@ -114,23 +114,43 @@ hand in the admin. Protected gateways must stay `preview-only`. Use
|
|
|
114
114
|
`--publication default-branch` only for an ordinary service when the merchant
|
|
115
115
|
explicitly wants successful default-branch previews promoted automatically.
|
|
116
116
|
|
|
117
|
-
`source push` includes only the committed revision.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
`source push` includes only the committed revision. On a reviewed repository it
|
|
118
|
+
uploads a bounded Git bundle through Tender; the trusted runner verifies the
|
|
119
|
+
exact commit and may update only the named non-default branch. The developer
|
|
120
|
+
never receives a provider write credential. On a repository that has not yet
|
|
121
|
+
enabled reviewed changes, the legacy short-lived Git credential path remains
|
|
122
|
+
available during migration. Never copy any credential into a remote URL,
|
|
123
|
+
credential helper, repository file, shell script, or chat. `source pull` is the
|
|
124
|
+
inverse operation for an already connected repository and never creates or
|
|
125
|
+
replaces the source connection. `source token` is read-only.
|
|
126
|
+
|
|
127
|
+
When `source status` reports `changeRequestProtection: enabled`, use the normal
|
|
128
|
+
reviewed flow:
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
npx @tenderprompt/accounts source push --branch feature/account-copy --json
|
|
132
|
+
npx @tenderprompt/accounts source change create \
|
|
133
|
+
--head feature/account-copy \
|
|
134
|
+
--title "Update account copy" --json
|
|
135
|
+
npx @tenderprompt/accounts source change show --change scr_... --json
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Return the `scr_` ID and exact preview state to the user. A developer or coding
|
|
139
|
+
agent stops after the exact preview is ready. Approval and **Land in main** are
|
|
140
|
+
merchant-administrator actions in Tender. Do not push the default branch,
|
|
141
|
+
obtain a raw provider token, call internal APIs, or replace this flow with
|
|
142
|
+
`source promote` after reviewed changes are enabled.
|
|
124
143
|
|
|
125
144
|
Inspect branches and history through read-only ephemeral credentials:
|
|
126
145
|
|
|
127
146
|
```sh
|
|
128
|
-
npx
|
|
129
|
-
npx
|
|
130
|
-
npx
|
|
147
|
+
npx @tenderprompt/accounts source branches --json
|
|
148
|
+
npx @tenderprompt/accounts source log --branch main --limit 20 --json
|
|
149
|
+
npx @tenderprompt/accounts source compare --base main --head feature/account-copy --json
|
|
131
150
|
```
|
|
132
151
|
|
|
133
|
-
Use source-administration commands only
|
|
152
|
+
Use standalone source-administration commands only for repositories where
|
|
153
|
+
reviewed changes are not enabled and when the user explicitly requests a
|
|
134
154
|
default-branch or history change and the active profile belongs to a merchant
|
|
135
155
|
source administrator. First record `source branches`, `source compare`, the
|
|
136
156
|
successful exact preview for the proposed head, and the current production
|
|
@@ -140,7 +160,7 @@ For an ordinary checked fast-forward, supply the current target SHA and a
|
|
|
140
160
|
stable idempotency key:
|
|
141
161
|
|
|
142
162
|
```sh
|
|
143
|
-
npx
|
|
163
|
+
npx @tenderprompt/accounts source promote \
|
|
144
164
|
--head feature/account-copy \
|
|
145
165
|
--expected-current <exact-current-default-sha> \
|
|
146
166
|
--idempotency-key account-copy-v1 \
|
|
@@ -150,7 +170,7 @@ npx tender-accounts source promote \
|
|
|
150
170
|
For an exceptional migration, use only the guarded history workflow:
|
|
151
171
|
|
|
152
172
|
```sh
|
|
153
|
-
npx
|
|
173
|
+
npx @tenderprompt/accounts source history replace \
|
|
154
174
|
--head app-only-main \
|
|
155
175
|
--expected-current <exact-current-default-sha> \
|
|
156
176
|
--confirm <exact-src-repository-id> \
|
|
@@ -171,14 +191,23 @@ If a durable source operation fails for a transient provider or runner reason,
|
|
|
171
191
|
inspect and resume that same reviewed intent by ID:
|
|
172
192
|
|
|
173
193
|
```sh
|
|
174
|
-
npx
|
|
175
|
-
npx
|
|
194
|
+
npx @tenderprompt/accounts source operation status --operation sop_... --json
|
|
195
|
+
npx @tenderprompt/accounts source operation retry --operation sop_... --json
|
|
176
196
|
```
|
|
177
197
|
|
|
178
198
|
Do not create a replacement request merely to retry infrastructure. A stale
|
|
179
199
|
target, missing preview, archive conflict, or rejected permission requires the
|
|
180
200
|
stated remediation and a newly reviewed request instead.
|
|
181
201
|
|
|
202
|
+
For reviewed repositories, a moved head invalidates the previous approval and
|
|
203
|
+
the newest source build becomes the next exact snapshot. A moved base makes the
|
|
204
|
+
change stale. Rebase or update the feature branch, push a new committed
|
|
205
|
+
revision, wait for its exact preview, and have the administrator review that
|
|
206
|
+
new snapshot. Source landing never calls the production publisher directly;
|
|
207
|
+
after landing, the repository's already configured default-branch policy may
|
|
208
|
+
publish the same successful exact preview. Protected gateways remain
|
|
209
|
+
preview-only.
|
|
210
|
+
|
|
182
211
|
Treat source administration and production publication as different acts. A
|
|
183
212
|
source operation may create a new immutable preview lineage, but only the
|
|
184
213
|
merchant's established exact-composition control can publish production. For a
|
|
@@ -219,26 +248,26 @@ Render the useful shell immediately. Fetch independent account sections concurre
|
|
|
219
248
|
## Implement and validate
|
|
220
249
|
|
|
221
250
|
1. Inspect the existing application and tests before changing code.
|
|
222
|
-
2. Use the repository's own development workflow. `npx
|
|
251
|
+
2. Use the repository's own development workflow. `npx @tenderprompt/accounts dev` delegates to the committed `commands.dev`, starts local development, and never creates a Tender deployment.
|
|
223
252
|
3. Make the smallest source change that satisfies the request.
|
|
224
253
|
4. Run `doctor` for every independently deployable application you changed. In a generated repository:
|
|
225
254
|
|
|
226
255
|
```sh
|
|
227
|
-
npx
|
|
228
|
-
npx
|
|
256
|
+
npx @tenderprompt/accounts doctor --cwd apps/portal --json
|
|
257
|
+
npx @tenderprompt/accounts doctor --cwd apps/gateway --json
|
|
229
258
|
```
|
|
230
259
|
|
|
231
260
|
Do not require gateway access for a portal-only task. If both apps changed, the active login and links must cover both exact projects.
|
|
232
261
|
5. Run the deterministic repository checks:
|
|
233
262
|
|
|
234
263
|
```sh
|
|
235
|
-
npx
|
|
264
|
+
npx @tenderprompt/accounts check --json
|
|
236
265
|
```
|
|
237
266
|
|
|
238
267
|
6. Validate the complete portable artifact without uploading it:
|
|
239
268
|
|
|
240
269
|
```sh
|
|
241
|
-
npx
|
|
270
|
+
npx @tenderprompt/accounts preview --dry-run --json
|
|
242
271
|
```
|
|
243
272
|
|
|
244
273
|
Do not weaken checks, remove declared bindings, or place runtime values in the artifact to make validation pass.
|
|
@@ -248,14 +277,14 @@ Do not weaken checks, remove declared bindings, or place runtime values in the a
|
|
|
248
277
|
After local validation succeeds, preview each changed application. For a portal-only change, run:
|
|
249
278
|
|
|
250
279
|
```sh
|
|
251
|
-
npx
|
|
280
|
+
npx @tenderprompt/accounts preview --cwd apps/portal --json
|
|
252
281
|
```
|
|
253
282
|
|
|
254
283
|
For a new account stack or a change spanning both apps, package and preview the portal and gateway as separate projects:
|
|
255
284
|
|
|
256
285
|
```sh
|
|
257
|
-
npx
|
|
258
|
-
npx
|
|
286
|
+
npx @tenderprompt/accounts preview --cwd apps/portal --json
|
|
287
|
+
npx @tenderprompt/accounts preview --cwd apps/gateway --json
|
|
259
288
|
```
|
|
260
289
|
|
|
261
290
|
On the first stack preview, the first command may retain its exact release and return `bootstrap_counterpart_release_missing`. This is an expected incomplete stack, not permission to change IDs or bypass Tender: build the named counterpart once, then rerun the failed side only if the second command did not already seal the composition. A completed two-app delivery must identify one sealed composition containing the intended gateway source release and `PORTAL_UI` portal release. Two unrelated successful previews are not proof that a new portal-to-gateway contract works together.
|
|
@@ -290,19 +319,19 @@ If the portal shell works but an authenticated route returns `404`, classify it
|
|
|
290
319
|
Read exact workflow state:
|
|
291
320
|
|
|
292
321
|
```sh
|
|
293
|
-
npx
|
|
322
|
+
npx @tenderprompt/accounts delivery status --delivery <delivery-id> --json
|
|
294
323
|
```
|
|
295
324
|
|
|
296
325
|
Retry only a requested or failed preview workflow:
|
|
297
326
|
|
|
298
327
|
```sh
|
|
299
|
-
npx
|
|
328
|
+
npx @tenderprompt/accounts delivery retry --delivery <delivery-id> --json
|
|
300
329
|
```
|
|
301
330
|
|
|
302
331
|
Mint a new browser session for an already-succeeded delivery without rebuilding:
|
|
303
332
|
|
|
304
333
|
```sh
|
|
305
|
-
npx
|
|
334
|
+
npx @tenderprompt/accounts delivery preview --delivery <delivery-id> --json
|
|
306
335
|
```
|
|
307
336
|
|
|
308
337
|
`<delivery-id>` is the `dly_` value returned by `preview`. A `dwf_` value is a production workflow ID and must not be passed to developer-delivery commands. If a merchant administrator sees a `dwf_` publish waiting with zero attempts, the supported recovery is **Activity → Resume exact publish**; it resumes the stored exact composition without rebuilding. Use the error code, request ID, and suggested command from the CLI. Do not retry with altered IDs, another project, or raw HTTP requests.
|
|
@@ -310,7 +339,7 @@ npx tender-accounts delivery preview --delivery <delivery-id> --json
|
|
|
310
339
|
When runtime evidence is needed, stream only the linked project and exact target:
|
|
311
340
|
|
|
312
341
|
```sh
|
|
313
|
-
npx
|
|
342
|
+
npx @tenderprompt/accounts tail --delivery <delivery-id> --status error --json
|
|
314
343
|
```
|
|
315
344
|
|
|
316
345
|
Use `--production` only when the user is a merchant administrator and explicitly wants current production diagnostics. Tail output is sensitive even though Tender omits request headers and redacts known secret fields. Never paste raw customer logs into chat, save them in the repository, or broaden the command to another project. Stop the stream as soon as the diagnostic is complete.
|
|
@@ -8,8 +8,8 @@ This is a merchant-owned Tender Accounts application. The gateway and portal are
|
|
|
8
8
|
- Keep Shopify authentication, confidential bindings, sessions, and protected API routes in `apps/gateway`.
|
|
9
9
|
- Keep `apps/portal` free of Shopify customer tokens, session storage, D1 access, and provider secrets.
|
|
10
10
|
- Treat the `PORTAL_UI` binding as a privilege boundary inside one product: never forward browser cookies or authorization headers to the portal, and never relay portal cookie-control headers onto the customer hostname.
|
|
11
|
-
- Use `npx
|
|
11
|
+
- Use `npx @tenderprompt/accounts` for project linking, validation, and previews. Never call Tender internal APIs directly.
|
|
12
12
|
- Never run `wrangler deploy`; production and preview delivery are controlled by Tender Accounts.
|
|
13
13
|
- Never commit `.dev.vars`, `.tender/`, credentials, customer data, or provider responses.
|
|
14
14
|
- Shopify and selected commerce providers remain systems of record. Do not duplicate their durable business state without an explicit design.
|
|
15
|
-
- Run the closest app checks and `npx
|
|
15
|
+
- Run the closest app checks and `npx @tenderprompt/accounts preview --dry-run --json` before creating a preview.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
|
@@ -31,15 +31,15 @@ Local development intentionally stays signed out because Shopify requires regist
|
|
|
31
31
|
Each app is linked and delivered independently. Sign in once, approve the organization and exact app projects in Tender, then link the portal:
|
|
32
32
|
|
|
33
33
|
```sh
|
|
34
|
-
npx
|
|
35
|
-
npx
|
|
36
|
-
npx
|
|
37
|
-
npx
|
|
38
|
-
npx
|
|
39
|
-
npx
|
|
34
|
+
npx @tenderprompt/accounts auth create {{slug}}
|
|
35
|
+
npx @tenderprompt/accounts auth activate {{slug}}
|
|
36
|
+
npx @tenderprompt/accounts link --cwd apps/portal --json
|
|
37
|
+
npx @tenderprompt/accounts doctor --cwd apps/portal --json
|
|
38
|
+
npx @tenderprompt/accounts preview --cwd apps/portal --dry-run --json
|
|
39
|
+
npx @tenderprompt/accounts preview --cwd apps/portal --json
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Coding agents should use `npx
|
|
42
|
+
Coding agents should use `npx @tenderprompt/accounts auth create {{slug}} --device --no-open --json`, return the verification URL/code to the user, resume the same request with the returned `auth status --profile {{slug}} --json` command, and activate the profile for the repository. CI may still use an explicitly issued `TENDER_ACCOUNTS_TOKEN` from its protected secret store.
|
|
43
43
|
|
|
44
44
|
Use `apps/gateway` instead only when gateway code or bindings changed. The CLI intentionally cannot publish production.
|
|
45
45
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|