@inf-monkeys-tech/monkeys-cli 0.12.42 → 0.12.44
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 +2 -0
- package/dist/command/metadata.d.ts.map +1 -1
- package/dist/command/metadata.js +3 -0
- package/dist/command/metadata.js.map +1 -1
- package/dist/commands/page/program/read.d.ts +12 -0
- package/dist/commands/page/program/read.d.ts.map +1 -0
- package/dist/commands/page/program/read.js +17 -0
- package/dist/commands/page/program/read.js.map +1 -0
- package/dist/commands/page/program/register.d.ts +14 -0
- package/dist/commands/page/program/register.d.ts.map +1 -0
- package/dist/commands/page/program/register.js +26 -0
- package/dist/commands/page/program/register.js.map +1 -0
- package/dist/declarative/program.d.ts +639 -0
- package/dist/declarative/program.d.ts.map +1 -0
- package/dist/declarative/program.js +174 -0
- package/dist/declarative/program.js.map +1 -0
- package/dist/security/redact.d.ts.map +1 -1
- package/dist/security/redact.js +20 -1
- package/dist/security/redact.js.map +1 -1
- package/oclif.manifest.json +169 -1
- package/package.json +2 -2
- package/skills/monkeys-shared/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -389,6 +389,8 @@ Studio commands require an explicit `--team`. Use `--surface`, `--environment`,
|
|
|
389
389
|
|
|
390
390
|
After an authorized dependency update, `page publish <id> --refresh-dependencies --yes` compiles a new release even when the Page JSON is unchanged. Normal publication keeps its existing no-op behavior for an already active declaration.
|
|
391
391
|
|
|
392
|
+
For Pages that reference an ActionProgram, register its exact artifact before publishing. `page program register --subscription <name> --team <team-id> --file <candidate.json> --receipt <private-receipt.json> --dry-run` validates a `PrepareActionProgramRequest` with the server, including its inspected `expectedVersion`, hashes, permissions, and installed dependencies. Apply with `--yes` instead of `--dry-run`. The CLI durably creates the receipt before sending the write and verifies the complete artifact afterward. Reusing that receipt performs readback only, including after a timeout; retain it even if verification fails. `page program read --subscription <name> --team <team-id> --file <reference.json>` accepts a `ReadActionProgramRequest` containing the exact `revisionRef`. Neither command executes the program, installs its dependencies, or publishes its Page.
|
|
393
|
+
|
|
392
394
|
Catalog commands require a Subscription configured with only `--expected-surface kernel`. Kernel operators can use `page catalog import --file <artifact.json> --expected-hash <active-hash>`, followed by `page catalog synchronize --expected-hash <new-hash>`. Import checks the observed head before sending; synchronization enforces the exact catalog hash and definition revisions on the server. Use `--dry-run` first and `--yes` to apply each stage. These commands do not publish pages. `page catalog design-import --file <intent.json>` accepts an official Design artifact with `expectedCurrentSourceHash` and its exact `idempotencyKey`; the server checks dedicated activation authority and append-only compatibility. Its dry run checks local artifact hashes only. If a write outcome is unknown, inspect current catalog and definition state before retrying.
|
|
393
395
|
|
|
394
396
|
These commands require the document-import endpoints in monkeys-server and SDK 1.1.11. For coordinated local testing before SDK publication, build and pack the SDK, then run CLI verification with `MONKEYS_TEST_SDK_TARBALL=/absolute/path/to/sdk.tgz bun run verify`. Release the exact SDK artifact before releasing consumers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/command/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAClE,uBAAuB,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvD,oBAAoB,EAAE,OAAO,CAAC;IAC9B,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B,IAAI,EAAE,SAAS,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/command/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAClE,uBAAuB,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvD,oBAAoB,EAAE,OAAO,CAAC;IAC9B,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B,IAAI,EAAE,SAAS,CAAC;CACjB;AAmLD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAiCnE"}
|
package/dist/command/metadata.js
CHANGED
|
@@ -9,6 +9,7 @@ const IDENTITY_MUTATIONS = [
|
|
|
9
9
|
'group permission set',
|
|
10
10
|
];
|
|
11
11
|
const NATIVE_DRY_RUN_COMMANDS = new Set([
|
|
12
|
+
'page program register',
|
|
12
13
|
'page catalog design-import',
|
|
13
14
|
'page catalog import',
|
|
14
15
|
'page catalog synchronize',
|
|
@@ -67,6 +68,7 @@ const READ_COMMANDS = new Set([
|
|
|
67
68
|
const CREDENTIAL_PREFIXES = ['auth login', 'auth logout', 'subscription add', 'subscription remove'];
|
|
68
69
|
const CREDENTIAL_COMMANDS = new Set(['auth api-key import']);
|
|
69
70
|
const PRIVILEGED_COMMANDS = new Set([
|
|
71
|
+
'page program register',
|
|
70
72
|
'page catalog design-import',
|
|
71
73
|
'page catalog import',
|
|
72
74
|
'page catalog synchronize',
|
|
@@ -99,6 +101,7 @@ const PRIVILEGED_COMMANDS = new Set([
|
|
|
99
101
|
]);
|
|
100
102
|
const DESTRUCTIVE_VERBS = new Set(['delete', 'remove']);
|
|
101
103
|
const NATIVE_REQUIRED_CONFIRMATION = new Set([
|
|
104
|
+
'page program register',
|
|
102
105
|
'page catalog design-import',
|
|
103
106
|
'page catalog import',
|
|
104
107
|
'page catalog synchronize',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/command/metadata.ts"],"names":[],"mappings":"AAUA,MAAM,kBAAkB,GAAG;IACzB,gBAAgB;IAChB,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,cAAc;IACd,cAAc;IAC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,uBAAuB,GAC3B,4BAA4B,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,+BAA+B,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,UAAU,KAAK,UAAU;QAC1H,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,gBAAgB,KAAK,UAAU;YAC/B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,MAAM,CAAC;IAEf,OAAO;QACL,uBAAuB;QACvB,gBAAgB;QAChB,oBAAoB,EAAE,gBAAgB,KAAK,UAAU;QACrD,MAAM,EAAE,uBAAuB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM;QACnE,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LocalCommand } from '../../../config/local-command.js';
|
|
2
|
+
export default class ProgramRead extends LocalCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
subscription: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
team: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
file: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../src/commands/page/program/read.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAmB,MAAM,kCAAkC,CAAC;AAGjF,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,YAAY;IACnD,OAAgB,WAAW,SAAsF;IACjH,OAAgB,KAAK;QACnB,YAAY;QACZ,IAAI;QACJ,IAAI;QACJ,MAAM;MACN;IACI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAKzB;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { LocalCommand, localOutputFlag } from '../../../config/local-command.js';
|
|
3
|
+
import { runProgramRead } from '../../../declarative/program.js';
|
|
4
|
+
export default class ProgramRead extends LocalCommand {
|
|
5
|
+
static description = 'Read and verify an exact registered ActionProgram revision without executing it.';
|
|
6
|
+
static flags = {
|
|
7
|
+
subscription: Flags.string({ required: true }),
|
|
8
|
+
team: Flags.string({ required: true, summary: 'Verified authoring Team context' }),
|
|
9
|
+
file: Flags.string({ required: true, summary: 'ReadActionProgramRequest JSON containing the exact revisionRef' }),
|
|
10
|
+
output: localOutputFlag,
|
|
11
|
+
};
|
|
12
|
+
async run() {
|
|
13
|
+
const { flags } = await this.parse(ProgramRead);
|
|
14
|
+
await this.emit('page program read', flags.output, () => runProgramRead({ subscription: flags.subscription, team: flags.team, file: flags.file }));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../src/commands/page/program/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,YAAY;IACnD,MAAM,CAAU,WAAW,GAAG,kFAAkF,CAAC;IACjH,MAAM,CAAU,KAAK,GAAG;QACtB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC9C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;QAClF,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,gEAAgE,EAAE,CAAC;QACjH,MAAM,EAAE,eAAe;KACxB,CAAC;IACF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CACtD,cAAc,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CACzF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LocalCommand } from '../../../config/local-command.js';
|
|
2
|
+
export default class ProgramRegister extends LocalCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
subscription: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
team: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
file: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
receipt: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/commands/page/program/register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAmB,MAAM,kCAAkC,CAAC;AAGjF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY;IACvD,OAAgB,WAAW,SAA+G;IAC1I,OAAgB,KAAK;QACnB,YAAY;QACZ,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,SAAS;QACT,MAAM;MACN;IACI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAYzB;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { LocalCommand, localOutputFlag } from '../../../config/local-command.js';
|
|
3
|
+
import { runProgramRegister } from '../../../declarative/program.js';
|
|
4
|
+
export default class ProgramRegister extends LocalCommand {
|
|
5
|
+
static description = 'Prepare and register an exact ActionProgram artifact, retaining a durable receipt for read-only recovery.';
|
|
6
|
+
static flags = {
|
|
7
|
+
subscription: Flags.string({ required: true }),
|
|
8
|
+
team: Flags.string({ required: true, summary: 'Verified authoring Team context' }),
|
|
9
|
+
file: Flags.string({ required: true, summary: 'PrepareActionProgramRequest JSON with artifact and inspected expectedVersion' }),
|
|
10
|
+
receipt: Flags.string({ required: true, summary: 'Private receipt path; existing receipts trigger readback only' }),
|
|
11
|
+
'dry-run': Flags.boolean({ default: false, summary: 'Validate the exact candidate with the server without registration' }),
|
|
12
|
+
output: localOutputFlag,
|
|
13
|
+
};
|
|
14
|
+
async run() {
|
|
15
|
+
const { flags } = await this.parse(ProgramRegister);
|
|
16
|
+
await this.emit('page program register', flags.output, () => runProgramRegister({
|
|
17
|
+
subscription: flags.subscription,
|
|
18
|
+
team: flags.team,
|
|
19
|
+
file: flags.file,
|
|
20
|
+
receipt: flags.receipt,
|
|
21
|
+
dryRun: flags['dry-run'],
|
|
22
|
+
yes: flags.yes,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../src/commands/page/program/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY;IACvD,MAAM,CAAU,WAAW,GAAG,2GAA2G,CAAC;IAC1I,MAAM,CAAU,KAAK,GAAG;QACtB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC9C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;QAClF,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,8EAA8E,EAAE,CAAC;QAC/H,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,+DAA+D,EAAE,CAAC;QACnH,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,mEAAmE,EAAE,CAAC;QAC1H,MAAM,EAAE,eAAe;KACxB,CAAC;IACF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACpD,MAAM,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CAC1D,kBAAkB,CAAC;YACjB,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;YACxB,GAAG,EAAE,KAAK,CAAC,GAAG;SACf,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
import { type SemanticRuntime } from '../semantic/runtime.js';
|
|
2
|
+
type Options = {
|
|
3
|
+
subscription: string;
|
|
4
|
+
team: string;
|
|
5
|
+
file: string;
|
|
6
|
+
receipt: string;
|
|
7
|
+
dryRun: boolean;
|
|
8
|
+
yes: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare class ProgramClient {
|
|
11
|
+
readonly runtime: SemanticRuntime;
|
|
12
|
+
constructor(runtime: SemanticRuntime);
|
|
13
|
+
private call;
|
|
14
|
+
prepare(input: unknown): Promise<{
|
|
15
|
+
revisionRef: {
|
|
16
|
+
revision: number;
|
|
17
|
+
schemaVersion: number;
|
|
18
|
+
contentHash: string;
|
|
19
|
+
kind: string;
|
|
20
|
+
id: string;
|
|
21
|
+
ownerRepo: string;
|
|
22
|
+
visibility: "global" | "public" | "tenant";
|
|
23
|
+
tenantScope?: {
|
|
24
|
+
tenantRef: {
|
|
25
|
+
kind: string;
|
|
26
|
+
id: string;
|
|
27
|
+
ownerRepo: string;
|
|
28
|
+
};
|
|
29
|
+
dataSpaceRef: {
|
|
30
|
+
kind: string;
|
|
31
|
+
id: string;
|
|
32
|
+
ownerRepo: string;
|
|
33
|
+
};
|
|
34
|
+
teamRef?: {
|
|
35
|
+
kind: string;
|
|
36
|
+
id: string;
|
|
37
|
+
ownerRepo: string;
|
|
38
|
+
} | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
};
|
|
41
|
+
planHash: string;
|
|
42
|
+
}>;
|
|
43
|
+
register(input: unknown): Promise<{
|
|
44
|
+
revisionRef: {
|
|
45
|
+
revision: number;
|
|
46
|
+
schemaVersion: number;
|
|
47
|
+
contentHash: string;
|
|
48
|
+
kind: string;
|
|
49
|
+
id: string;
|
|
50
|
+
ownerRepo: string;
|
|
51
|
+
visibility: "global" | "public" | "tenant";
|
|
52
|
+
tenantScope?: {
|
|
53
|
+
tenantRef: {
|
|
54
|
+
kind: string;
|
|
55
|
+
id: string;
|
|
56
|
+
ownerRepo: string;
|
|
57
|
+
};
|
|
58
|
+
dataSpaceRef: {
|
|
59
|
+
kind: string;
|
|
60
|
+
id: string;
|
|
61
|
+
ownerRepo: string;
|
|
62
|
+
};
|
|
63
|
+
teamRef?: {
|
|
64
|
+
kind: string;
|
|
65
|
+
id: string;
|
|
66
|
+
ownerRepo: string;
|
|
67
|
+
} | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
};
|
|
70
|
+
}>;
|
|
71
|
+
read(input: unknown): Promise<{
|
|
72
|
+
definition: {
|
|
73
|
+
contract: "ActionProgramDefinition";
|
|
74
|
+
schemaVersion: 1;
|
|
75
|
+
programId: string;
|
|
76
|
+
ownerRepo: string;
|
|
77
|
+
tenantScope: {
|
|
78
|
+
tenantRef: {
|
|
79
|
+
kind: string;
|
|
80
|
+
id: string;
|
|
81
|
+
ownerRepo: string;
|
|
82
|
+
};
|
|
83
|
+
dataSpaceRef: {
|
|
84
|
+
kind: string;
|
|
85
|
+
id: string;
|
|
86
|
+
ownerRepo: string;
|
|
87
|
+
};
|
|
88
|
+
teamRef?: {
|
|
89
|
+
kind: string;
|
|
90
|
+
id: string;
|
|
91
|
+
ownerRepo: string;
|
|
92
|
+
} | undefined;
|
|
93
|
+
};
|
|
94
|
+
supportedSurface: "studio";
|
|
95
|
+
inputSchemaRevisionRef: {
|
|
96
|
+
revision: number;
|
|
97
|
+
schemaVersion: number;
|
|
98
|
+
contentHash: string;
|
|
99
|
+
kind: string;
|
|
100
|
+
id: string;
|
|
101
|
+
ownerRepo: string;
|
|
102
|
+
visibility: "global" | "public" | "tenant";
|
|
103
|
+
tenantScope?: {
|
|
104
|
+
tenantRef: {
|
|
105
|
+
kind: string;
|
|
106
|
+
id: string;
|
|
107
|
+
ownerRepo: string;
|
|
108
|
+
};
|
|
109
|
+
dataSpaceRef: {
|
|
110
|
+
kind: string;
|
|
111
|
+
id: string;
|
|
112
|
+
ownerRepo: string;
|
|
113
|
+
};
|
|
114
|
+
teamRef?: {
|
|
115
|
+
kind: string;
|
|
116
|
+
id: string;
|
|
117
|
+
ownerRepo: string;
|
|
118
|
+
} | undefined;
|
|
119
|
+
} | undefined;
|
|
120
|
+
};
|
|
121
|
+
resultSchemaRevisionRef: {
|
|
122
|
+
revision: number;
|
|
123
|
+
schemaVersion: number;
|
|
124
|
+
contentHash: string;
|
|
125
|
+
kind: string;
|
|
126
|
+
id: string;
|
|
127
|
+
ownerRepo: string;
|
|
128
|
+
visibility: "global" | "public" | "tenant";
|
|
129
|
+
tenantScope?: {
|
|
130
|
+
tenantRef: {
|
|
131
|
+
kind: string;
|
|
132
|
+
id: string;
|
|
133
|
+
ownerRepo: string;
|
|
134
|
+
};
|
|
135
|
+
dataSpaceRef: {
|
|
136
|
+
kind: string;
|
|
137
|
+
id: string;
|
|
138
|
+
ownerRepo: string;
|
|
139
|
+
};
|
|
140
|
+
teamRef?: {
|
|
141
|
+
kind: string;
|
|
142
|
+
id: string;
|
|
143
|
+
ownerRepo: string;
|
|
144
|
+
} | undefined;
|
|
145
|
+
} | undefined;
|
|
146
|
+
};
|
|
147
|
+
entry: "main";
|
|
148
|
+
abi: "monkeys.action-program/2";
|
|
149
|
+
compiler: string;
|
|
150
|
+
target: "browser-worker-es2020";
|
|
151
|
+
sourceHash: string;
|
|
152
|
+
compiledHash: string;
|
|
153
|
+
sourceMapHash: string;
|
|
154
|
+
dependencies: {
|
|
155
|
+
kind: "command" | "query";
|
|
156
|
+
revisionRef: {
|
|
157
|
+
revision: number;
|
|
158
|
+
schemaVersion: number;
|
|
159
|
+
contentHash: string;
|
|
160
|
+
kind: string;
|
|
161
|
+
id: string;
|
|
162
|
+
ownerRepo: string;
|
|
163
|
+
visibility: "global" | "public" | "tenant";
|
|
164
|
+
tenantScope?: {
|
|
165
|
+
tenantRef: {
|
|
166
|
+
kind: string;
|
|
167
|
+
id: string;
|
|
168
|
+
ownerRepo: string;
|
|
169
|
+
};
|
|
170
|
+
dataSpaceRef: {
|
|
171
|
+
kind: string;
|
|
172
|
+
id: string;
|
|
173
|
+
ownerRepo: string;
|
|
174
|
+
};
|
|
175
|
+
teamRef?: {
|
|
176
|
+
kind: string;
|
|
177
|
+
id: string;
|
|
178
|
+
ownerRepo: string;
|
|
179
|
+
} | undefined;
|
|
180
|
+
} | undefined;
|
|
181
|
+
};
|
|
182
|
+
inputSchemaRevisionRef: {
|
|
183
|
+
revision: number;
|
|
184
|
+
schemaVersion: number;
|
|
185
|
+
contentHash: string;
|
|
186
|
+
kind: string;
|
|
187
|
+
id: string;
|
|
188
|
+
ownerRepo: string;
|
|
189
|
+
visibility: "global" | "public" | "tenant";
|
|
190
|
+
tenantScope?: {
|
|
191
|
+
tenantRef: {
|
|
192
|
+
kind: string;
|
|
193
|
+
id: string;
|
|
194
|
+
ownerRepo: string;
|
|
195
|
+
};
|
|
196
|
+
dataSpaceRef: {
|
|
197
|
+
kind: string;
|
|
198
|
+
id: string;
|
|
199
|
+
ownerRepo: string;
|
|
200
|
+
};
|
|
201
|
+
teamRef?: {
|
|
202
|
+
kind: string;
|
|
203
|
+
id: string;
|
|
204
|
+
ownerRepo: string;
|
|
205
|
+
} | undefined;
|
|
206
|
+
} | undefined;
|
|
207
|
+
};
|
|
208
|
+
resultSchemaRevisionRef: {
|
|
209
|
+
revision: number;
|
|
210
|
+
schemaVersion: number;
|
|
211
|
+
contentHash: string;
|
|
212
|
+
kind: string;
|
|
213
|
+
id: string;
|
|
214
|
+
ownerRepo: string;
|
|
215
|
+
visibility: "global" | "public" | "tenant";
|
|
216
|
+
tenantScope?: {
|
|
217
|
+
tenantRef: {
|
|
218
|
+
kind: string;
|
|
219
|
+
id: string;
|
|
220
|
+
ownerRepo: string;
|
|
221
|
+
};
|
|
222
|
+
dataSpaceRef: {
|
|
223
|
+
kind: string;
|
|
224
|
+
id: string;
|
|
225
|
+
ownerRepo: string;
|
|
226
|
+
};
|
|
227
|
+
teamRef?: {
|
|
228
|
+
kind: string;
|
|
229
|
+
id: string;
|
|
230
|
+
ownerRepo: string;
|
|
231
|
+
} | undefined;
|
|
232
|
+
} | undefined;
|
|
233
|
+
};
|
|
234
|
+
download?: {
|
|
235
|
+
kind: "native";
|
|
236
|
+
} | {
|
|
237
|
+
kind: "text-artifact";
|
|
238
|
+
fileNamePath: string[];
|
|
239
|
+
mimeTypePath: string[];
|
|
240
|
+
contentPath: string[];
|
|
241
|
+
maxBytes: number;
|
|
242
|
+
} | undefined;
|
|
243
|
+
dynamicInputKeys: string[];
|
|
244
|
+
}[];
|
|
245
|
+
effects: ("download" | "form" | "refresh" | "state.get" | "state.set" | "toast")[];
|
|
246
|
+
refreshAliases: string[];
|
|
247
|
+
stateAliases: {
|
|
248
|
+
alias: string;
|
|
249
|
+
schemaRevisionRef: {
|
|
250
|
+
revision: number;
|
|
251
|
+
schemaVersion: number;
|
|
252
|
+
contentHash: string;
|
|
253
|
+
kind: string;
|
|
254
|
+
id: string;
|
|
255
|
+
ownerRepo: string;
|
|
256
|
+
visibility: "global" | "public" | "tenant";
|
|
257
|
+
tenantScope?: {
|
|
258
|
+
tenantRef: {
|
|
259
|
+
kind: string;
|
|
260
|
+
id: string;
|
|
261
|
+
ownerRepo: string;
|
|
262
|
+
};
|
|
263
|
+
dataSpaceRef: {
|
|
264
|
+
kind: string;
|
|
265
|
+
id: string;
|
|
266
|
+
ownerRepo: string;
|
|
267
|
+
};
|
|
268
|
+
teamRef?: {
|
|
269
|
+
kind: string;
|
|
270
|
+
id: string;
|
|
271
|
+
ownerRepo: string;
|
|
272
|
+
} | undefined;
|
|
273
|
+
} | undefined;
|
|
274
|
+
};
|
|
275
|
+
}[];
|
|
276
|
+
budgets: {
|
|
277
|
+
rpcMs: number;
|
|
278
|
+
concurrentCalls: number;
|
|
279
|
+
calls: number;
|
|
280
|
+
messageBytes: number;
|
|
281
|
+
activeMs: number;
|
|
282
|
+
formMs: number;
|
|
283
|
+
wallMs: number;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
javascript: string;
|
|
287
|
+
sourceMap: string;
|
|
288
|
+
}>;
|
|
289
|
+
}
|
|
290
|
+
export declare function runProgramRead(options: Pick<Options, 'subscription' | 'team' | 'file'>, supplied?: ProgramClient): Promise<{
|
|
291
|
+
subscription: string;
|
|
292
|
+
contextFingerprint: string;
|
|
293
|
+
revisionRef: {
|
|
294
|
+
revision: number;
|
|
295
|
+
schemaVersion: number;
|
|
296
|
+
contentHash: string;
|
|
297
|
+
kind: string;
|
|
298
|
+
id: string;
|
|
299
|
+
ownerRepo: string;
|
|
300
|
+
visibility: "global" | "public" | "tenant";
|
|
301
|
+
tenantScope?: {
|
|
302
|
+
tenantRef: {
|
|
303
|
+
kind: string;
|
|
304
|
+
id: string;
|
|
305
|
+
ownerRepo: string;
|
|
306
|
+
};
|
|
307
|
+
dataSpaceRef: {
|
|
308
|
+
kind: string;
|
|
309
|
+
id: string;
|
|
310
|
+
ownerRepo: string;
|
|
311
|
+
};
|
|
312
|
+
teamRef?: {
|
|
313
|
+
kind: string;
|
|
314
|
+
id: string;
|
|
315
|
+
ownerRepo: string;
|
|
316
|
+
} | undefined;
|
|
317
|
+
} | undefined;
|
|
318
|
+
};
|
|
319
|
+
artifact: {
|
|
320
|
+
definition: {
|
|
321
|
+
contract: "ActionProgramDefinition";
|
|
322
|
+
schemaVersion: 1;
|
|
323
|
+
programId: string;
|
|
324
|
+
ownerRepo: string;
|
|
325
|
+
tenantScope: {
|
|
326
|
+
tenantRef: {
|
|
327
|
+
kind: string;
|
|
328
|
+
id: string;
|
|
329
|
+
ownerRepo: string;
|
|
330
|
+
};
|
|
331
|
+
dataSpaceRef: {
|
|
332
|
+
kind: string;
|
|
333
|
+
id: string;
|
|
334
|
+
ownerRepo: string;
|
|
335
|
+
};
|
|
336
|
+
teamRef?: {
|
|
337
|
+
kind: string;
|
|
338
|
+
id: string;
|
|
339
|
+
ownerRepo: string;
|
|
340
|
+
} | undefined;
|
|
341
|
+
};
|
|
342
|
+
supportedSurface: "studio";
|
|
343
|
+
inputSchemaRevisionRef: {
|
|
344
|
+
revision: number;
|
|
345
|
+
schemaVersion: number;
|
|
346
|
+
contentHash: string;
|
|
347
|
+
kind: string;
|
|
348
|
+
id: string;
|
|
349
|
+
ownerRepo: string;
|
|
350
|
+
visibility: "global" | "public" | "tenant";
|
|
351
|
+
tenantScope?: {
|
|
352
|
+
tenantRef: {
|
|
353
|
+
kind: string;
|
|
354
|
+
id: string;
|
|
355
|
+
ownerRepo: string;
|
|
356
|
+
};
|
|
357
|
+
dataSpaceRef: {
|
|
358
|
+
kind: string;
|
|
359
|
+
id: string;
|
|
360
|
+
ownerRepo: string;
|
|
361
|
+
};
|
|
362
|
+
teamRef?: {
|
|
363
|
+
kind: string;
|
|
364
|
+
id: string;
|
|
365
|
+
ownerRepo: string;
|
|
366
|
+
} | undefined;
|
|
367
|
+
} | undefined;
|
|
368
|
+
};
|
|
369
|
+
resultSchemaRevisionRef: {
|
|
370
|
+
revision: number;
|
|
371
|
+
schemaVersion: number;
|
|
372
|
+
contentHash: string;
|
|
373
|
+
kind: string;
|
|
374
|
+
id: string;
|
|
375
|
+
ownerRepo: string;
|
|
376
|
+
visibility: "global" | "public" | "tenant";
|
|
377
|
+
tenantScope?: {
|
|
378
|
+
tenantRef: {
|
|
379
|
+
kind: string;
|
|
380
|
+
id: string;
|
|
381
|
+
ownerRepo: string;
|
|
382
|
+
};
|
|
383
|
+
dataSpaceRef: {
|
|
384
|
+
kind: string;
|
|
385
|
+
id: string;
|
|
386
|
+
ownerRepo: string;
|
|
387
|
+
};
|
|
388
|
+
teamRef?: {
|
|
389
|
+
kind: string;
|
|
390
|
+
id: string;
|
|
391
|
+
ownerRepo: string;
|
|
392
|
+
} | undefined;
|
|
393
|
+
} | undefined;
|
|
394
|
+
};
|
|
395
|
+
entry: "main";
|
|
396
|
+
abi: "monkeys.action-program/2";
|
|
397
|
+
compiler: string;
|
|
398
|
+
target: "browser-worker-es2020";
|
|
399
|
+
sourceHash: string;
|
|
400
|
+
compiledHash: string;
|
|
401
|
+
sourceMapHash: string;
|
|
402
|
+
dependencies: {
|
|
403
|
+
kind: "command" | "query";
|
|
404
|
+
revisionRef: {
|
|
405
|
+
revision: number;
|
|
406
|
+
schemaVersion: number;
|
|
407
|
+
contentHash: string;
|
|
408
|
+
kind: string;
|
|
409
|
+
id: string;
|
|
410
|
+
ownerRepo: string;
|
|
411
|
+
visibility: "global" | "public" | "tenant";
|
|
412
|
+
tenantScope?: {
|
|
413
|
+
tenantRef: {
|
|
414
|
+
kind: string;
|
|
415
|
+
id: string;
|
|
416
|
+
ownerRepo: string;
|
|
417
|
+
};
|
|
418
|
+
dataSpaceRef: {
|
|
419
|
+
kind: string;
|
|
420
|
+
id: string;
|
|
421
|
+
ownerRepo: string;
|
|
422
|
+
};
|
|
423
|
+
teamRef?: {
|
|
424
|
+
kind: string;
|
|
425
|
+
id: string;
|
|
426
|
+
ownerRepo: string;
|
|
427
|
+
} | undefined;
|
|
428
|
+
} | undefined;
|
|
429
|
+
};
|
|
430
|
+
inputSchemaRevisionRef: {
|
|
431
|
+
revision: number;
|
|
432
|
+
schemaVersion: number;
|
|
433
|
+
contentHash: string;
|
|
434
|
+
kind: string;
|
|
435
|
+
id: string;
|
|
436
|
+
ownerRepo: string;
|
|
437
|
+
visibility: "global" | "public" | "tenant";
|
|
438
|
+
tenantScope?: {
|
|
439
|
+
tenantRef: {
|
|
440
|
+
kind: string;
|
|
441
|
+
id: string;
|
|
442
|
+
ownerRepo: string;
|
|
443
|
+
};
|
|
444
|
+
dataSpaceRef: {
|
|
445
|
+
kind: string;
|
|
446
|
+
id: string;
|
|
447
|
+
ownerRepo: string;
|
|
448
|
+
};
|
|
449
|
+
teamRef?: {
|
|
450
|
+
kind: string;
|
|
451
|
+
id: string;
|
|
452
|
+
ownerRepo: string;
|
|
453
|
+
} | undefined;
|
|
454
|
+
} | undefined;
|
|
455
|
+
};
|
|
456
|
+
resultSchemaRevisionRef: {
|
|
457
|
+
revision: number;
|
|
458
|
+
schemaVersion: number;
|
|
459
|
+
contentHash: string;
|
|
460
|
+
kind: string;
|
|
461
|
+
id: string;
|
|
462
|
+
ownerRepo: string;
|
|
463
|
+
visibility: "global" | "public" | "tenant";
|
|
464
|
+
tenantScope?: {
|
|
465
|
+
tenantRef: {
|
|
466
|
+
kind: string;
|
|
467
|
+
id: string;
|
|
468
|
+
ownerRepo: string;
|
|
469
|
+
};
|
|
470
|
+
dataSpaceRef: {
|
|
471
|
+
kind: string;
|
|
472
|
+
id: string;
|
|
473
|
+
ownerRepo: string;
|
|
474
|
+
};
|
|
475
|
+
teamRef?: {
|
|
476
|
+
kind: string;
|
|
477
|
+
id: string;
|
|
478
|
+
ownerRepo: string;
|
|
479
|
+
} | undefined;
|
|
480
|
+
} | undefined;
|
|
481
|
+
};
|
|
482
|
+
download?: {
|
|
483
|
+
kind: "native";
|
|
484
|
+
} | {
|
|
485
|
+
kind: "text-artifact";
|
|
486
|
+
fileNamePath: string[];
|
|
487
|
+
mimeTypePath: string[];
|
|
488
|
+
contentPath: string[];
|
|
489
|
+
maxBytes: number;
|
|
490
|
+
} | undefined;
|
|
491
|
+
dynamicInputKeys: string[];
|
|
492
|
+
}[];
|
|
493
|
+
effects: ("download" | "form" | "refresh" | "state.get" | "state.set" | "toast")[];
|
|
494
|
+
refreshAliases: string[];
|
|
495
|
+
stateAliases: {
|
|
496
|
+
alias: string;
|
|
497
|
+
schemaRevisionRef: {
|
|
498
|
+
revision: number;
|
|
499
|
+
schemaVersion: number;
|
|
500
|
+
contentHash: string;
|
|
501
|
+
kind: string;
|
|
502
|
+
id: string;
|
|
503
|
+
ownerRepo: string;
|
|
504
|
+
visibility: "global" | "public" | "tenant";
|
|
505
|
+
tenantScope?: {
|
|
506
|
+
tenantRef: {
|
|
507
|
+
kind: string;
|
|
508
|
+
id: string;
|
|
509
|
+
ownerRepo: string;
|
|
510
|
+
};
|
|
511
|
+
dataSpaceRef: {
|
|
512
|
+
kind: string;
|
|
513
|
+
id: string;
|
|
514
|
+
ownerRepo: string;
|
|
515
|
+
};
|
|
516
|
+
teamRef?: {
|
|
517
|
+
kind: string;
|
|
518
|
+
id: string;
|
|
519
|
+
ownerRepo: string;
|
|
520
|
+
} | undefined;
|
|
521
|
+
} | undefined;
|
|
522
|
+
};
|
|
523
|
+
}[];
|
|
524
|
+
budgets: {
|
|
525
|
+
rpcMs: number;
|
|
526
|
+
concurrentCalls: number;
|
|
527
|
+
calls: number;
|
|
528
|
+
messageBytes: number;
|
|
529
|
+
activeMs: number;
|
|
530
|
+
formMs: number;
|
|
531
|
+
wallMs: number;
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
javascript: string;
|
|
535
|
+
sourceMap: string;
|
|
536
|
+
};
|
|
537
|
+
verified: boolean;
|
|
538
|
+
}>;
|
|
539
|
+
export declare function runProgramRegister(options: Options, supplied?: ProgramClient): Promise<{
|
|
540
|
+
subscription: string;
|
|
541
|
+
baseUrl: string;
|
|
542
|
+
contextFingerprint: string;
|
|
543
|
+
revisionRef: {
|
|
544
|
+
revision: number;
|
|
545
|
+
schemaVersion: number;
|
|
546
|
+
contentHash: string;
|
|
547
|
+
kind: string;
|
|
548
|
+
id: string;
|
|
549
|
+
ownerRepo: string;
|
|
550
|
+
visibility: "global" | "public" | "tenant";
|
|
551
|
+
tenantScope?: {
|
|
552
|
+
tenantRef: {
|
|
553
|
+
kind: string;
|
|
554
|
+
id: string;
|
|
555
|
+
ownerRepo: string;
|
|
556
|
+
};
|
|
557
|
+
dataSpaceRef: {
|
|
558
|
+
kind: string;
|
|
559
|
+
id: string;
|
|
560
|
+
ownerRepo: string;
|
|
561
|
+
};
|
|
562
|
+
teamRef?: {
|
|
563
|
+
kind: string;
|
|
564
|
+
id: string;
|
|
565
|
+
ownerRepo: string;
|
|
566
|
+
} | undefined;
|
|
567
|
+
} | undefined;
|
|
568
|
+
};
|
|
569
|
+
dryRun: boolean;
|
|
570
|
+
recoveryOnly: boolean;
|
|
571
|
+
verified: boolean;
|
|
572
|
+
} | {
|
|
573
|
+
subscription: string;
|
|
574
|
+
baseUrl: string;
|
|
575
|
+
contextFingerprint: string;
|
|
576
|
+
revisionRef: {
|
|
577
|
+
revision: number;
|
|
578
|
+
schemaVersion: number;
|
|
579
|
+
contentHash: string;
|
|
580
|
+
kind: string;
|
|
581
|
+
id: string;
|
|
582
|
+
ownerRepo: string;
|
|
583
|
+
visibility: "global" | "public" | "tenant";
|
|
584
|
+
tenantScope?: {
|
|
585
|
+
tenantRef: {
|
|
586
|
+
kind: string;
|
|
587
|
+
id: string;
|
|
588
|
+
ownerRepo: string;
|
|
589
|
+
};
|
|
590
|
+
dataSpaceRef: {
|
|
591
|
+
kind: string;
|
|
592
|
+
id: string;
|
|
593
|
+
ownerRepo: string;
|
|
594
|
+
};
|
|
595
|
+
teamRef?: {
|
|
596
|
+
kind: string;
|
|
597
|
+
id: string;
|
|
598
|
+
ownerRepo: string;
|
|
599
|
+
} | undefined;
|
|
600
|
+
} | undefined;
|
|
601
|
+
};
|
|
602
|
+
dryRun: boolean;
|
|
603
|
+
planHash: string;
|
|
604
|
+
validationCoverage: string;
|
|
605
|
+
} | {
|
|
606
|
+
subscription: string;
|
|
607
|
+
baseUrl: string;
|
|
608
|
+
contextFingerprint: string;
|
|
609
|
+
revisionRef: {
|
|
610
|
+
revision: number;
|
|
611
|
+
schemaVersion: number;
|
|
612
|
+
contentHash: string;
|
|
613
|
+
kind: string;
|
|
614
|
+
id: string;
|
|
615
|
+
ownerRepo: string;
|
|
616
|
+
visibility: "global" | "public" | "tenant";
|
|
617
|
+
tenantScope?: {
|
|
618
|
+
tenantRef: {
|
|
619
|
+
kind: string;
|
|
620
|
+
id: string;
|
|
621
|
+
ownerRepo: string;
|
|
622
|
+
};
|
|
623
|
+
dataSpaceRef: {
|
|
624
|
+
kind: string;
|
|
625
|
+
id: string;
|
|
626
|
+
ownerRepo: string;
|
|
627
|
+
};
|
|
628
|
+
teamRef?: {
|
|
629
|
+
kind: string;
|
|
630
|
+
id: string;
|
|
631
|
+
ownerRepo: string;
|
|
632
|
+
} | undefined;
|
|
633
|
+
} | undefined;
|
|
634
|
+
};
|
|
635
|
+
dryRun: boolean;
|
|
636
|
+
verified: boolean;
|
|
637
|
+
}>;
|
|
638
|
+
export {};
|
|
639
|
+
//# sourceMappingURL=program.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/declarative/program.ts"],"names":[],"mappings":"AAYA,OAAO,EAA+E,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAY3I,KAAK,OAAO,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,CAAC;AAMpH,qBAAa,aAAa;IACZ,QAAQ,CAAC,OAAO,EAAE,eAAe;IAA7C,YAAqB,OAAO,EAAE,eAAe,EAAI;YAEnC,IAAI;IA4ClB,OAAO,CAAC,KAAK,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAErB;IACD,QAAQ,CAAC,KAAK,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;OAEtB;IACD,IAAI,CAAC,KAAK,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAElB;CACF;AAUD,wBAAsB,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,QAAQ,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqBtH;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4ElF"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { open, readFile } from 'node:fs/promises';
|
|
2
|
+
import { ActionProgramArtifactSchema, PrepareActionProgramRequestSchema, RegisterActionProgramRequestSchema, ReadActionProgramRequestSchema, RevisionRefSchema, } from '@inf-monkeys-tech/monkeys/contracts';
|
|
3
|
+
import { canonicalContentHash as hash } from '@inf-monkeys-tech/monkeys/runtime';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { CliError, EXIT_CODES } from '../errors/cli-error.js';
|
|
6
|
+
import { assertConfirmation } from '../policy/risk.js';
|
|
7
|
+
import { loadSemanticRuntime, requireSemanticTeam, requestSemantic, unwrapServerData } from '../semantic/runtime.js';
|
|
8
|
+
const refSchema = z.unknown().transform((value) => RevisionRefSchema.parse(value));
|
|
9
|
+
const registrationSchema = z.object({ revisionRef: refSchema });
|
|
10
|
+
const preparedSchema = registrationSchema.extend({ planHash: z.string().regex(/^[a-f0-9]{64}$/) });
|
|
11
|
+
const receiptSchema = z.object({
|
|
12
|
+
state: z.literal('pending'),
|
|
13
|
+
contextFingerprint: z.string(),
|
|
14
|
+
candidateHash: z.string(),
|
|
15
|
+
revisionRef: refSchema,
|
|
16
|
+
});
|
|
17
|
+
function fail(code, message) {
|
|
18
|
+
throw new CliError(message, { code, exitCode: EXIT_CODES.validation });
|
|
19
|
+
}
|
|
20
|
+
export class ProgramClient {
|
|
21
|
+
runtime;
|
|
22
|
+
constructor(runtime) {
|
|
23
|
+
this.runtime = runtime;
|
|
24
|
+
}
|
|
25
|
+
async call(action, body, schema) {
|
|
26
|
+
const write = action === 'register';
|
|
27
|
+
try {
|
|
28
|
+
const result = await requestSemantic(this.runtime, {
|
|
29
|
+
id: `declarative.program.${action}`,
|
|
30
|
+
command: ['page', 'program', action === 'prepare' ? 'register' : action],
|
|
31
|
+
risk: write ? 'privileged' : 'read',
|
|
32
|
+
apiBindings: [
|
|
33
|
+
{
|
|
34
|
+
adapter: 'action-program-v1',
|
|
35
|
+
legacyBuiltinContract: true,
|
|
36
|
+
method: 'POST',
|
|
37
|
+
pathTemplate: `/api/declarative-control/authoring/programs/${action}`,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
}, { body });
|
|
41
|
+
try {
|
|
42
|
+
return schema.parse(unwrapServerData(result.response.data));
|
|
43
|
+
}
|
|
44
|
+
catch (cause) {
|
|
45
|
+
throw new CliError('The program response could not be verified. Retain the receipt and read the exact revision before retrying.', {
|
|
46
|
+
cause,
|
|
47
|
+
code: write ? 'MUTATION_OUTCOME_UNKNOWN' : 'PROGRAM_RESPONSE_INCOMPATIBLE',
|
|
48
|
+
exitCode: EXIT_CODES.compatibility,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (cause) {
|
|
53
|
+
if (write &&
|
|
54
|
+
cause instanceof CliError &&
|
|
55
|
+
(['NETWORK_ERROR', 'REQUEST_TIMEOUT', 'REQUEST_ABORTED'].includes(cause.code) || /^HTTP_5/.test(cause.code)))
|
|
56
|
+
throw new CliError('Program registration outcome is unknown. Reuse the receipt to perform readback only.', {
|
|
57
|
+
cause,
|
|
58
|
+
code: 'MUTATION_OUTCOME_UNKNOWN',
|
|
59
|
+
exitCode: EXIT_CODES.network,
|
|
60
|
+
});
|
|
61
|
+
throw cause;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
prepare(input) {
|
|
65
|
+
return this.call('prepare', PrepareActionProgramRequestSchema.parse(input), preparedSchema);
|
|
66
|
+
}
|
|
67
|
+
register(input) {
|
|
68
|
+
return this.call('register', RegisterActionProgramRequestSchema.parse(input), registrationSchema);
|
|
69
|
+
}
|
|
70
|
+
read(input) {
|
|
71
|
+
return this.call('read', ReadActionProgramRequestSchema.parse(input), ActionProgramArtifactSchema);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function clientFor(options, supplied) {
|
|
75
|
+
const client = supplied ??
|
|
76
|
+
new ProgramClient(await loadSemanticRuntime({ subscription: options.subscription, team: options.team, inheritDefaultTeam: false }));
|
|
77
|
+
requireSemanticTeam(client.runtime, 'page program');
|
|
78
|
+
return client;
|
|
79
|
+
}
|
|
80
|
+
export async function runProgramRead(options, supplied) {
|
|
81
|
+
const input = ReadActionProgramRequestSchema.parse(JSON.parse(await readFile(options.file, 'utf8')));
|
|
82
|
+
const client = await clientFor(options, supplied);
|
|
83
|
+
const artifact = await client.read(input);
|
|
84
|
+
if (input.revisionRef.kind !== 'action-program' ||
|
|
85
|
+
input.revisionRef.id !== artifact.definition.programId ||
|
|
86
|
+
input.revisionRef.ownerRepo !== artifact.definition.ownerRepo ||
|
|
87
|
+
hash(input.revisionRef.tenantScope) !== hash(artifact.definition.tenantScope) ||
|
|
88
|
+
input.revisionRef.contentHash !== hash(artifact.definition) ||
|
|
89
|
+
hash(artifact.javascript) !== artifact.definition.compiledHash ||
|
|
90
|
+
hash(artifact.sourceMap) !== artifact.definition.sourceMapHash)
|
|
91
|
+
fail('PROGRAM_READBACK_MISMATCH', 'The returned program does not match the exact requested revision.');
|
|
92
|
+
return {
|
|
93
|
+
subscription: client.runtime.context.subscription,
|
|
94
|
+
contextFingerprint: client.runtime.context.fingerprint,
|
|
95
|
+
revisionRef: input.revisionRef,
|
|
96
|
+
artifact,
|
|
97
|
+
verified: true,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export async function runProgramRegister(options, supplied) {
|
|
101
|
+
const candidate = PrepareActionProgramRequestSchema.parse(JSON.parse(await readFile(options.file, 'utf8')));
|
|
102
|
+
const { artifact, expectedVersion } = candidate;
|
|
103
|
+
if (hash(artifact.javascript) !== artifact.definition.compiledHash || hash(artifact.sourceMap) !== artifact.definition.sourceMapHash)
|
|
104
|
+
fail('PROGRAM_ARTIFACT_HASH_MISMATCH', 'The artifact code or source map does not match its definition.');
|
|
105
|
+
const client = await clientFor(options, supplied);
|
|
106
|
+
const revisionRef = RevisionRefSchema.parse({
|
|
107
|
+
kind: 'action-program',
|
|
108
|
+
id: artifact.definition.programId,
|
|
109
|
+
ownerRepo: artifact.definition.ownerRepo,
|
|
110
|
+
visibility: 'tenant',
|
|
111
|
+
tenantScope: artifact.definition.tenantScope,
|
|
112
|
+
revision: expectedVersion + 1,
|
|
113
|
+
schemaVersion: 1,
|
|
114
|
+
contentHash: hash(artifact.definition),
|
|
115
|
+
});
|
|
116
|
+
const preview = {
|
|
117
|
+
subscription: client.runtime.context.subscription,
|
|
118
|
+
baseUrl: client.runtime.context.baseUrl,
|
|
119
|
+
contextFingerprint: client.runtime.context.fingerprint,
|
|
120
|
+
revisionRef,
|
|
121
|
+
dryRun: options.dryRun,
|
|
122
|
+
};
|
|
123
|
+
const receipt = {
|
|
124
|
+
state: 'pending',
|
|
125
|
+
contextFingerprint: preview.contextFingerprint,
|
|
126
|
+
candidateHash: hash(candidate),
|
|
127
|
+
revisionRef,
|
|
128
|
+
};
|
|
129
|
+
let existing;
|
|
130
|
+
try {
|
|
131
|
+
existing = JSON.parse(await readFile(options.receipt, 'utf8'));
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
if (error.code !== 'ENOENT')
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
if (existing !== undefined) {
|
|
138
|
+
const parsed = receiptSchema.safeParse(existing);
|
|
139
|
+
if (!parsed.success || hash(parsed.data) !== hash(receipt))
|
|
140
|
+
fail('PROGRAM_RECEIPT_MISMATCH', 'The receipt belongs to another context, candidate, or revision.');
|
|
141
|
+
const actual = await client.read({ revisionRef });
|
|
142
|
+
if (hash(actual) !== hash(artifact))
|
|
143
|
+
fail('PROGRAM_READBACK_MISMATCH', 'The registered artifact differs from the candidate. Retain the receipt and inspect the exact revision.');
|
|
144
|
+
return { ...preview, recoveryOnly: true, verified: true };
|
|
145
|
+
}
|
|
146
|
+
const prepared = await client.prepare(candidate);
|
|
147
|
+
const planHash = hash({ ...candidate, revisionRef });
|
|
148
|
+
if (hash(prepared.revisionRef) !== hash(revisionRef) || prepared.planHash !== planHash)
|
|
149
|
+
fail('PROGRAM_PLAN_MISMATCH', 'Preparation does not match the exact candidate and expected revision.');
|
|
150
|
+
if (options.dryRun)
|
|
151
|
+
return {
|
|
152
|
+
...preview,
|
|
153
|
+
planHash,
|
|
154
|
+
validationCoverage: 'server authority, dependency revisions, artifact hashes, and current program head',
|
|
155
|
+
};
|
|
156
|
+
assertConfirmation({ interactive: Boolean(process.stdin.isTTY), risk: 'privileged', yes: options.yes });
|
|
157
|
+
// Exclusive creation prevents concurrent registrations and recovery never resends a write.
|
|
158
|
+
const file = await open(options.receipt, 'wx', 0o600);
|
|
159
|
+
try {
|
|
160
|
+
await file.writeFile(`${JSON.stringify(receipt)}\n`);
|
|
161
|
+
await file.sync();
|
|
162
|
+
}
|
|
163
|
+
finally {
|
|
164
|
+
await file.close();
|
|
165
|
+
}
|
|
166
|
+
const registered = await client.register({ ...candidate, planHash, idempotencyKey: `program:${planHash}` });
|
|
167
|
+
if (hash(registered.revisionRef) !== hash(revisionRef))
|
|
168
|
+
fail('PROGRAM_READBACK_MISMATCH', 'Registration returned another revision. Retain the receipt and read the expected revision.');
|
|
169
|
+
const actual = await client.read({ revisionRef });
|
|
170
|
+
if (hash(actual) !== hash(artifact))
|
|
171
|
+
fail('PROGRAM_READBACK_MISMATCH', 'The registered artifact differs from the candidate. Retain the receipt and inspect the exact revision.');
|
|
172
|
+
return { ...preview, verified: true };
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/declarative/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,EAC9B,iBAAiB,GAClB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,oBAAoB,IAAI,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAwB,MAAM,wBAAwB,CAAC;AAE3I,MAAM,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACnF,MAAM,kBAAkB,GAAG,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c,EAAE,WAAW,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC5G,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC;QACpD,IAAI,CAAC,2BAA2B,EAAE,4FAA4F,CAAC,CAAC;IAClI,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;IAClD,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC;QACjC,IAAI,CACF,2BAA2B,EAC3B,wGAAwG,CACzG,CAAC;IACJ,OAAO,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/security/redact.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/security/redact.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,QAAQ,eAAe,CAAC;AAWrC,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,kBAAwB,GAAG,OAAO,CAoBtF"}
|
package/dist/security/redact.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
const SENSITIVE_KEY = /(authorization|cookie|password|secret|token|api[-_]?key|private[-_]?key)/i;
|
|
2
2
|
const SAFE_TOKEN_KEY = /^(nextPageToken|tokenUsage)$/i;
|
|
3
3
|
const BEARER_VALUE = /\bBearer\s+[A-Za-z0-9._~+/=-]+/gi;
|
|
4
|
+
function isDesignTokenReferences(key, value) {
|
|
5
|
+
if (!Array.isArray(value))
|
|
6
|
+
return false;
|
|
7
|
+
if (key === 'tokenRefs')
|
|
8
|
+
return value.every((item) => typeof item === 'string' && /^semantic\.[a-zA-Z0-9_.-]+$/.test(item));
|
|
9
|
+
return (key === 'tokenRevisionRefs' &&
|
|
10
|
+
value.every((item) => item !== null &&
|
|
11
|
+
typeof item === 'object' &&
|
|
12
|
+
item.kind === 'design-token' &&
|
|
13
|
+
typeof item.id === 'string' &&
|
|
14
|
+
typeof item.ownerRepo === 'string' &&
|
|
15
|
+
Number.isSafeInteger(item.revision) &&
|
|
16
|
+
item.revision > 0 &&
|
|
17
|
+
typeof item.contentHash === 'string' &&
|
|
18
|
+
/^[a-f0-9]{64}$/.test(item.contentHash)));
|
|
19
|
+
}
|
|
4
20
|
export const REDACTED = '[REDACTED]';
|
|
5
21
|
function redactSensitiveField(value) {
|
|
6
22
|
// Contract/status fields such as `secretRemoved: false` are not Secrets. Keep
|
|
@@ -29,7 +45,10 @@ export function redactValue(value, ancestors = new WeakSet()) {
|
|
|
29
45
|
return value.map((item) => redactValue(item, ancestors));
|
|
30
46
|
const output = {};
|
|
31
47
|
for (const [key, child] of Object.entries(value)) {
|
|
32
|
-
output[key] =
|
|
48
|
+
output[key] =
|
|
49
|
+
SENSITIVE_KEY.test(key) && !SAFE_TOKEN_KEY.test(key) && !isDesignTokenReferences(key, child)
|
|
50
|
+
? redactSensitiveField(child)
|
|
51
|
+
: redactValue(child, ancestors);
|
|
33
52
|
}
|
|
34
53
|
return output;
|
|
35
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/security/redact.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,2EAA2E,CAAC;AAClG,MAAM,cAAc,GAAG,+BAA+B,CAAC;AACvD,MAAM,YAAY,GAAG,kCAAkC,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,SAAS,oBAAoB,CAAC,KAAc;IAC1C,8EAA8E;IAC9E,yEAAyE;IACzE,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,OAAO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AC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC"}
|
package/oclif.manifest.json
CHANGED
|
@@ -16600,6 +16600,174 @@
|
|
|
16600
16600
|
],
|
|
16601
16601
|
"strict": true
|
|
16602
16602
|
},
|
|
16603
|
+
"page:program:read": {
|
|
16604
|
+
"aliases": [],
|
|
16605
|
+
"args": {},
|
|
16606
|
+
"description": "Read and verify an exact registered ActionProgram revision without executing it.",
|
|
16607
|
+
"enableJsonFlag": false,
|
|
16608
|
+
"flags": {
|
|
16609
|
+
"file": {
|
|
16610
|
+
"hasDynamicHelp": false,
|
|
16611
|
+
"multiple": false,
|
|
16612
|
+
"name": "file",
|
|
16613
|
+
"required": true,
|
|
16614
|
+
"summary": "ReadActionProgramRequest JSON containing the exact revisionRef",
|
|
16615
|
+
"type": "option"
|
|
16616
|
+
},
|
|
16617
|
+
"jq": {
|
|
16618
|
+
"char": "q",
|
|
16619
|
+
"hasDynamicHelp": false,
|
|
16620
|
+
"multiple": false,
|
|
16621
|
+
"name": "jq",
|
|
16622
|
+
"summary": "Filter the JSON result with a jq expression",
|
|
16623
|
+
"type": "option"
|
|
16624
|
+
},
|
|
16625
|
+
"output": {
|
|
16626
|
+
"default": "json",
|
|
16627
|
+
"hasDynamicHelp": false,
|
|
16628
|
+
"multiple": false,
|
|
16629
|
+
"name": "output",
|
|
16630
|
+
"options": [
|
|
16631
|
+
"json",
|
|
16632
|
+
"pretty",
|
|
16633
|
+
"table",
|
|
16634
|
+
"ndjson",
|
|
16635
|
+
"csv",
|
|
16636
|
+
"text"
|
|
16637
|
+
],
|
|
16638
|
+
"summary": "Output format",
|
|
16639
|
+
"type": "option"
|
|
16640
|
+
},
|
|
16641
|
+
"subscription": {
|
|
16642
|
+
"hasDynamicHelp": false,
|
|
16643
|
+
"multiple": false,
|
|
16644
|
+
"name": "subscription",
|
|
16645
|
+
"required": true,
|
|
16646
|
+
"type": "option"
|
|
16647
|
+
},
|
|
16648
|
+
"team": {
|
|
16649
|
+
"hasDynamicHelp": false,
|
|
16650
|
+
"multiple": false,
|
|
16651
|
+
"name": "team",
|
|
16652
|
+
"required": true,
|
|
16653
|
+
"summary": "Verified authoring Team context",
|
|
16654
|
+
"type": "option"
|
|
16655
|
+
},
|
|
16656
|
+
"yes": {
|
|
16657
|
+
"allowNo": false,
|
|
16658
|
+
"char": "y",
|
|
16659
|
+
"name": "yes",
|
|
16660
|
+
"summary": "Confirm destructive or privileged operations",
|
|
16661
|
+
"type": "boolean"
|
|
16662
|
+
}
|
|
16663
|
+
},
|
|
16664
|
+
"hasDynamicHelp": false,
|
|
16665
|
+
"hiddenAliases": [],
|
|
16666
|
+
"id": "page:program:read",
|
|
16667
|
+
"isESM": true,
|
|
16668
|
+
"pluginAlias": "@inf-monkeys-tech/monkeys-cli",
|
|
16669
|
+
"pluginName": "@inf-monkeys-tech/monkeys-cli",
|
|
16670
|
+
"pluginType": "core",
|
|
16671
|
+
"relativePath": [
|
|
16672
|
+
"dist",
|
|
16673
|
+
"commands",
|
|
16674
|
+
"page",
|
|
16675
|
+
"program",
|
|
16676
|
+
"read.js"
|
|
16677
|
+
],
|
|
16678
|
+
"strict": true
|
|
16679
|
+
},
|
|
16680
|
+
"page:program:register": {
|
|
16681
|
+
"aliases": [],
|
|
16682
|
+
"args": {},
|
|
16683
|
+
"description": "Prepare and register an exact ActionProgram artifact, retaining a durable receipt for read-only recovery.",
|
|
16684
|
+
"enableJsonFlag": false,
|
|
16685
|
+
"flags": {
|
|
16686
|
+
"dry-run": {
|
|
16687
|
+
"allowNo": false,
|
|
16688
|
+
"name": "dry-run",
|
|
16689
|
+
"summary": "Validate the exact candidate with the server without registration",
|
|
16690
|
+
"type": "boolean"
|
|
16691
|
+
},
|
|
16692
|
+
"file": {
|
|
16693
|
+
"hasDynamicHelp": false,
|
|
16694
|
+
"multiple": false,
|
|
16695
|
+
"name": "file",
|
|
16696
|
+
"required": true,
|
|
16697
|
+
"summary": "PrepareActionProgramRequest JSON with artifact and inspected expectedVersion",
|
|
16698
|
+
"type": "option"
|
|
16699
|
+
},
|
|
16700
|
+
"jq": {
|
|
16701
|
+
"char": "q",
|
|
16702
|
+
"hasDynamicHelp": false,
|
|
16703
|
+
"multiple": false,
|
|
16704
|
+
"name": "jq",
|
|
16705
|
+
"summary": "Filter the JSON result with a jq expression",
|
|
16706
|
+
"type": "option"
|
|
16707
|
+
},
|
|
16708
|
+
"output": {
|
|
16709
|
+
"default": "json",
|
|
16710
|
+
"hasDynamicHelp": false,
|
|
16711
|
+
"multiple": false,
|
|
16712
|
+
"name": "output",
|
|
16713
|
+
"options": [
|
|
16714
|
+
"json",
|
|
16715
|
+
"pretty",
|
|
16716
|
+
"table",
|
|
16717
|
+
"ndjson",
|
|
16718
|
+
"csv",
|
|
16719
|
+
"text"
|
|
16720
|
+
],
|
|
16721
|
+
"summary": "Output format",
|
|
16722
|
+
"type": "option"
|
|
16723
|
+
},
|
|
16724
|
+
"receipt": {
|
|
16725
|
+
"hasDynamicHelp": false,
|
|
16726
|
+
"multiple": false,
|
|
16727
|
+
"name": "receipt",
|
|
16728
|
+
"required": true,
|
|
16729
|
+
"summary": "Private receipt path; existing receipts trigger readback only",
|
|
16730
|
+
"type": "option"
|
|
16731
|
+
},
|
|
16732
|
+
"subscription": {
|
|
16733
|
+
"hasDynamicHelp": false,
|
|
16734
|
+
"multiple": false,
|
|
16735
|
+
"name": "subscription",
|
|
16736
|
+
"required": true,
|
|
16737
|
+
"type": "option"
|
|
16738
|
+
},
|
|
16739
|
+
"team": {
|
|
16740
|
+
"hasDynamicHelp": false,
|
|
16741
|
+
"multiple": false,
|
|
16742
|
+
"name": "team",
|
|
16743
|
+
"required": true,
|
|
16744
|
+
"summary": "Verified authoring Team context",
|
|
16745
|
+
"type": "option"
|
|
16746
|
+
},
|
|
16747
|
+
"yes": {
|
|
16748
|
+
"allowNo": false,
|
|
16749
|
+
"char": "y",
|
|
16750
|
+
"name": "yes",
|
|
16751
|
+
"summary": "Confirm destructive or privileged operations",
|
|
16752
|
+
"type": "boolean"
|
|
16753
|
+
}
|
|
16754
|
+
},
|
|
16755
|
+
"hasDynamicHelp": false,
|
|
16756
|
+
"hiddenAliases": [],
|
|
16757
|
+
"id": "page:program:register",
|
|
16758
|
+
"isESM": true,
|
|
16759
|
+
"pluginAlias": "@inf-monkeys-tech/monkeys-cli",
|
|
16760
|
+
"pluginName": "@inf-monkeys-tech/monkeys-cli",
|
|
16761
|
+
"pluginType": "core",
|
|
16762
|
+
"relativePath": [
|
|
16763
|
+
"dist",
|
|
16764
|
+
"commands",
|
|
16765
|
+
"page",
|
|
16766
|
+
"program",
|
|
16767
|
+
"register.js"
|
|
16768
|
+
],
|
|
16769
|
+
"strict": true
|
|
16770
|
+
},
|
|
16603
16771
|
"page:publish": {
|
|
16604
16772
|
"aliases": [],
|
|
16605
16773
|
"args": {
|
|
@@ -20184,5 +20352,5 @@
|
|
|
20184
20352
|
"strict": true
|
|
20185
20353
|
}
|
|
20186
20354
|
},
|
|
20187
|
-
"version": "0.12.
|
|
20355
|
+
"version": "0.12.44"
|
|
20188
20356
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inf-monkeys-tech/monkeys-cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.44",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"description": "Monkeys command-line client for AI agents, automation, and interactive use",
|
|
6
6
|
"type": "module",
|
|
@@ -150,5 +150,5 @@
|
|
|
150
150
|
"publishConfig": {
|
|
151
151
|
"access": "public"
|
|
152
152
|
},
|
|
153
|
-
"monkeysReleaseCommit": "
|
|
153
|
+
"monkeysReleaseCommit": "65a2bb4ab7b439934b7c714c215f97477939f16e"
|
|
154
154
|
}
|
|
@@ -10,7 +10,7 @@ description: 通过 monkeys CLI 选择 Subscription、Context、Team 与 Identit
|
|
|
10
10
|
## 公共执行流程
|
|
11
11
|
|
|
12
12
|
1. 同一运行首次使用时确认 CLI 版本;若运行环境已提供已校验的安装版本,直接复用,否则运行 `monkeys version show`。若 `_notice.update` 存在,只报告升级提示,得到用户授权后才运行 `monkeys update`。
|
|
13
|
-
2. 从当前运行 Context 核对 endpoint、tenant、credential kind、Surface 与 Team
|
|
13
|
+
2. 从当前运行 Context 核对 endpoint、tenant、credential kind、Surface 与 Team;缺失或变化时运行 `monkeys context show`,默认使用当前活动订阅,已确认 Team 时可加 `--team <Team ID>`。只有需要其他订阅且 `monkeys subscription list` 已返回其确切名称时,才加 `--subscription`;`studio/kernel` 是视角,不是订阅名。`context show` 不接受 `--perspective`;视角只传给支持它的 `monkeys data ...` 命令。Team 或 Identity 不明确时用 `monkeys team list`、`monkeys identity list`,禁止猜测。
|
|
14
14
|
3. 当前版本的命令合同未知或参数不确定时运行 `monkeys schema <command path>`;领域导航不明确时运行 `monkeys --help`。
|
|
15
15
|
4. 默认消费 JSON envelope:成功从 stdout 读取 `.data`,失败从 stderr 读取 `.error`,系统提示读取 `._notice`。需要窄字段时使用当前命令支持的内置 `--jq`,它不依赖外部 `jq`;解析已保存的文件才使用环境中的 JSON 工具。面向人展示时才用 `--output table|text`。错误永远不经过 `--jq`。
|
|
16
16
|
5. 写操作先核对精确 Subscription、Team、目标 ID 与风险;仅在当前命令 schema 支持时使用 `--dry-run`,不支持时按实际合同验证参数,不构造不存在的标志。只有 schema 标记需要确认时才传 `--yes`,不得自动重放结果未知的写请求。
|