@itpay/cli 2.1.0 → 2.1.2

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.
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -11,6 +11,12 @@ export class BackendClient {
11
11
  throw new Error("Invalid Sell route");
12
12
  return this.http.request(request.path, { method: request.method, ...(request.body !== undefined ? { body: request.body } : {}) });
13
13
  }
14
+ agentAccountStatus() {
15
+ return this.http.get('/v1/agent-device-account-bindings');
16
+ }
17
+ bindAgentAccount(input) {
18
+ return this.http.post('/v1/agent-device-account-bindings', input);
19
+ }
14
20
  readyz() {
15
21
  return this.http.get("/v1/readyz");
16
22
  }
@@ -8,7 +8,7 @@ export async function runReadyz(backend, options = {}) {
8
8
  status: response.status,
9
9
  result: { backend: "available", backend_url: backendURL, environment, ...(options.agentType ? { agent_type: options.agentType } : {}) },
10
10
  instruction: environment === "development"
11
- ? "ItPay sandbox 可用。先完整读取内置 Skill,再根据用户意图选择新服务、已购内容、订单或退款入口;后续必须执行返回的完整命令并保持同一 sandbox Backend。"
11
+ ? `ItPay 开发环境 ${backendURL} 可用。先完整读取内置 Skill,再根据用户意图选择新服务、已购内容、订单或退款入口;后续必须执行返回的完整命令并保持同一 Backend。`
12
12
  : "ItPay 可用。先完整读取内置 Skill,再根据用户意图选择新服务、已购内容、订单或退款入口;不要默认开始购买。",
13
13
  next: { command: "itpay skill show itpay --json", reason: "加载完整操作与安全规则" },
14
14
  recovery: [],
@@ -656,6 +656,25 @@ function servicesNextEnvelope(model) {
656
656
  const id = execution.service_execution_id;
657
657
  const paymentVerified = model.payment_bindings.some((binding) => binding.status === "payment_verified") || model.checkout_bindings.some((binding) => binding.status === "payment_verified");
658
658
  const state = model.workflow?.status === "payment" && paymentVerified ? "running" : model.workflow?.status ?? "input_required";
659
+ if (state === "failed" && ["login_required", "rate_limited"].includes(model.workflow?.error_code ?? "")) {
660
+ const login = model.workflow?.error_code === "login_required";
661
+ return {
662
+ status: login ? "login_required" : "rate_limited",
663
+ result: { service_execution_id: id, service_id: execution.service_id },
664
+ instruction: login ? "匿名免费额度已用完。使用官方网页登录并绑定当前 Agent,完成后重新发起查询;不需要付款。" : "已达到登录账号每分钟查询上限。请等到下一分钟再发起查询,不要连续重试。",
665
+ next: login ? { command: "itpay auth login --json", reason: "登录继续免费查询" } : null,
666
+ recovery: [],
667
+ };
668
+ }
669
+ if (state === "human_action" && model.workflow?.human_action) {
670
+ return {
671
+ status: "confirmation_required",
672
+ result: { service_execution_id: id, service_id: execution.service_id, human_action: model.workflow.human_action },
673
+ instruction: "请展示待确认的位置,请用户明确确认后,按 input_schema 填写 --input 字段。继续同一执行,不重新查询;这一步不是购买确认。",
674
+ next: { command: `itpay services action ${id} --action ${model.workflow.human_action.action_type} --actor-type human --status approved --input <key=value> --json`, reason: "用户确认后继续当前查询" },
675
+ recovery: [],
676
+ };
677
+ }
659
678
  const recovery = state === "recovery_required" || state === "failed";
660
679
  let command = `itpay services next ${id} --json`;
661
680
  if (state === "payment")
@@ -701,7 +720,7 @@ function servicesNextEnvelope(model) {
701
720
  recovery: [],
702
721
  };
703
722
  }
704
- if (isTerminalServiceExecutionStatus(execution.status) && !(model.workflow_entry && currentDelivery && ["completed", "delivery_completed"].includes(execution.status))) {
723
+ if (isTerminalServiceExecutionStatus(execution.status) && !(model.workflow_entry && (currentDelivery || serviceDeliveryMode(model) === "agent_visible_result") && ["completed", "delivery_completed"].includes(execution.status))) {
705
724
  const paid = model.checkout_bindings.some((binding) => binding.status === "payment_verified") || Boolean(currentDelivery?.order_id);
706
725
  const paidFailure = execution.status === "failed" && paid;
707
726
  return {
@@ -905,6 +924,9 @@ function serviceAllowedActionCommand(model, action) {
905
924
  }
906
925
  function serviceDeliveryMode(model) {
907
926
  const delivery = model.current_delivery ?? model.delivery_bindings.at(-1);
927
+ const entry = model.capabilities.find(capability => capability.capability_id === model.workflow_entry?.capability_id);
928
+ if (!delivery && model.workflow?.status === "completed" && entry?.requires_payment === false && !entry.vault_required)
929
+ return "agent_visible_result";
908
930
  const explicit = String(delivery?.redacted_summary?.delivery_mode ?? "");
909
931
  if (explicit)
910
932
  return explicit;
package/dist/src/main.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { agentAuth } from "./state/account_auth.js";
1
2
  import { registerSell } from "./sell/commands.js";
2
3
  import { readFileSync as readWorkflowInputFile } from "node:fs";
3
4
  import { runServicesRun } from "./commands/services.js";
@@ -291,6 +292,19 @@ program
291
292
  });
292
293
  }
293
294
  });
295
+ const authCmd = program.command("auth").description("Log in and bind this enrolled Agent to your ItPay account");
296
+ for (const action of ["login", "status"]) {
297
+ authCmd.command(action).option("--json", "output JSON").action(async (options) => {
298
+ const config = loadConfig();
299
+ try {
300
+ const result = await agentAuth(action, config.baseURL, newBackendClient(config));
301
+ process.stdout.write(JSON.stringify(result) + "\n");
302
+ }
303
+ catch (error) {
304
+ reportCLIError(error, { jsonOutput: Boolean(options.json), code: "account_login_failed", instruction: "完成官方网页登录后重试 itpay auth status;不要清除设备登记。" });
305
+ }
306
+ });
307
+ }
294
308
  // --- device ---------------------------------------------------------------
295
309
  const deviceCmd = program.command("device").description("Recover the current official Backend registration after an operator-confirmed reset");
296
310
  deviceCmd
@@ -1,4 +1,4 @@
1
- import { sellerAuth } from "./auth.js";
1
+ import { sellerAuth } from "../state/account_auth.js";
2
2
  import { registerSync } from "./sync.js";
3
3
  import { preview } from "./preview.js";
4
4
  import { serveSellMCP } from "./mcp.js";
@@ -2,11 +2,11 @@ import { createHash } from 'node:crypto';
2
2
  import { homedir } from 'node:os';
3
3
  import { dirname, resolve } from 'node:path';
4
4
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync, rmSync } from 'node:fs';
5
- export function sellerAuthPath(baseURL, env = process.env) {
6
- return resolve(env.HOME || homedir(), '.itpay-v3', `seller-${createHash('sha256').update(baseURL).digest('hex').slice(0, 16)}.json`);
5
+ export function sellerAuthPath(baseURL, env = process.env, purpose = "seller") {
6
+ return resolve(env.HOME || homedir(), '.itpay-v3', `${purpose}-${createHash('sha256').update(baseURL).digest('hex').slice(0, 16)}.json`);
7
7
  }
8
- function read(baseURL, env = process.env) {
9
- const path = sellerAuthPath(baseURL, env);
8
+ function read(baseURL, env = process.env, purpose = "seller") {
9
+ const path = sellerAuthPath(baseURL, env, purpose);
10
10
  if (!existsSync(path))
11
11
  return;
12
12
  const state = JSON.parse(readFileSync(path, 'utf8'));
@@ -14,8 +14,8 @@ function read(baseURL, env = process.env) {
14
14
  throw new Error('Seller session backend mismatch');
15
15
  return state;
16
16
  }
17
- function save(state, env = process.env) {
18
- const path = sellerAuthPath(state.baseURL, env);
17
+ function save(state, env = process.env, purpose = "seller") {
18
+ const path = sellerAuthPath(state.baseURL, env, purpose);
19
19
  mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
20
20
  const tmp = `${path}.${process.pid}.tmp`;
21
21
  writeFileSync(tmp, JSON.stringify(state), { mode: 0o600 });
@@ -25,26 +25,45 @@ export function sellerSessionToken(baseURL, env = process.env) {
25
25
  const state = read(baseURL, env);
26
26
  return state?.expiresAt && Date.parse(state.expiresAt) > Date.now() ? state.sessionToken : undefined;
27
27
  }
28
- export async function sellerAuth(action, baseURL, env = process.env, fetcher = fetch) {
28
+ export function sellerAuth(action, baseURL, env = process.env, fetcher = fetch) {
29
+ return accountAuth(action, baseURL, env, fetcher);
30
+ }
31
+ export function agentAuth(action, baseURL, backend, env = process.env, fetcher = fetch) {
32
+ return accountAuth(action, baseURL, env, fetcher, backend);
33
+ }
34
+ async function accountAuth(action, baseURL, env, fetcher, backend) {
35
+ const purpose = backend ? 'agent-login' : 'seller';
36
+ const command = backend ? 'itpay auth status' : 'itpay sell auth status';
37
+ if (backend) {
38
+ const current = await backend.agentAccountStatus();
39
+ if (current.status === 'authenticated')
40
+ return current;
41
+ }
29
42
  async function request(path, init = {}) {
30
43
  const response = await fetcher(baseURL + path, { ...init, redirect: 'error', signal: AbortSignal.timeout(15000) });
31
44
  if (!response.ok)
32
- throw new Error(`Seller authorization failed (${response.status}); retry login if expired`);
45
+ throw new Error(`ItPay authorization failed (${response.status}); retry login if expired`);
33
46
  return response;
34
47
  }
35
48
  if (action === 'login') {
36
- const response = await request('/v1/dashboard/auth-sessions', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ provider: 'alipay', return_to: '/seller' }) });
49
+ const response = await request('/v1/dashboard/auth-sessions', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ provider: 'alipay', return_to: backend ? '/' : '/seller' }) });
37
50
  const result = await response.json();
38
51
  const url = new URL(result.start_url, baseURL);
39
- if (url.origin !== new URL(baseURL).origin)
52
+ const sameOrigin = url.origin === new URL(baseURL).origin;
53
+ const alipay = url.origin === 'https://openauth.alipay.com' && url.pathname === '/oauth2/publicAppAuthorize.htm' && !url.username && !url.password;
54
+ if (!sameOrigin && !alipay)
40
55
  throw new Error('Unexpected authorization origin');
41
- const startToken = url.searchParams.get('start_token');
56
+ const fragment = new URLSearchParams(url.hash.replace(/^#dashboard-auth\?/, ''));
57
+ const state = url.searchParams.get('state')?.split('.');
58
+ const startToken = alipay
59
+ ? (state?.length === 2 && state[0] === result.dashboard_auth_session_id ? state[1] : undefined)
60
+ : url.searchParams.get('start_token') || fragment.get('start_token');
42
61
  if (!startToken || !result.poll_token || !result.dashboard_auth_session_id)
43
62
  throw new Error('Incomplete authorization response');
44
- save({ baseURL, sessionID: result.dashboard_auth_session_id, pollToken: result.poll_token, startToken }, env);
45
- return { status: 'authorization_required', authorization_url: url.href, instruction: 'Complete ItPay login in the browser, then run itpay sell auth status.' };
63
+ save({ baseURL, sessionID: result.dashboard_auth_session_id, pollToken: result.poll_token, startToken }, env, purpose);
64
+ return { status: 'authorization_required', authorization_url: url.href, instruction: `Complete ItPay login in the browser, then run ${command}.` };
46
65
  }
47
- const state = read(baseURL, env);
66
+ const state = read(baseURL, env, purpose);
48
67
  if (action === 'logout') {
49
68
  const token = sellerSessionToken(baseURL, env);
50
69
  if (token)
@@ -52,7 +71,7 @@ export async function sellerAuth(action, baseURL, env = process.env, fetcher = f
52
71
  rmSync(sellerAuthPath(baseURL, env), { force: true });
53
72
  return { status: 'logged_out' };
54
73
  }
55
- if (sellerSessionToken(baseURL, env))
74
+ if (!backend && sellerSessionToken(baseURL, env))
56
75
  return { status: 'authenticated', base_url: baseURL, expires_at: state?.expiresAt };
57
76
  if (!state?.sessionID || !state.pollToken || !state.startToken)
58
77
  return { status: 'login_required' };
@@ -60,6 +79,13 @@ export async function sellerAuth(action, baseURL, env = process.env, fetcher = f
60
79
  const progress = await (await request(`${path}?poll_token=${encodeURIComponent(state.pollToken)}`)).json();
61
80
  if (progress.status !== 'completed')
62
81
  return { status: progress.status, instruction: 'Finish login and email verification in the browser.' };
82
+ if (backend) {
83
+ const result = await backend.bindAgentAccount({ dashboard_auth_session_id: state.sessionID, start_token: state.startToken });
84
+ if (result.status !== 'authenticated')
85
+ throw new Error('Agent binding did not complete');
86
+ rmSync(sellerAuthPath(baseURL, env, purpose), { force: true });
87
+ return result;
88
+ }
63
89
  const claimed = await request(`${path}/claim?start_token=${encodeURIComponent(state.startToken)}`, { method: 'POST' });
64
90
  const token = /(?:^|[, ]+)itpay_buyer_session=([^;]+)/.exec(claimed.headers.get('set-cookie') ?? '')?.[1];
65
91
  const session = await claimed.json();
@@ -1,4 +1,4 @@
1
- import { sellerSessionToken } from "../sell/auth.js";
1
+ import { sellerSessionToken } from "./account_auth.js";
2
2
  // CLI configuration loader. Production defaults to app.itpay.ai; supported public overrides
3
3
  // are the official sandbox and dev Backends. Checkout
4
4
  // display-token persistence belongs to the cart session file, protected with
@@ -15,8 +15,8 @@ import { OperationJournal } from "./operation_journal.js";
15
15
  export const DEFAULT_BASE_URL = "https://app.itpay.ai";
16
16
  export const DEV_BASE_URL = "https://dev.itpay.ai";
17
17
  export const SANDBOX_BASE_URL = "https://sandbox.itpay.ai";
18
- export const CLI_VERSION = "2.1.0";
19
- export const API_CONTRACT_REVISION = "sha256:bedacd161be3576aeed35c7a4f54ea4fedae65a88d1e024f0445f969a1fc1fc2";
18
+ export const CLI_VERSION = "2.1.2";
19
+ export const API_CONTRACT_REVISION = "sha256:8fc92bcea2b2c5205139382e73295fbabf3ff9b0ae001a7e8d748d3bb6857061";
20
20
  const CART_SESSION_DEFAULT_DIR = ".itpay-v3";
21
21
  const CART_SESSION_FILENAME = "cart.json";
22
22
  const OPERATION_JOURNAL_FILENAME = "operations.json";
@@ -2,7 +2,7 @@ import { createHash, createPrivateKey, createPublicKey, generateKeyPairSync, ran
2
2
  import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync, } from "node:fs";
3
3
  import { homedir } from "node:os";
4
4
  import { dirname, resolve } from "node:path";
5
- const PROTECTED_PATHS = ["/v1/carts", "/v1/service-executions", "/v1/agent-instances", "/v1/orders", "/v1/refunds", "/v1/me", "/v1/vault"];
5
+ const PROTECTED_PATHS = ["/v1/agent-device-account-bindings", "/v1/carts", "/v1/service-executions", "/v1/agent-instances", "/v1/orders", "/v1/refunds", "/v1/me", "/v1/vault"];
6
6
  export class DeviceAuthority {
7
7
  baseURL;
8
8
  backendKey;
@@ -0,0 +1,9 @@
1
+ # Account login
2
+
3
+ Use `itpay auth login --json` to enroll the current Agent and open the official ItPay Web login. After the user finishes login and email verification, run `itpay auth status --json` to bind this enrolled Agent to the account. Keep declaring the actual `--agent-type` on both commands.
4
+
5
+ For dev, keep `ITPAY_BACKEND_URL=https://dev.itpay.ai` on every command. Login state and device registration are isolated from production.
6
+
7
+ Railway exact and smart query services each allow two anonymous queries after enrollment. After login, queries remain free within the published per-minute limits. On `login_required`, finish login and start a new query. On `rate_limited`, wait until the next minute; do not clear device state or retry in a loop.
8
+
9
+ The Agent receives no general account bearer token. This binding reuses the existing stable device-account ownership mechanism; switching account owners is not supported. Seller authoring continues to use `itpay sell auth` separately.
@@ -23,7 +23,8 @@ All platform operations accept `--input-json <file>` for their declared fields a
23
23
 
24
24
  ## Invariants
25
25
 
26
- - Current public runtime is synchronous, acyclic, single entry, per-call pricing, one payment node, and delivery on success. Quota, prepaid consumption and async workflows are not publishable.
26
+ - The current runtime accepts bounded, acyclic, single-entry workflows with multiple API nodes. Free queries can use quota and explicit human confirmation; paid workflows use one payment node and either fixed per-call pricing or a trusted pre-payment dynamic quote. Prepaid balance billing remains unsupported.
27
+ - Protected railway fulfillment resumes through the platform booking Owner only after verified payment and Web passenger confirmation. A standalone API probe cannot supply a payment identity or passenger records. Follow the server Guide for actual acceptance and publication blockers; local graph validation is not live ticket-issuance evidence.
27
28
  - Local reports are diagnostics, not platform approval evidence. Platform verification is required; existing valid evidence may be reused. Admin approval never repeats Provider calls.
28
29
  - Every visual view reads the same YAML. Layout is presentation only.
29
30
  - Disclosure/confirmation binds the version being acted on. Do not turn `--confirm` into blanket permission for later changes.
@@ -35,7 +36,7 @@ The local `.itpay-sell` directory contains private fixtures, reports and the enc
35
36
 
36
37
  Local reports never substitute for the platform verification gate. Repeated upload of an unchanged saved version reuses its cloud version; a changed cloud revision or fixture revision requires explicit pull/review.
37
38
 
38
- For repository builds, run `scripts/v3/build-sell-runtime.sh`, build `apps/web/vite.sell-preview.config.ts`, and then build/package `apps/cli`. Packaging rejects missing native binaries or preview assets. `scripts/v3/sync-sell-contract.mjs --check` verifies that the CLI command contracts match the backend/MCP package.
39
+ For CLI repository builds, run `node scripts/fetch-sell-runtime.mjs` to obtain the exact checksummed native runtime in `seller-runtime.lock.json`, then `npm run test:package`. The committed `assets/sell-preview` directory supplies the local Builder. Packaging rejects missing native binaries or preview assets; do not substitute an arbitrary local binary for the locked release.
39
40
 
40
41
  Example local MCP configuration (use the existing authenticated CLI account):
41
42
 
@@ -1339,4 +1340,4 @@ Options:
1339
1340
 
1340
1341
  ## Seller login and dev
1341
1342
 
1342
- Use `ITPAY_BACKEND_URL=https://dev.itpay.ai itpay sell auth login --json` to receive the normal ItPay authorization link. After browser login and required email verification, run `ITPAY_BACKEND_URL=https://dev.itpay.ai itpay sell auth status --json`. The CLI claims its own account session through the standard API and stores it in an owner-only file; never copy tokens or browser cookies. `itpay sell auth logout --json` revokes this session. Keep the same backend prefix on subsequent commands; production, dev, and sandbox state are isolated. Agent device enrollment does not grant Seller organization access.
1343
+ Use `ITPAY_BACKEND_URL=https://dev.itpay.ai itpay sell auth login` to receive the normal ItPay authorization link. After browser login and required email verification, run `ITPAY_BACKEND_URL=https://dev.itpay.ai itpay sell auth status`. The CLI claims its own account session through the standard API and stores it in an owner-only file; never copy tokens or browser cookies. `itpay sell auth logout` revokes this session. Keep the same backend prefix on subsequent commands; production, dev, and sandbox state are isolated. Agent device enrollment does not grant Seller organization access.
@@ -2,7 +2,7 @@
2
2
 
3
3
  本目录是 ItPay CLI 的规范性命令合同。它定义命令应向人和 Agent 返回什么、如何指导下一步,以及失败后如何恢复。当前实现与本文档不一致时,以本文档作为后续校准目标。
4
4
 
5
- > **统一产品边界:** `itpay` 是唯一公开的 CLI 入口,`$itpay` 是对应的用户侧 Skill 调用方式。当前入口同时覆盖购买新服务、查询订单、查看经用户授权的已购内容和退款;Seller 流程未来仍使用同一入口,当前尚未实现。不得为这些意图拆分新的产品入口。
5
+ > **统一产品边界:** `itpay` 是唯一公开的 CLI 入口,`$itpay` 是对应的用户侧 Skill 调用方式。当前入口同时覆盖购买新服务、查询订单、查看经用户授权的已购内容和退款;Seller 流程使用同一入口的 `itpay sell` 命令。不得为这些意图拆分新的产品入口。
6
6
 
7
7
  企知道可以作为示例数据出现,但任何命令、字段、状态和 instruction 都不得依赖某个服务。服务差异只能来自 Catalog、Service Contract、Capability metadata 和服务端状态。
8
8
 
@@ -34,6 +34,7 @@ Commander 自动提供的 `itpay help [command]` 与 `itpay <group> help [subcom
34
34
  - [`itpay catalog list`](commands/catalog/list.md)
35
35
  - [`itpay install`](commands/install.md) - 查看指定 Agent 的安装说明
36
36
  - [`itpay skill show`](commands/skill.md) - 一次读取完整内置 ItPay Skill
37
+ - [`itpay auth login / status`](commands/auth.md) - 官方登录并绑定当前已登记 Agent,继续免费查询
37
38
  - [`itpay device recover`](commands/device.md) - 仅恢复运营已确认重建的 Backend registration
38
39
  - [`itpay docs`](commands/docs/index.md)
39
40
  - [`itpay docs list`](commands/docs/list.md)
package/docs/sell.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Sell Agent guide
2
2
 
3
+ The railway acceptance release `2.1.2` is published under npm's `next` tag,
4
+ not `latest`. Install this explicit version for dev acceptance and set
5
+ `ITPAY_BACKEND_URL=https://dev.itpay.ai` on every command. Its API contract requires
6
+ the matching dev backend release; do not use it against the older production
7
+ backend. Promote the npm latest tag only after production compatibility is verified.
8
+
3
9
  `itpay sell` is the Seller command namespace. Buyer `services` commands remain separate. Read `itpay sell guide --json` first, authenticate with `itpay sell auth login` and complete the standard ItPay browser login, then run `itpay sell auth status`, then use `sell status` to select the user's existing merchant. An unverified merchant must finish KYB and payout setup in the dashboard.
4
10
 
5
11
  ## Local-first workflow
@@ -23,7 +29,8 @@ All platform operations accept `--input-json <file>` for their declared fields a
23
29
 
24
30
  ## Invariants
25
31
 
26
- - Current public runtime is synchronous, acyclic, single entry, per-call pricing, one payment node, and delivery on success. Quota, prepaid consumption and async workflows are not publishable.
32
+ - The current runtime accepts bounded, acyclic, single-entry workflows with multiple API nodes. Free queries can use quota and explicit human confirmation; paid workflows use one payment node and either fixed per-call pricing or a trusted pre-payment dynamic quote. Prepaid balance billing remains unsupported.
33
+ - Protected railway fulfillment resumes through the platform booking Owner only after verified payment and Web passenger confirmation. A standalone API probe cannot supply a payment identity or passenger records. Follow the server Guide for actual acceptance and publication blockers; local graph validation is not live ticket-issuance evidence.
27
34
  - Local reports are diagnostics, not platform approval evidence. Platform verification is required; existing valid evidence may be reused. Admin approval never repeats Provider calls.
28
35
  - Every visual view reads the same YAML. Layout is presentation only.
29
36
  - Disclosure/confirmation binds the version being acted on. Do not turn `--confirm` into blanket permission for later changes.
@@ -35,7 +42,7 @@ The local `.itpay-sell` directory contains private fixtures, reports and the enc
35
42
 
36
43
  Local reports never substitute for the platform verification gate. Repeated upload of an unchanged saved version reuses its cloud version; a changed cloud revision or fixture revision requires explicit pull/review.
37
44
 
38
- For repository builds, run `scripts/v3/build-sell-runtime.sh`, build `apps/web/vite.sell-preview.config.ts`, and then build/package `apps/cli`. Packaging rejects missing native binaries or preview assets. `scripts/v3/sync-sell-contract.mjs --check` verifies that the CLI command contracts match the backend/MCP package.
45
+ For CLI repository builds, run `node scripts/fetch-sell-runtime.mjs` to obtain the exact checksummed native runtime in `seller-runtime.lock.json`, then `npm run test:package`. The committed `assets/sell-preview` directory supplies the local Builder. Packaging rejects missing native binaries or preview assets; do not substitute an arbitrary local binary for the locked release.
39
46
 
40
47
  Example local MCP configuration (use the existing authenticated CLI account):
41
48
 
@@ -53,4 +60,4 @@ Example local MCP configuration (use the existing authenticated CLI account):
53
60
 
54
61
  ## Seller login and dev
55
62
 
56
- Use `ITPAY_BACKEND_URL=https://dev.itpay.ai itpay sell auth login --json` to receive the normal ItPay authorization link. After browser login and required email verification, run `ITPAY_BACKEND_URL=https://dev.itpay.ai itpay sell auth status --json`. The CLI claims its own account session through the standard API and stores it in an owner-only file; never copy tokens or browser cookies. `itpay sell auth logout --json` revokes this session. Keep the same backend prefix on subsequent commands; production, dev, and sandbox state are isolated. Agent device enrollment does not grant Seller organization access.
63
+ Use `ITPAY_BACKEND_URL=https://dev.itpay.ai itpay sell auth login` to receive the normal ItPay authorization link. After browser login and required email verification, run `ITPAY_BACKEND_URL=https://dev.itpay.ai itpay sell auth status`. The CLI claims its own account session through the standard API and stores it in an owner-only file; never copy tokens or browser cookies. `itpay sell auth logout` revokes this session. Keep the same backend prefix on subsequent commands; production, dev, and sandbox state are isolated. Agent device enrollment does not grant Seller organization access.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itpay/cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "The ItPay CLI for services, orders, and human-authorized purchased content.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,7 +22,8 @@
22
22
  "assets/"
23
23
  ],
24
24
  "publishConfig": {
25
- "access": "public"
25
+ "access": "public",
26
+ "tag": "next"
26
27
  },
27
28
  "keywords": [
28
29
  "itpay",