@itpay/cli 2.0.13 → 2.0.14
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 +14 -7
- package/dist/src/commands/docs.js +1 -0
- package/dist/src/commands/guidance.js +3 -8
- package/dist/src/commands/install.js +2 -2
- package/dist/src/commands/readyz.js +2 -2
- package/dist/src/commands/skill.js +10 -10
- package/dist/src/main.js +8 -10
- package/dist/src/state/config.js +4 -3
- package/docs/agent/buyer/cart-checkout.json +16 -3
- package/docs/agent/buyer/catalog-list.json +1 -0
- package/docs/agent/buyer/identity-and-sessions.json +35 -14
- package/docs/agent/buyer/install-and-setup.json +26 -8
- package/docs/agent/buyer/orders-refunds.json +13 -2
- package/docs/agent/buyer/payment-flow.json +17 -3
- package/docs/agent/buyer/quickstart.json +48 -13
- package/docs/agent/buyer/render-hosts.json +14 -2
- package/docs/cli-reference/agent-types.md +2 -0
- package/docs/cli-reference/commands/buy.md +2 -0
- package/docs/cli-reference/commands/cart/add.md +2 -0
- package/docs/cli-reference/commands/cart/clear.md +2 -0
- package/docs/cli-reference/commands/cart/index.md +2 -0
- package/docs/cli-reference/commands/cart/next.md +2 -0
- package/docs/cli-reference/commands/cart/remove.md +3 -1
- package/docs/cli-reference/commands/cart/show.md +2 -0
- package/docs/cli-reference/commands/catalog/index.md +2 -0
- package/docs/cli-reference/commands/catalog/list.md +2 -0
- package/docs/cli-reference/commands/checkout.md +2 -0
- package/docs/cli-reference/commands/device.md +3 -1
- package/docs/cli-reference/commands/docs/index.md +2 -0
- package/docs/cli-reference/commands/docs/list.md +2 -0
- package/docs/cli-reference/commands/docs/search.md +2 -0
- package/docs/cli-reference/commands/docs/show.md +2 -0
- package/docs/cli-reference/commands/install.md +4 -2
- package/docs/cli-reference/commands/next.md +2 -0
- package/docs/cli-reference/commands/order.md +2 -0
- package/docs/cli-reference/commands/orders.md +2 -0
- package/docs/cli-reference/commands/pay.md +2 -0
- package/docs/cli-reference/commands/readyz.md +12 -10
- package/docs/cli-reference/commands/refund/cancel.md +2 -0
- package/docs/cli-reference/commands/refund/create.md +2 -0
- package/docs/cli-reference/commands/refund/get.md +2 -0
- package/docs/cli-reference/commands/refund/index.md +2 -0
- package/docs/cli-reference/commands/refund/list.md +2 -0
- package/docs/cli-reference/commands/refund/watch.md +2 -0
- package/docs/cli-reference/commands/services/action.md +2 -0
- package/docs/cli-reference/commands/services/checkout.md +2 -0
- package/docs/cli-reference/commands/services/events.md +2 -0
- package/docs/cli-reference/commands/services/get.md +2 -0
- package/docs/cli-reference/commands/services/index.md +2 -0
- package/docs/cli-reference/commands/services/invoke.md +2 -0
- package/docs/cli-reference/commands/services/list.md +2 -0
- package/docs/cli-reference/commands/services/next.md +2 -0
- package/docs/cli-reference/commands/services/quote.md +2 -0
- package/docs/cli-reference/commands/services/read-result.md +2 -0
- package/docs/cli-reference/commands/services/start.md +2 -0
- package/docs/cli-reference/commands/skill.md +5 -3
- package/docs/cli-reference/conventions.md +2 -0
- package/docs/cli-reference/index.md +3 -1
- package/package.json +6 -3
- package/skills/{itpay-buyer → itpay}/SKILL.md +39 -17
package/README.md
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
# ItPay CLI
|
|
2
2
|
|
|
3
|
-
The official V3 CLI
|
|
3
|
+
The official V3 CLI and the single ItPay entry point for Agent-driven commerce.
|
|
4
|
+
|
|
5
|
+
## One Entry Point, Two Actions
|
|
6
|
+
|
|
7
|
+
`itpay` is the only public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now, while Seller workflows will use the same entry point and are not implemented yet. Do not create separate Buyer or Seller product entry points.
|
|
4
8
|
|
|
5
9
|
```bash
|
|
6
10
|
npm install -g @itpay/cli
|
|
7
11
|
itpay readyz --json
|
|
8
|
-
itpay skill show itpay
|
|
12
|
+
itpay skill show itpay --json
|
|
9
13
|
itpay install --json
|
|
10
14
|
itpay --agent-type codex-desktop readyz --json
|
|
11
15
|
# follow next.command: typed skill show, then catalog list
|
|
12
16
|
```
|
|
13
17
|
|
|
14
|
-
The
|
|
18
|
+
The production Backend is permanently pinned to `https://app.itpay.ai`. Runtime environment variables cannot redirect the CLI to another Backend.
|
|
15
19
|
|
|
16
20
|
## Output Contract
|
|
17
21
|
|
|
@@ -42,11 +46,11 @@ Normative per-command contracts: [CLI Command Reference](docs/cli-reference/inde
|
|
|
42
46
|
|
|
43
47
|
`--agent-type` identifies the stable runtime and registered Agent instance. Every returned ItPay command preserves it. Different windows or chats of the same type reuse one Agent Instance; they are not separate identities. `--host` only selects the human presentation surface, and `--target` only routes output to a Host destination. Use `itpay install <agent_type> --json` for the exact responsibility.
|
|
44
48
|
|
|
45
|
-
The local installation keeps one Ed25519 private key
|
|
49
|
+
The local installation keeps one Ed25519 private key and one production Device registration for `https://app.itpay.ai`, with one Agent Instance per Agent Type. A rejected session is renewed and the same request is retried once; revoked v2 registrations are never silently replaced.
|
|
46
50
|
|
|
47
51
|
## Command Families
|
|
48
52
|
|
|
49
|
-
- `readyz
|
|
53
|
+
- `readyz`: fixed production Backend liveness; `catalog list`: compatibility-gated discovery.
|
|
50
54
|
- `services start/invoke/action/checkout/next`: generic Service Execution flow.
|
|
51
55
|
- `cart add/show/remove/clear/next`, `buy`: canonical Cart and ordinary Checkout flow.
|
|
52
56
|
- `checkout`: authoritative payment and fulfillment recovery.
|
|
@@ -71,11 +75,10 @@ itpay --agent-type <agent_type> services checkout <service_execution_id> --resum
|
|
|
71
75
|
itpay checkout --id <checkout_id> --token <display_token> --json
|
|
72
76
|
```
|
|
73
77
|
|
|
74
|
-
The local `~/.itpay-v3` directory stores one owner-only signing key,
|
|
78
|
+
The local `~/.itpay-v3` directory stores one owner-only signing key, the `https://app.itpay.ai` Device registration and Agent instances, idempotency operations, and recovery handles. Backend state remains authoritative. Do not delete or rotate this identity to recover quota.
|
|
75
79
|
|
|
76
80
|
## Environment
|
|
77
81
|
|
|
78
|
-
- `ITPAY_BACKEND_URL`: deliberate API override.
|
|
79
82
|
- `ITPAY_AGENT_TYPE`: stable alternative to global `--agent-type`.
|
|
80
83
|
- `ITPAY_BEARER_TOKEN`: account-scoped Buyer session for account-only commands such as `orders`.
|
|
81
84
|
- `ITPAY_CART_SESSION_PATH`: local recovery-state path override.
|
|
@@ -91,10 +94,14 @@ Provider credentials, Buyer identity, payment provider choice, amount, refund po
|
|
|
91
94
|
```bash
|
|
92
95
|
npm run lint
|
|
93
96
|
npm test
|
|
97
|
+
npm run test:coverage
|
|
94
98
|
npm run test:package
|
|
95
99
|
npm run pack:dry-run
|
|
96
100
|
```
|
|
97
101
|
|
|
102
|
+
`npm install` configures the repository's pre-commit hook. Every commit must pass
|
|
103
|
+
`npm run lint` and `npm test`; do not bypass the hook for pull-request changes.
|
|
104
|
+
|
|
98
105
|
Source boundaries:
|
|
99
106
|
|
|
100
107
|
- `src/main.ts`: parser and error-envelope wiring.
|
|
@@ -92,6 +92,7 @@ function findDocsDir() {
|
|
|
92
92
|
function parseDoc(raw, file) {
|
|
93
93
|
const value = JSON.parse(raw);
|
|
94
94
|
if (typeof value.schema_version !== "string" ||
|
|
95
|
+
typeof value.product_scope !== "string" ||
|
|
95
96
|
typeof value.topic !== "string" ||
|
|
96
97
|
typeof value.title !== "string" ||
|
|
97
98
|
typeof value.purpose !== "string") {
|
|
@@ -257,8 +257,8 @@ export function errorRecoveryActions(error) {
|
|
|
257
257
|
return [
|
|
258
258
|
{
|
|
259
259
|
id: "read_agent_session_rules",
|
|
260
|
-
label: "Read identity and session recovery rules",
|
|
261
|
-
command: "itpay skill show itpay
|
|
260
|
+
label: "Read ItPay identity and session recovery rules",
|
|
261
|
+
command: "itpay skill show itpay --json",
|
|
262
262
|
reason: "The CLI already attempted one automatic session renewal; do not rotate identity or loop retries.",
|
|
263
263
|
},
|
|
264
264
|
];
|
|
@@ -304,14 +304,9 @@ export function errorRecoveryActions(error) {
|
|
|
304
304
|
return [
|
|
305
305
|
{
|
|
306
306
|
id: "retry_after_backend_recovers",
|
|
307
|
-
label: "Retry after
|
|
307
|
+
label: "Retry after app.itpay.ai is reachable",
|
|
308
308
|
command: "itpay readyz",
|
|
309
309
|
},
|
|
310
|
-
{
|
|
311
|
-
id: "check_backend_url",
|
|
312
|
-
label: "Check the configured backend URL",
|
|
313
|
-
command: "echo $ITPAY_BACKEND_URL",
|
|
314
|
-
},
|
|
315
310
|
];
|
|
316
311
|
}
|
|
317
312
|
return [];
|
|
@@ -48,9 +48,9 @@ export function runInstall(target, options = {}) {
|
|
|
48
48
|
instruction: INSTRUCTIONS[normalized],
|
|
49
49
|
next: {
|
|
50
50
|
command: `itpay --agent-type ${normalized} readyz --json`,
|
|
51
|
-
reason: "
|
|
51
|
+
reason: "验证固定生产 ItPay API 的可用性",
|
|
52
52
|
},
|
|
53
|
-
recovery: [{ command: "itpay docs show install-and-setup", reason: "
|
|
53
|
+
recovery: [{ command: "itpay docs show install-and-setup", reason: "查看固定生产后端和首次使用说明" }],
|
|
54
54
|
}, options);
|
|
55
55
|
}
|
|
56
56
|
function isInstallAgentType(value) {
|
|
@@ -5,8 +5,8 @@ export async function runReadyz(backend, options = {}) {
|
|
|
5
5
|
writeCommandEnvelope({
|
|
6
6
|
status: response.status,
|
|
7
7
|
result: { backend: "available", ...(options.agentType ? { agent_type: options.agentType } : {}) },
|
|
8
|
-
instruction: "ItPay 可用;先完整读取内置
|
|
9
|
-
next: { command: "itpay skill show itpay
|
|
8
|
+
instruction: "ItPay 可用;先完整读取内置 ItPay Skill,再进入当前已支持的 buy 流程。sell 将来也使用同一入口,但当前尚未实现。",
|
|
9
|
+
next: { command: "itpay skill show itpay --json", reason: "加载完整操作与安全规则" },
|
|
10
10
|
recovery: [],
|
|
11
11
|
}, options);
|
|
12
12
|
}
|
|
@@ -4,24 +4,24 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
import { declaredAgentType } from "../state/agent_type.js";
|
|
5
5
|
import { CommandContractError, writeCommandEnvelope } from "./guidance.js";
|
|
6
6
|
const commandDir = dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
const
|
|
7
|
+
const ITPAY_SKILL = "itpay";
|
|
8
8
|
export function runSkillShow(name, options = {}) {
|
|
9
9
|
const normalized = name.trim().toLowerCase();
|
|
10
|
-
if (normalized !==
|
|
11
|
-
throw new CommandContractError("skill_not_found", `skill not found: ${name}`, `当前 CLI 只内置 ${
|
|
10
|
+
if (normalized !== ITPAY_SKILL) {
|
|
11
|
+
throw new CommandContractError("skill_not_found", `skill not found: ${name}`, `当前 CLI 只内置 ${ITPAY_SKILL};不要猜测 Skill 名称。`, [{ command: `itpay skill show ${ITPAY_SKILL} --json`, reason: "读取完整 ItPay Skill" }]);
|
|
12
12
|
}
|
|
13
13
|
let content;
|
|
14
14
|
try {
|
|
15
15
|
content = readFileSync(findSkillPath(), "utf8");
|
|
16
16
|
}
|
|
17
17
|
catch {
|
|
18
|
-
throw new Error("packaged skill is unavailable: itpay
|
|
18
|
+
throw new Error("packaged skill is unavailable: itpay");
|
|
19
19
|
}
|
|
20
20
|
validateSkill(content);
|
|
21
21
|
const agentType = options.agentType ?? declaredAgentType();
|
|
22
22
|
const envelope = {
|
|
23
23
|
status: "shown",
|
|
24
|
-
result: { skill:
|
|
24
|
+
result: { skill: ITPAY_SKILL, content },
|
|
25
25
|
instruction: agentType
|
|
26
26
|
? agentType === "workbuddy"
|
|
27
27
|
? "完整读取并遵守 Skill;保持 workbuddy 和同一 Node/CLI launcher。运行会持久化 ~/.itpay-v3 的 ItPay Bash 命令前,把 Shell 工具参数 dangerouslyDisableSandbox 设为 true;用户拒绝权限时停止,不要切换 Node、删除 identity 或处理 lock。"
|
|
@@ -40,16 +40,16 @@ export function runSkillShow(name, options = {}) {
|
|
|
40
40
|
}
|
|
41
41
|
function findSkillPath() {
|
|
42
42
|
if (process.env.ITPAY_CLI_SKILLS_DIR) {
|
|
43
|
-
return resolve(process.env.ITPAY_CLI_SKILLS_DIR,
|
|
43
|
+
return resolve(process.env.ITPAY_CLI_SKILLS_DIR, ITPAY_SKILL, "SKILL.md");
|
|
44
44
|
}
|
|
45
|
-
const packagePath = resolve(commandDir, "..", "..", "..", "skills",
|
|
45
|
+
const packagePath = resolve(commandDir, "..", "..", "..", "skills", ITPAY_SKILL, "SKILL.md");
|
|
46
46
|
if (existsSync(packagePath))
|
|
47
47
|
return packagePath;
|
|
48
|
-
return resolve(commandDir, "..", "..", "skills",
|
|
48
|
+
return resolve(commandDir, "..", "..", "skills", ITPAY_SKILL, "SKILL.md");
|
|
49
49
|
}
|
|
50
50
|
function validateSkill(content) {
|
|
51
51
|
const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/)?.[1];
|
|
52
|
-
if (!frontmatter || !/^name:\s*itpay
|
|
53
|
-
throw new Error("invalid packaged skill: itpay
|
|
52
|
+
if (!frontmatter || !/^name:\s*itpay\s*$/m.test(frontmatter) || !/^description:\s*(?:>|\S)/m.test(frontmatter)) {
|
|
53
|
+
throw new Error("invalid packaged skill: itpay");
|
|
54
54
|
}
|
|
55
55
|
}
|
package/dist/src/main.js
CHANGED
|
@@ -26,7 +26,7 @@ import { collectOption, parseKeyValueList, runServicesAction, runServicesCheckou
|
|
|
26
26
|
const program = new Command();
|
|
27
27
|
program
|
|
28
28
|
.name("itpay")
|
|
29
|
-
.description("V3 ItPay CLI —
|
|
29
|
+
.description("V3 ItPay CLI — one entry point for buy workflows and future sell workflows")
|
|
30
30
|
.option("--agent-type <type>", "agent runtime type used for device enrollment and client-specific guidance")
|
|
31
31
|
.version(CLI_VERSION);
|
|
32
32
|
function withHost(value) {
|
|
@@ -106,11 +106,11 @@ function reportCLIError(error, contract) {
|
|
|
106
106
|
const providerContractMismatch = error instanceof HttpError && error.code === "provider_contract_mismatch";
|
|
107
107
|
const capabilityInputInvalid = error instanceof HttpError && error.code === "capability_input_invalid";
|
|
108
108
|
const deviceRecovery = deviceError ? [{
|
|
109
|
-
command: "itpay skill show itpay
|
|
110
|
-
reason: "
|
|
109
|
+
command: "itpay skill show itpay --json",
|
|
110
|
+
reason: "读取 ItPay 身份边界;该错误需要用户或运营恢复 Backend 登记,不能通过换类型或删除本地身份绕过",
|
|
111
111
|
}] : [];
|
|
112
112
|
const stateRecovery = stateError ? [{
|
|
113
|
-
command: "itpay skill show itpay
|
|
113
|
+
command: "itpay skill show itpay --json",
|
|
114
114
|
reason: "读取 Device 状态边界;修复当前 Host 的持久写权限后重试原命令",
|
|
115
115
|
}] : [];
|
|
116
116
|
const authorizationInstruction = stateError
|
|
@@ -209,17 +209,15 @@ program
|
|
|
209
209
|
const config = loadConfig();
|
|
210
210
|
const backend = newBackendClient(config);
|
|
211
211
|
try {
|
|
212
|
-
await requirePlatformCompatibility(backend);
|
|
213
212
|
await runReadyz(backend, { jsonOutput: Boolean(options.json), ...(config.agentType ? { agentType: config.agentType } : {}) });
|
|
214
213
|
}
|
|
215
214
|
catch (error) {
|
|
216
215
|
reportCLIError(error, {
|
|
217
216
|
jsonOutput: Boolean(options.json),
|
|
218
217
|
code: "backend_unavailable",
|
|
219
|
-
instruction: "
|
|
218
|
+
instruction: "固定生产后端 https://app.itpay.ai 当前不可用;后端恢复前不要继续下单,也不要切换到其他地址。",
|
|
220
219
|
recovery: [
|
|
221
|
-
{ command: "
|
|
222
|
-
{ command: "itpay readyz", reason: "重试可用性检查" },
|
|
220
|
+
{ command: "itpay readyz", reason: "重试固定生产后端的可用性检查" },
|
|
223
221
|
],
|
|
224
222
|
});
|
|
225
223
|
}
|
|
@@ -228,14 +226,14 @@ program
|
|
|
228
226
|
const deviceCmd = program.command("device").description("Recover local Device registration state after an operator-confirmed Backend reset");
|
|
229
227
|
deviceCmd
|
|
230
228
|
.command("recover")
|
|
231
|
-
.description("Forget only the
|
|
229
|
+
.description("Forget only the app.itpay.ai registration while preserving the local private key")
|
|
232
230
|
.option("--confirm-backend-reset", "confirm that an operator reset the selected Backend registration database")
|
|
233
231
|
.option("--json", "output JSON instead of terminal text")
|
|
234
232
|
.action(async (options) => {
|
|
235
233
|
const config = loadConfig();
|
|
236
234
|
try {
|
|
237
235
|
if (!config.agentType) {
|
|
238
|
-
throw new CommandContractError("agent_type_required", "agent type is required for
|
|
236
|
+
throw new CommandContractError("agent_type_required", "agent type is required for app.itpay.ai Device recovery", "如实声明当前 Agent Type;恢复后必须用同一类型重新登记。", [{ command: "itpay install --json", reason: "选择当前真实 Agent Type" }]);
|
|
239
237
|
}
|
|
240
238
|
if (!options.confirmBackendReset) {
|
|
241
239
|
throw new CommandContractError("backend_reset_confirmation_required", "--confirm-backend-reset is required", "仅在运营已确认当前 Backend 的 Device 登记数据库被重建或清空后执行;普通 session 失效或 revoked 不得使用。", [{ command: "itpay docs show identity-and-sessions --json", reason: "检查适用边界" }]);
|
package/dist/src/state/config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// CLI configuration loader.
|
|
1
|
+
// CLI configuration loader. The production Backend is pinned to app.itpay.ai;
|
|
2
|
+
// environment variables configure only non-Backend runtime details. Checkout
|
|
2
3
|
// display-token persistence belongs to the cart session file, protected with
|
|
3
4
|
// owner-only permissions. Provider secrets are explicitly out of scope here.
|
|
4
5
|
import { homedir } from "node:os";
|
|
@@ -10,7 +11,7 @@ import { declaredAgentType } from "./agent_type.js";
|
|
|
10
11
|
import { DeviceAuthority } from "./device_authority.js";
|
|
11
12
|
import { OperationJournal } from "./operation_journal.js";
|
|
12
13
|
export const DEFAULT_BASE_URL = "https://app.itpay.ai";
|
|
13
|
-
export const CLI_VERSION = "2.0.
|
|
14
|
+
export const CLI_VERSION = "2.0.14";
|
|
14
15
|
export const API_CONTRACT_REVISION = "sha256:7f4c40b082292bf823631bcd37d452f4a8537153e30636d5eb3a2b24a77ce602";
|
|
15
16
|
const CART_SESSION_DEFAULT_DIR = ".itpay-v3";
|
|
16
17
|
const CART_SESSION_FILENAME = "cart.json";
|
|
@@ -24,7 +25,7 @@ export function cartSessionPath(env = process.env) {
|
|
|
24
25
|
return resolve(dir, CART_SESSION_FILENAME);
|
|
25
26
|
}
|
|
26
27
|
export function loadConfig(env = process.env) {
|
|
27
|
-
const baseURL =
|
|
28
|
+
const baseURL = DEFAULT_BASE_URL;
|
|
28
29
|
const bearerToken = env.ITPAY_BEARER_TOKEN || undefined;
|
|
29
30
|
const agentType = declaredAgentType(env);
|
|
30
31
|
const checkoutCurrency = env.ITPAY_CURRENCY || "CNY";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "itp.agent_doc.v1",
|
|
3
3
|
"role": "buyer",
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point, and $itpay is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are buy and sell: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.",
|
|
4
5
|
"topic": "cart-checkout",
|
|
5
6
|
"title": "Canonical Cart And Checkout Routing",
|
|
6
7
|
"purpose": "Use the canonical server Cart and route service-backed lines through Service Execution without hardcoded service logic.",
|
|
@@ -43,8 +44,20 @@
|
|
|
43
44
|
"Do not treat QR display as payment verification."
|
|
44
45
|
],
|
|
45
46
|
"next_docs": [
|
|
46
|
-
{
|
|
47
|
-
|
|
47
|
+
{
|
|
48
|
+
"condition": "Checkout handoff is ready",
|
|
49
|
+
"topic": "payment-flow"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"condition": "Host rendering needs clarification",
|
|
53
|
+
"topic": "render-hosts"
|
|
54
|
+
}
|
|
48
55
|
],
|
|
49
|
-
"search_terms": [
|
|
56
|
+
"search_terms": [
|
|
57
|
+
"cart",
|
|
58
|
+
"checkout",
|
|
59
|
+
"service execution",
|
|
60
|
+
"resume",
|
|
61
|
+
"contact"
|
|
62
|
+
]
|
|
50
63
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "itp.agent_doc.v1",
|
|
3
3
|
"role": "buyer",
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point, and $itpay is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are buy and sell: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.",
|
|
4
5
|
"topic": "catalog-list",
|
|
5
6
|
"title": "Browse ItPay V3 Service Catalog",
|
|
6
7
|
"purpose": "Teach the agent how to browse and display available catalog services to the buyer.",
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "itp.agent_doc.v1",
|
|
3
3
|
"role": "buyer",
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point, and $itpay is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are buy and sell: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.",
|
|
4
5
|
"topic": "identity-and-sessions",
|
|
5
6
|
"title": "Device Identity And Session Recovery",
|
|
6
|
-
"purpose": "Explain stable local identity,
|
|
7
|
+
"purpose": "Explain stable local identity, the fixed app.itpay.ai production registration, Agent Type instances, and bounded automatic session recovery.",
|
|
7
8
|
"when_to_use": [
|
|
8
9
|
"A different Agent window or runtime starts using an existing CLI installation.",
|
|
9
10
|
"The CLI reports device_state_unwritable, or the Backend reports agent_identity_required, agent_device_session_required, or agent_device_revoked.",
|
|
10
|
-
"
|
|
11
|
+
"An operator confirms that the app.itpay.ai Device registration database was reset."
|
|
11
12
|
],
|
|
12
13
|
"identity_model": {
|
|
13
14
|
"local_key": "One owner-only Ed25519 private key for the local installation.",
|
|
14
|
-
"backend_registration": "One
|
|
15
|
-
"agent_instance": "One instance per agent_type under
|
|
15
|
+
"backend_registration": "One production Device registration for https://app.itpay.ai; runtime environment variables cannot redirect the CLI.",
|
|
16
|
+
"agent_instance": "One instance per agent_type under the production registration; same-type windows and chats reuse it.",
|
|
16
17
|
"presentation": "Host and target route output only and never identify the Agent or provide business input."
|
|
17
18
|
},
|
|
18
19
|
"automatic_recovery": [
|
|
@@ -29,36 +30,56 @@
|
|
|
29
30
|
"commands": [
|
|
30
31
|
{
|
|
31
32
|
"intent": "reload the complete rules",
|
|
32
|
-
"command": "itpay --agent-type <agent_type> skill show itpay
|
|
33
|
+
"command": "itpay --agent-type <agent_type> skill show itpay --json",
|
|
33
34
|
"success_signal": "the full Skill is returned and next keeps the same Agent Type"
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
|
-
"intent": "confirm
|
|
37
|
+
"intent": "confirm app.itpay.ai is available",
|
|
37
38
|
"command": "itpay --agent-type <agent_type> readyz --json",
|
|
38
39
|
"success_signal": "Backend is available and onboarding returns to the Skill"
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
|
-
"intent": "recover after an operator-confirmed reset of the
|
|
42
|
+
"intent": "recover after an operator-confirmed reset of the app.itpay.ai Device registration database",
|
|
42
43
|
"command": "itpay --agent-type <agent_type> device recover --confirm-backend-reset --json",
|
|
43
|
-
"success_signal": "only the
|
|
44
|
+
"success_signal": "only the app.itpay.ai registration is removed and the private key remains"
|
|
44
45
|
}
|
|
45
46
|
],
|
|
46
47
|
"agent_rules": [
|
|
47
48
|
"Use the real runtime type and keep it stable across every command in the flow.",
|
|
48
49
|
"Keep the same CLI/Node launcher and Host-approved permission context for the whole flow.",
|
|
49
50
|
"Treat a new window, chat, task, or process of the same runtime as the same Agent Type, not a new identity.",
|
|
50
|
-
"Expect
|
|
51
|
-
"After automatic recovery fails, stop and report the exact code,
|
|
51
|
+
"Expect all production CLI traffic to use https://app.itpay.ai; do not set or suggest a Backend URL override.",
|
|
52
|
+
"After automatic recovery fails, stop and report the exact code, app.itpay.ai, Agent Type, and command family without exposing private keys or tokens."
|
|
52
53
|
],
|
|
53
54
|
"forbidden": [
|
|
54
55
|
"Do not delete ~/.itpay-v3, rotate the key, switch Agent Type, or repeatedly retry to obtain fresh quota.",
|
|
55
56
|
"Do not use device recover for session expiry, revocation, quota recovery, or an unconfirmed Backend failure.",
|
|
56
|
-
"Do not
|
|
57
|
+
"Do not redirect the CLI to dev, test, local, or any non-app.itpay.ai Backend.",
|
|
57
58
|
"Do not use --target as identity or service input."
|
|
58
59
|
],
|
|
59
60
|
"next_docs": [
|
|
60
|
-
{
|
|
61
|
-
|
|
61
|
+
{
|
|
62
|
+
"condition": "Identity is healthy",
|
|
63
|
+
"topic": "quickstart"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"condition": "Need setup details",
|
|
67
|
+
"topic": "install-and-setup"
|
|
68
|
+
}
|
|
62
69
|
],
|
|
63
|
-
"search_terms": [
|
|
70
|
+
"search_terms": [
|
|
71
|
+
"identity",
|
|
72
|
+
"device",
|
|
73
|
+
"session",
|
|
74
|
+
"login",
|
|
75
|
+
"authentication",
|
|
76
|
+
"agent type",
|
|
77
|
+
"backend",
|
|
78
|
+
"revoked",
|
|
79
|
+
"recover",
|
|
80
|
+
"unwritable",
|
|
81
|
+
"lock",
|
|
82
|
+
"window",
|
|
83
|
+
"chat"
|
|
84
|
+
]
|
|
64
85
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "itp.agent_doc.v1",
|
|
3
3
|
"role": "buyer",
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point, and $itpay is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are buy and sell: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.",
|
|
4
5
|
"topic": "install-and-setup",
|
|
5
6
|
"title": "Install And Identify The ItPay Agent Runtime",
|
|
6
|
-
"purpose": "Install the CLI, load the complete
|
|
7
|
+
"purpose": "Install the CLI, load the complete ItPay Skill, and select one stable Agent Type without confusing identity, Backend, Host, target, or chat window.",
|
|
7
8
|
"when_to_use": [
|
|
8
9
|
"The CLI is being installed or upgraded.",
|
|
9
10
|
"The agent needs to confirm its stable runtime identity and default output Host."
|
|
@@ -12,11 +13,11 @@
|
|
|
12
13
|
{
|
|
13
14
|
"intent": "verify the API and enter packaged onboarding",
|
|
14
15
|
"command": "itpay readyz --json",
|
|
15
|
-
"success_signal": "status is ready and next points to skill show itpay
|
|
16
|
+
"success_signal": "status is ready and next points to skill show itpay"
|
|
16
17
|
},
|
|
17
18
|
{
|
|
18
19
|
"intent": "read the complete packaged operating contract",
|
|
19
|
-
"command": "itpay skill show itpay
|
|
20
|
+
"command": "itpay skill show itpay --json",
|
|
20
21
|
"success_signal": "status is shown, result.content contains the complete Skill, and next selects Agent Type or Catalog"
|
|
21
22
|
},
|
|
22
23
|
{
|
|
@@ -32,23 +33,40 @@
|
|
|
32
33
|
],
|
|
33
34
|
"agent_rules": [
|
|
34
35
|
"Install with npm install -g @itpay/cli.",
|
|
36
|
+
"The production Backend is fixed to https://app.itpay.ai and cannot be redirected by runtime environment variables.",
|
|
35
37
|
"If backend_contract_incompatible includes result.required_cli_version, stop all ItPay business commands and run only the exact npm install recovery returned by the CLI; never replace its version with latest.",
|
|
36
38
|
"After upgrading, require itpay --version to equal result.required_cli_version before running readyz again; never change Agent Type or Device identity to recover compatibility.",
|
|
37
|
-
"
|
|
39
|
+
"The production Backend is fixed to https://app.itpay.ai and cannot be redirected by runtime environment variables.",
|
|
38
40
|
"Use one exact type: codex-desktop, codex-cli, claude-code-desktop, claude-code-cli, or workbuddy.",
|
|
39
|
-
"One local private key is reused
|
|
40
|
-
"Within
|
|
41
|
+
"One local private key is reused with the https://app.itpay.ai production Device registration and quota lineage.",
|
|
42
|
+
"Within the production Backend registration, each Agent Type has one Agent Instance; all windows and chats of the same type reuse it.",
|
|
41
43
|
"Agent Type identifies the runtime. Host controls rendering and target only identifies a presentation destination.",
|
|
42
44
|
"Keep the exact Agent Type in every next or recovery command; do not fall back to a type previously used by another runtime.",
|
|
43
45
|
"Do not change Agent Type or rotate local identity to reset quota or recover a failed command."
|
|
44
46
|
],
|
|
45
47
|
"forbidden": [
|
|
46
48
|
"Do not use codex, terminal, claude-code, or plain-chat as Agent Types.",
|
|
49
|
+
"Do not set or suggest a Backend URL override; production CLI traffic always targets https://app.itpay.ai.",
|
|
47
50
|
"Do not claim that install writes host configuration or registers a device; it only prints instructions.",
|
|
48
51
|
"Do not create a new identity for a different window, task, chat, or process of the same Agent Type."
|
|
49
52
|
],
|
|
50
53
|
"next_docs": [
|
|
51
|
-
{
|
|
54
|
+
{
|
|
55
|
+
"condition": "Installation is verified",
|
|
56
|
+
"topic": "quickstart"
|
|
57
|
+
}
|
|
52
58
|
],
|
|
53
|
-
"search_terms": [
|
|
59
|
+
"search_terms": [
|
|
60
|
+
"install",
|
|
61
|
+
"agent type",
|
|
62
|
+
"host",
|
|
63
|
+
"target",
|
|
64
|
+
"device",
|
|
65
|
+
"session",
|
|
66
|
+
"identity",
|
|
67
|
+
"backend",
|
|
68
|
+
"codex",
|
|
69
|
+
"claude code",
|
|
70
|
+
"workbuddy"
|
|
71
|
+
]
|
|
54
72
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "itp.agent_doc.v1",
|
|
3
3
|
"role": "buyer",
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point, and $itpay is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are buy and sell: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.",
|
|
4
5
|
"topic": "orders-refunds",
|
|
5
6
|
"title": "Order, Delivery And Refund Recovery",
|
|
6
7
|
"purpose": "Read owned orders and manage refunds through signed Agent authority without guessing payment or refund state.",
|
|
@@ -48,7 +49,17 @@
|
|
|
48
49
|
"Do not claim a refund succeeded before the Refund Owner says succeeded."
|
|
49
50
|
],
|
|
50
51
|
"next_docs": [
|
|
51
|
-
{
|
|
52
|
+
{
|
|
53
|
+
"condition": "Need the original purchase path",
|
|
54
|
+
"topic": "quickstart"
|
|
55
|
+
}
|
|
52
56
|
],
|
|
53
|
-
"search_terms": [
|
|
57
|
+
"search_terms": [
|
|
58
|
+
"order",
|
|
59
|
+
"refund",
|
|
60
|
+
"cancel",
|
|
61
|
+
"watch",
|
|
62
|
+
"delivery lock",
|
|
63
|
+
"grant"
|
|
64
|
+
]
|
|
54
65
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "itp.agent_doc.v1",
|
|
3
3
|
"role": "buyer",
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point, and $itpay is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are buy and sell: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.",
|
|
4
5
|
"topic": "payment-flow",
|
|
5
6
|
"title": "Human Checkout Handoff And Payment Verification",
|
|
6
7
|
"purpose": "Show the ItPay Checkout to the human and recover authoritative payment state without creating duplicate payment resources.",
|
|
@@ -42,8 +43,21 @@
|
|
|
42
43
|
"Do not start another Service Execution to bypass quota, candidate, quote, checkout, or delivery state."
|
|
43
44
|
],
|
|
44
45
|
"next_docs": [
|
|
45
|
-
{
|
|
46
|
-
|
|
46
|
+
{
|
|
47
|
+
"condition": "Payment is verified",
|
|
48
|
+
"topic": "orders-refunds"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"condition": "The current Host cannot display the handoff",
|
|
52
|
+
"topic": "render-hosts"
|
|
53
|
+
}
|
|
47
54
|
],
|
|
48
|
-
"search_terms": [
|
|
55
|
+
"search_terms": [
|
|
56
|
+
"payment",
|
|
57
|
+
"checkout",
|
|
58
|
+
"QR",
|
|
59
|
+
"display token",
|
|
60
|
+
"resume",
|
|
61
|
+
"verified"
|
|
62
|
+
]
|
|
49
63
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "itp.agent_doc.v1",
|
|
3
3
|
"role": "buyer",
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point, and $itpay is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are buy and sell: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.",
|
|
4
5
|
"topic": "quickstart",
|
|
5
6
|
"title": "ItPay CLI Buyer Quickstart",
|
|
6
7
|
"purpose": "Run the shortest safe discovery, Service Execution, Checkout, delivery, and refund flow using server-returned next commands.",
|
|
@@ -11,19 +12,23 @@
|
|
|
11
12
|
"required_state": {
|
|
12
13
|
"needs": [
|
|
13
14
|
"the real supported Agent Type",
|
|
14
|
-
"the
|
|
15
|
+
"the fixed production Backend https://app.itpay.ai"
|
|
15
16
|
],
|
|
16
|
-
"must_not_need": [
|
|
17
|
+
"must_not_need": [
|
|
18
|
+
"Admin access",
|
|
19
|
+
"Provider secrets",
|
|
20
|
+
"raw payload access"
|
|
21
|
+
]
|
|
17
22
|
},
|
|
18
23
|
"commands": [
|
|
19
24
|
{
|
|
20
|
-
"intent": "verify
|
|
25
|
+
"intent": "verify fixed production Backend availability",
|
|
21
26
|
"command": "itpay --agent-type <agent_type> readyz --json",
|
|
22
|
-
"success_signal": "status is ready and next points to the complete packaged
|
|
27
|
+
"success_signal": "status is ready and next points to the complete packaged ItPay Skill"
|
|
23
28
|
},
|
|
24
29
|
{
|
|
25
30
|
"intent": "load the complete operating contract",
|
|
26
|
-
"command": "itpay --agent-type <agent_type> skill show itpay
|
|
31
|
+
"command": "itpay --agent-type <agent_type> skill show itpay --json",
|
|
27
32
|
"success_signal": "status is shown and next points to catalog list with the same Agent Type"
|
|
28
33
|
},
|
|
29
34
|
{
|
|
@@ -65,13 +70,43 @@
|
|
|
65
70
|
"Do not bypass a grant, refund lock, ownership error or compatibility gate."
|
|
66
71
|
],
|
|
67
72
|
"next_docs": [
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
{
|
|
74
|
+
"condition": "Need service catalog language",
|
|
75
|
+
"topic": "catalog-list"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"condition": "Need Cart and Checkout routing",
|
|
79
|
+
"topic": "cart-checkout"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"condition": "Need payment recovery",
|
|
83
|
+
"topic": "payment-flow"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"condition": "Need Host-specific presentation",
|
|
87
|
+
"topic": "render-hosts"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"condition": "Need order or refund recovery",
|
|
91
|
+
"topic": "orders-refunds"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"condition": "Need install or identity details",
|
|
95
|
+
"topic": "install-and-setup"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"condition": "Need device session recovery rules",
|
|
99
|
+
"topic": "identity-and-sessions"
|
|
100
|
+
}
|
|
75
101
|
],
|
|
76
|
-
"search_terms": [
|
|
102
|
+
"search_terms": [
|
|
103
|
+
"quickstart",
|
|
104
|
+
"service",
|
|
105
|
+
"next",
|
|
106
|
+
"recovery",
|
|
107
|
+
"delivery",
|
|
108
|
+
"refund",
|
|
109
|
+
"target",
|
|
110
|
+
"input"
|
|
111
|
+
]
|
|
77
112
|
}
|