@inf-monkeys-tech/monkeys-cli 0.12.54 → 0.12.56
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 +3 -1
- package/README.zh.md +3 -1
- 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/navigation/add.d.ts +22 -0
- package/dist/commands/navigation/add.d.ts.map +1 -0
- package/dist/commands/navigation/add.js +38 -0
- package/dist/commands/navigation/add.js.map +1 -0
- package/dist/context/resolver.d.ts.map +1 -1
- package/dist/context/resolver.js +10 -3
- package/dist/context/resolver.js.map +1 -1
- package/dist/declarative/add.d.ts +831 -0
- package/dist/declarative/add.d.ts.map +1 -0
- package/dist/declarative/add.js +126 -0
- package/dist/declarative/add.js.map +1 -0
- package/dist/declarative/client.d.ts +168 -3
- package/dist/declarative/client.d.ts.map +1 -1
- package/dist/declarative/client.js +30 -3
- package/dist/declarative/client.js.map +1 -1
- package/dist/declarative/lifecycle.d.ts +12 -2
- package/dist/declarative/lifecycle.d.ts.map +1 -1
- package/dist/declarative/lifecycle.js +33 -15
- package/dist/declarative/lifecycle.js.map +1 -1
- package/dist/transport/agent-data-context.d.ts +2 -0
- package/dist/transport/agent-data-context.d.ts.map +1 -1
- package/dist/transport/agent-data-context.js +14 -9
- package/dist/transport/agent-data-context.js.map +1 -1
- package/dist/transport/http-client.js +2 -2
- package/dist/transport/http-client.js.map +1 -1
- package/oclif.manifest.json +135 -1
- package/package.json +2 -2
- package/skills/monkeys-pages/SKILL.md +2 -0
- package/skills/monkeys-shared/references/runtime-files.md +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/declarative/add.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM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;;;;;;;;;;cA2BnC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA3Be,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2C5C"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { mkdtemp, rm, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { canonicalContentHash } from '@inf-monkeys-tech/monkeys/runtime';
|
|
6
|
+
import { CliError, EXIT_CODES } from '../errors/cli-error.js';
|
|
7
|
+
import { loadSemanticRuntime } from '../semantic/runtime.js';
|
|
8
|
+
import { DeclarativeClient } from './client.js';
|
|
9
|
+
import { runLifecycle } from './lifecycle.js';
|
|
10
|
+
import { publicationScope } from './verification.js';
|
|
11
|
+
const NAVIGATION_ORDER_STEP = 100;
|
|
12
|
+
// An exact Page ID search returns a handful of targets; the bound only stops a runaway catalog.
|
|
13
|
+
const MAX_TARGET_PAGES = 10;
|
|
14
|
+
function failure(message, code, details) {
|
|
15
|
+
throw new CliError(message, { code, exitCode: EXIT_CODES.validation, ...(details ? { safeDetails: details } : {}) });
|
|
16
|
+
}
|
|
17
|
+
/** Released targets of one Page on the surface, as the Server's Navigation target catalog reports them. */
|
|
18
|
+
async function releasedPageTargets(client, page, surface) {
|
|
19
|
+
const released = [];
|
|
20
|
+
let pageToken;
|
|
21
|
+
for (let read = 0; read < MAX_TARGET_PAGES; read += 1) {
|
|
22
|
+
const catalog = await client.publishedTargets(surface, page, pageToken);
|
|
23
|
+
for (const choice of catalog.items) {
|
|
24
|
+
if (choice.stableRef.kind === 'page' &&
|
|
25
|
+
choice.stableRef.id === page &&
|
|
26
|
+
choice.status === 'active' &&
|
|
27
|
+
choice.accessPolicy !== undefined &&
|
|
28
|
+
(!choice.surface || choice.surface === surface))
|
|
29
|
+
released.push({ ...choice, accessPolicy: choice.accessPolicy });
|
|
30
|
+
}
|
|
31
|
+
pageToken = catalog.pageInfo.hasMore ? catalog.pageInfo.nextPageToken : undefined;
|
|
32
|
+
if (!pageToken)
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
return [...new Map(released.map((choice) => [canonicalContentHash(choice.stableRef), choice])).values()];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Adds one published Page to a Navigation draft as a target node. The node takes
|
|
39
|
+
* the released target's reference and access policy from the Server, so a Page
|
|
40
|
+
* without an active release on the surface is refused before anything is saved.
|
|
41
|
+
* Navigation keeps its own draft and release; --publish runs that release separately.
|
|
42
|
+
*/
|
|
43
|
+
export async function runNavigationAdd(options, suppliedClient) {
|
|
44
|
+
const runtime = suppliedClient?.runtime ??
|
|
45
|
+
(await loadSemanticRuntime({
|
|
46
|
+
subscription: options.subscription,
|
|
47
|
+
inheritDefaultTeam: false,
|
|
48
|
+
forceRefresh: true,
|
|
49
|
+
...(options.team ? { team: options.team } : {}),
|
|
50
|
+
}));
|
|
51
|
+
const scope = publicationScope('navigation', options.team);
|
|
52
|
+
const draft = await new DeclarativeClient(runtime, 'navigation', scope, options.surface).draft(options.id);
|
|
53
|
+
const navigation = draft.body;
|
|
54
|
+
if (navigation.contract !== 'Navigation' || navigation.navigationId !== options.id)
|
|
55
|
+
failure('The returned draft does not identify the requested Navigation.', 'DECLARATIVE_RESPONSE_MISMATCH');
|
|
56
|
+
const surface = options.surface ?? (navigation.supportedSurfaces.length === 1 ? navigation.supportedSurfaces[0] : undefined);
|
|
57
|
+
if (!surface || !navigation.supportedSurfaces.includes(surface))
|
|
58
|
+
failure('Choose a surface supported by the Navigation with --surface.', 'DECLARATIVE_SURFACE_REQUIRED');
|
|
59
|
+
const parentNodeId = options.parent ?? null;
|
|
60
|
+
if (parentNodeId && navigation.nodes.find((node) => node.nodeId === parentNodeId)?.kind !== 'group')
|
|
61
|
+
failure('The parent must be a group node of the same Navigation.', 'DECLARATIVE_NAVIGATION_PARENT_INVALID');
|
|
62
|
+
const client = new DeclarativeClient(runtime, 'navigation', scope, surface);
|
|
63
|
+
const targets = await releasedPageTargets(client, options.page, surface);
|
|
64
|
+
if (targets.length > 1)
|
|
65
|
+
failure('Several published Pages share this ID on the surface.', 'DECLARATIVE_NAVIGATION_TARGET_AMBIGUOUS', {
|
|
66
|
+
targets: targets.map((choice) => choice.stableRef),
|
|
67
|
+
});
|
|
68
|
+
const target = targets[0];
|
|
69
|
+
if (!target)
|
|
70
|
+
failure('The Page has no active release on this surface. Publish the Page before adding it to a Navigation.', 'DECLARATIVE_NAVIGATION_TARGET_UNPUBLISHED', { page: options.page, surface });
|
|
71
|
+
const lifecycle = {
|
|
72
|
+
subscription: options.subscription,
|
|
73
|
+
id: options.id,
|
|
74
|
+
surface,
|
|
75
|
+
yes: Boolean(options.yes),
|
|
76
|
+
dryRun: Boolean(options.dryRun),
|
|
77
|
+
...(options.team ? { team: options.team } : {}),
|
|
78
|
+
...(options.environment ? { environment: options.environment } : {}),
|
|
79
|
+
...(options.placement ? { placement: options.placement } : {}),
|
|
80
|
+
...(options.waitSeconds === undefined ? {} : { waitSeconds: options.waitSeconds }),
|
|
81
|
+
};
|
|
82
|
+
const result = { resourceKind: 'navigation', resourceId: options.id, page: options.page, surface };
|
|
83
|
+
const publish = async () => options.publish && !options.dryRun ? { publication: await runLifecycle('navigation', 'publish', lifecycle, client) } : {};
|
|
84
|
+
// Repeating the command must not create a second entry for the same Page under the same parent.
|
|
85
|
+
const targetHash = canonicalContentHash(target.stableRef);
|
|
86
|
+
const existing = navigation.nodes.find((node) => node.kind === 'target' && node.parentNodeId === parentNodeId && canonicalContentHash(node.targetRef) === targetHash);
|
|
87
|
+
if (existing)
|
|
88
|
+
return { ...result, changed: false, node: existing, ...(await publish()) };
|
|
89
|
+
// The Studio target catalog labels a Page by its ID; the menu entry should carry the Page's name.
|
|
90
|
+
let label = target.label;
|
|
91
|
+
if (Object.values(label.values).every((value) => value === options.page)) {
|
|
92
|
+
try {
|
|
93
|
+
const page = (await new DeclarativeClient(runtime, 'page', publicationScope('page', options.team), surface).draft(options.page)).body;
|
|
94
|
+
if (page.contract === 'Page' && page.pageId === options.page)
|
|
95
|
+
label = page.identity.name;
|
|
96
|
+
}
|
|
97
|
+
catch (cause) {
|
|
98
|
+
// A released Page stays addable when its draft is not readable in this context.
|
|
99
|
+
if (!(cause instanceof CliError))
|
|
100
|
+
throw cause;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const siblings = navigation.nodes.filter((node) => node.parentNodeId === parentNodeId);
|
|
104
|
+
const node = {
|
|
105
|
+
nodeId: randomUUID(),
|
|
106
|
+
parentNodeId,
|
|
107
|
+
order: siblings.reduce((highest, sibling) => Math.max(highest, sibling.order), 0) + NAVIGATION_ORDER_STEP,
|
|
108
|
+
kind: 'target',
|
|
109
|
+
label,
|
|
110
|
+
targetRef: target.stableRef,
|
|
111
|
+
parameterMapping: {},
|
|
112
|
+
audience: target.accessPolicy,
|
|
113
|
+
};
|
|
114
|
+
const directory = await mkdtemp(join(tmpdir(), 'monkeys-navigation-add-'));
|
|
115
|
+
try {
|
|
116
|
+
const file = join(directory, 'navigation.json');
|
|
117
|
+
await writeFile(file, `${JSON.stringify({ ...navigation, nodes: [...navigation.nodes, node] })}\n`, { mode: 0o600 });
|
|
118
|
+
// The new node was appended to the draft version read above; a newer draft must not be overwritten.
|
|
119
|
+
const saved = await runLifecycle('navigation', 'import', { ...lifecycle, file, expectedDraftVersion: draft.version }, client);
|
|
120
|
+
return { ...result, changed: true, node, draft: saved, ...(await publish()) };
|
|
121
|
+
}
|
|
122
|
+
finally {
|
|
123
|
+
await rm(directory, { recursive: true, force: true });
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CAAC,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACrH,oGAAoG;QACpG,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,EAAE,GAAG,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;QAC9H,OAAO,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,OAAO,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
-
import { DeclarativePublicationVerificationRequestSchema, type DeclarativePublicationScope, DeclarativeCommandIntentSchema,
|
|
1
|
+
import { DeclarativePublicationVerificationRequestSchema, type DeclarativePublicationScope, DeclarativeCommandIntentSchema, DeclarativePublicationJobManifestSchema, DeclarativeRuntimeBindingQueryIntentSchema } from '@inf-monkeys-tech/monkeys/contracts';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { type SemanticRuntime } from '../semantic/runtime.js';
|
|
4
4
|
import type { HttpRequest } from '../transport/types.js';
|
|
5
5
|
import type { Kind } from './target.js';
|
|
6
|
+
declare const authoringEnvelopeSchema: z.ZodObject<{
|
|
7
|
+
document: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8
|
+
surface: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
kernel: "kernel";
|
|
10
|
+
studio: "studio";
|
|
11
|
+
}>>;
|
|
12
|
+
environmentId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
declare const authoringIntentSchema: z.ZodObject<{
|
|
15
|
+
document: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
|
+
surface: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
kernel: "kernel";
|
|
18
|
+
studio: "studio";
|
|
19
|
+
}>>;
|
|
20
|
+
environmentId: z.ZodOptional<z.ZodString>;
|
|
21
|
+
expectedPlanHash: z.ZodString;
|
|
22
|
+
expectedVersion: z.ZodNumber;
|
|
23
|
+
idempotencyKey: z.ZodString;
|
|
24
|
+
}, z.core.$strict>;
|
|
6
25
|
type Query = NonNullable<HttpRequest['query']>;
|
|
7
26
|
export declare class DeclarativeClient {
|
|
8
27
|
readonly runtime: SemanticRuntime;
|
|
@@ -2215,6 +2234,152 @@ export declare class DeclarativeClient {
|
|
|
2215
2234
|
total?: number | undefined;
|
|
2216
2235
|
};
|
|
2217
2236
|
}>;
|
|
2237
|
+
/** Released Navigation targets on one surface, narrowed by the Server to IDs and labels matching the search. */
|
|
2238
|
+
publishedTargets(surface: 'studio' | 'kernel', search: string, pageToken?: string): Promise<{
|
|
2239
|
+
choiceKind: "published-target";
|
|
2240
|
+
items: {
|
|
2241
|
+
stableRef: {
|
|
2242
|
+
kind: string;
|
|
2243
|
+
id: string;
|
|
2244
|
+
ownerRepo: string;
|
|
2245
|
+
visibility: "global" | "public" | "tenant";
|
|
2246
|
+
tenantScope?: {
|
|
2247
|
+
tenantRef: {
|
|
2248
|
+
kind: string;
|
|
2249
|
+
id: string;
|
|
2250
|
+
ownerRepo: string;
|
|
2251
|
+
};
|
|
2252
|
+
dataSpaceRef: {
|
|
2253
|
+
kind: string;
|
|
2254
|
+
id: string;
|
|
2255
|
+
ownerRepo: string;
|
|
2256
|
+
};
|
|
2257
|
+
teamRef?: {
|
|
2258
|
+
kind: string;
|
|
2259
|
+
id: string;
|
|
2260
|
+
ownerRepo: string;
|
|
2261
|
+
} | undefined;
|
|
2262
|
+
} | undefined;
|
|
2263
|
+
};
|
|
2264
|
+
revisionRef?: {
|
|
2265
|
+
revision: number;
|
|
2266
|
+
schemaVersion: number;
|
|
2267
|
+
contentHash: string;
|
|
2268
|
+
kind: string;
|
|
2269
|
+
id: string;
|
|
2270
|
+
ownerRepo: string;
|
|
2271
|
+
visibility: "global" | "public" | "tenant";
|
|
2272
|
+
tenantScope?: {
|
|
2273
|
+
tenantRef: {
|
|
2274
|
+
kind: string;
|
|
2275
|
+
id: string;
|
|
2276
|
+
ownerRepo: string;
|
|
2277
|
+
};
|
|
2278
|
+
dataSpaceRef: {
|
|
2279
|
+
kind: string;
|
|
2280
|
+
id: string;
|
|
2281
|
+
ownerRepo: string;
|
|
2282
|
+
};
|
|
2283
|
+
teamRef?: {
|
|
2284
|
+
kind: string;
|
|
2285
|
+
id: string;
|
|
2286
|
+
ownerRepo: string;
|
|
2287
|
+
} | undefined;
|
|
2288
|
+
} | undefined;
|
|
2289
|
+
} | undefined;
|
|
2290
|
+
label: {
|
|
2291
|
+
defaultLocale: string;
|
|
2292
|
+
values: Record<string, string>;
|
|
2293
|
+
};
|
|
2294
|
+
accessPolicy?: {
|
|
2295
|
+
authenticated: boolean;
|
|
2296
|
+
groupAllOf: {
|
|
2297
|
+
kind: string;
|
|
2298
|
+
id: string;
|
|
2299
|
+
ownerRepo: string;
|
|
2300
|
+
visibility: "global" | "public" | "tenant";
|
|
2301
|
+
tenantScope?: {
|
|
2302
|
+
tenantRef: {
|
|
2303
|
+
kind: string;
|
|
2304
|
+
id: string;
|
|
2305
|
+
ownerRepo: string;
|
|
2306
|
+
};
|
|
2307
|
+
dataSpaceRef: {
|
|
2308
|
+
kind: string;
|
|
2309
|
+
id: string;
|
|
2310
|
+
ownerRepo: string;
|
|
2311
|
+
};
|
|
2312
|
+
teamRef?: {
|
|
2313
|
+
kind: string;
|
|
2314
|
+
id: string;
|
|
2315
|
+
ownerRepo: string;
|
|
2316
|
+
} | undefined;
|
|
2317
|
+
} | undefined;
|
|
2318
|
+
}[];
|
|
2319
|
+
groupAnyOf: {
|
|
2320
|
+
kind: string;
|
|
2321
|
+
id: string;
|
|
2322
|
+
ownerRepo: string;
|
|
2323
|
+
visibility: "global" | "public" | "tenant";
|
|
2324
|
+
tenantScope?: {
|
|
2325
|
+
tenantRef: {
|
|
2326
|
+
kind: string;
|
|
2327
|
+
id: string;
|
|
2328
|
+
ownerRepo: string;
|
|
2329
|
+
};
|
|
2330
|
+
dataSpaceRef: {
|
|
2331
|
+
kind: string;
|
|
2332
|
+
id: string;
|
|
2333
|
+
ownerRepo: string;
|
|
2334
|
+
};
|
|
2335
|
+
teamRef?: {
|
|
2336
|
+
kind: string;
|
|
2337
|
+
id: string;
|
|
2338
|
+
ownerRepo: string;
|
|
2339
|
+
} | undefined;
|
|
2340
|
+
} | undefined;
|
|
2341
|
+
}[];
|
|
2342
|
+
permissionAllOf: string[];
|
|
2343
|
+
permissionAnyOf: string[];
|
|
2344
|
+
conditionAllOf: {
|
|
2345
|
+
revision: number;
|
|
2346
|
+
schemaVersion: number;
|
|
2347
|
+
contentHash: string;
|
|
2348
|
+
kind: string;
|
|
2349
|
+
id: string;
|
|
2350
|
+
ownerRepo: string;
|
|
2351
|
+
visibility: "global" | "public" | "tenant";
|
|
2352
|
+
tenantScope?: {
|
|
2353
|
+
tenantRef: {
|
|
2354
|
+
kind: string;
|
|
2355
|
+
id: string;
|
|
2356
|
+
ownerRepo: string;
|
|
2357
|
+
};
|
|
2358
|
+
dataSpaceRef: {
|
|
2359
|
+
kind: string;
|
|
2360
|
+
id: string;
|
|
2361
|
+
ownerRepo: string;
|
|
2362
|
+
};
|
|
2363
|
+
teamRef?: {
|
|
2364
|
+
kind: string;
|
|
2365
|
+
id: string;
|
|
2366
|
+
ownerRepo: string;
|
|
2367
|
+
} | undefined;
|
|
2368
|
+
} | undefined;
|
|
2369
|
+
}[];
|
|
2370
|
+
} | undefined;
|
|
2371
|
+
surface?: "kernel" | "studio" | undefined;
|
|
2372
|
+
status: "active" | "deprecated" | "retired" | "unavailable";
|
|
2373
|
+
metadata: Record<string, unknown>;
|
|
2374
|
+
}[];
|
|
2375
|
+
pageInfo: {
|
|
2376
|
+
hasMore: boolean;
|
|
2377
|
+
nextPageToken?: string | undefined;
|
|
2378
|
+
pageSize: number;
|
|
2379
|
+
returned: number;
|
|
2380
|
+
total?: number | undefined;
|
|
2381
|
+
};
|
|
2382
|
+
}>;
|
|
2218
2383
|
draft(id: string): Promise<{
|
|
2219
2384
|
version: number;
|
|
2220
2385
|
body: {
|
|
@@ -14330,7 +14495,7 @@ export declare class DeclarativeClient {
|
|
|
14330
14495
|
generation: number;
|
|
14331
14496
|
contentHash: string;
|
|
14332
14497
|
}>;
|
|
14333
|
-
prepare(input: z.input<typeof
|
|
14498
|
+
prepare(input: z.input<typeof authoringEnvelopeSchema>): Promise<{
|
|
14334
14499
|
contract: "DeclarativeDocumentImportPlan";
|
|
14335
14500
|
schemaVersion: 1;
|
|
14336
14501
|
resourceKind: "navigation" | "page";
|
|
@@ -15931,7 +16096,7 @@ export declare class DeclarativeClient {
|
|
|
15931
16096
|
dependencyContentHash: string;
|
|
15932
16097
|
planHash: string;
|
|
15933
16098
|
}>;
|
|
15934
|
-
import(input: z.input<typeof
|
|
16099
|
+
import(input: z.input<typeof authoringIntentSchema>): Promise<{
|
|
15935
16100
|
action: "import";
|
|
15936
16101
|
changed: boolean;
|
|
15937
16102
|
plan: {
|