@cef-ai/cli 1.3.1 → 1.5.0
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 +5 -1
- package/dist/build/load-config.d.ts +65 -4
- package/dist/build/load-config.d.ts.map +1 -1
- package/dist/build/load-config.js.map +1 -1
- package/dist/build/manifest.d.ts +103 -1
- package/dist/build/manifest.d.ts.map +1 -1
- package/dist/build/manifest.js +64 -2
- package/dist/build/manifest.js.map +1 -1
- package/dist/cli-program.d.ts +6 -0
- package/dist/cli-program.d.ts.map +1 -1
- package/dist/cli-program.js +131 -3
- package/dist/cli-program.js.map +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +113 -3
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/deploy.d.ts +38 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +317 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/init.d.ts +41 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +191 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/publish.d.ts +1 -2
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +32 -24
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/push.d.ts +31 -3
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +94 -10
- package/dist/commands/push.js.map +1 -1
- package/dist/lib/ddc.d.ts +87 -15
- package/dist/lib/ddc.d.ts.map +1 -1
- package/dist/lib/ddc.js +128 -32
- package/dist/lib/ddc.js.map +1 -1
- package/dist/lib.d.ts +4 -0
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +2 -0
- package/dist/lib.js.map +1 -1
- package/package.json +4 -3
- package/templates/hello-world/AGENTS.md +41 -0
- package/templates/hello-world/CLAUDE.md +9 -0
- package/templates/hello-world/README.md +55 -0
- package/templates/hello-world/cef.config.ts +24 -0
- package/templates/hello-world/claude/settings.json +23 -0
- package/templates/hello-world/deployments/default.jsonc +9 -0
- package/templates/hello-world/deployments/sandbox-canary.jsonc +12 -0
- package/templates/hello-world/gitignore +3 -0
- package/templates/hello-world/migrations/history/001-init.sql +5 -0
- package/templates/hello-world/package.json +23 -0
- package/templates/hello-world/src/agent.ts +44 -0
- package/templates/hello-world/test/agent.test.ts +28 -0
- package/templates/hello-world/tsconfig.json +19 -0
- package/templates/hello-world/widgets/hello/app.js +8 -0
- package/templates/hello-world/widgets/hello/hello.html +5 -0
package/README.md
CHANGED
|
@@ -18,11 +18,15 @@ invoke it via `pnpm exec cef <subcommand>`.
|
|
|
18
18
|
|
|
19
19
|
| Subcommand | Status | Description |
|
|
20
20
|
| --- | --- | --- |
|
|
21
|
+
| `cef init [dir]` | shipped | Scaffold a hello-world agent project (agent + cubby + widget + test), depending on the published `@cef-ai/*` packages. Interactive with `--yes`/flags; writes AI-friendly files that auto-wire the `cef` Claude Code plugin (`--no-ai` to skip). |
|
|
22
|
+
| `cef deploy` | shipped | Make an agent live: apply the repo's `deployments/` folder (or a single set file) to the platform. `--endpoint <url>` (or `$CEF_ENDPOINT`; defaults to dev), `--deployments <file\|dir>`, `--version`, `--as-pubkey`, `--dry-run`. Requires deployment records + reachability to the endpoint. |
|
|
21
23
|
| `cef build` | shipped | Lint the agent entry, bundle with esbuild (the bundle imports the SDK runtime shims and installs `globalThis.__handlers`), emit `dist/<agentId>/{bundle.js,manifest.json}`. |
|
|
22
24
|
| `cef typegen` | shipped | Generate `.cef/generated.d.ts` (declaration-merged `KnownEventTypes`) and refresh `cef.lock.json`. |
|
|
23
25
|
| `cef inspect <agentDir>` | shipped | Read a built `manifest.json`, run the bundle in `node:vm`, and report the handler names exposed on `__handlers` plus any routing targets the manifest references but the bundle doesn't expose. |
|
|
26
|
+
| `cef publish` | shipped | Sign a built agent's card and POST it to the marketplace API (credentials resolved AWS-CLI-style). |
|
|
27
|
+
| `cef push` | shipped | Upload a built agent's `bundle.js` (+ widget dirs) to DDC and stamp the manifest's bundle ref. |
|
|
28
|
+
| `cef keypair generate` | shipped | Materialise a new AS Ed25519 keypair (stdout, `--out` file, or `--profile`). |
|
|
24
29
|
| `cef test` | stub | Placeholder — use `vitest` directly with `@cef-ai/testing` until the integrated runner lands. |
|
|
25
|
-
| `cef publish` | stub | Placeholder — pending the Marketplace API. |
|
|
26
30
|
| `cef dev` | stub | Placeholder — pending the packaged platform image. |
|
|
27
31
|
|
|
28
32
|
`cef build` writes one directory per declared agent:
|
|
@@ -17,6 +17,42 @@ export interface Targeting {
|
|
|
17
17
|
}
|
|
18
18
|
/** JSON Schema document, kept loose. */
|
|
19
19
|
export type JSONSchema = Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* ADR-038 §3.6 param declaration (mirrored structurally from
|
|
22
|
+
* `@cef-ai/agent-sdk/config`). Declared + bounded at the agent level; the
|
|
23
|
+
* effective value is resolved by the orchestrator and surfaced as `ctx.params`.
|
|
24
|
+
*/
|
|
25
|
+
export interface ParamDecl {
|
|
26
|
+
type: "number" | "string" | "boolean" | "modelAlias";
|
|
27
|
+
default: unknown;
|
|
28
|
+
min?: number;
|
|
29
|
+
max?: number;
|
|
30
|
+
enum?: unknown[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* ADR-038 §3.3 rate limit as authored on an engagement declaration.
|
|
34
|
+
* `per` ∈ `"day"` | `"connection/day"` | `"connection/month"`.
|
|
35
|
+
*/
|
|
36
|
+
export interface EngagementLimit {
|
|
37
|
+
n: number;
|
|
38
|
+
per: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* One `engagements[]` entry as authored in `cef.config.ts`. Beyond `id`/`entry`
|
|
42
|
+
* it MAY carry the ADR-038 on-declaration selection fields; `cef build` folds
|
|
43
|
+
* these together with the class-decorator metadata into the manifest.
|
|
44
|
+
*/
|
|
45
|
+
export interface ConfigEngagement {
|
|
46
|
+
id: string;
|
|
47
|
+
entry: string;
|
|
48
|
+
goal?: string;
|
|
49
|
+
condition?: string | string[];
|
|
50
|
+
params?: Record<string, unknown>;
|
|
51
|
+
priority?: number;
|
|
52
|
+
weight?: number;
|
|
53
|
+
limit?: EngagementLimit;
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
}
|
|
20
56
|
/** Marketplace presentation card. */
|
|
21
57
|
export interface AgentCard {
|
|
22
58
|
name: string;
|
|
@@ -24,6 +60,30 @@ export interface AgentCard {
|
|
|
24
60
|
iconUrl?: string;
|
|
25
61
|
capabilities?: string[];
|
|
26
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* One `widgets[]` entry as authored in `cef.config.ts` (structural mirror of
|
|
65
|
+
* `WidgetDecl` from `@cef-ai/agent-sdk/config`). `dir` is the built,
|
|
66
|
+
* self-contained widget directory (entry HTML + sibling assets); `cef build`
|
|
67
|
+
* copies it into `dist/<agentId>/widgets/<id>/` and `cef push` uploads it as
|
|
68
|
+
* one content-addressed DDC directory DAG.
|
|
69
|
+
*/
|
|
70
|
+
export interface ConfigWidget {
|
|
71
|
+
id: string;
|
|
72
|
+
name?: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
cubbyAlias?: string;
|
|
75
|
+
kind?: string;
|
|
76
|
+
config?: Record<string, unknown>;
|
|
77
|
+
queries?: Array<{
|
|
78
|
+
id: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
sql: string;
|
|
81
|
+
timeoutMs?: number;
|
|
82
|
+
}>;
|
|
83
|
+
events?: string[];
|
|
84
|
+
dir: string;
|
|
85
|
+
entry: string;
|
|
86
|
+
}
|
|
27
87
|
/**
|
|
28
88
|
* Subset of `AgentConfig` (from `@cef-ai/agent-sdk/config`) consumed across
|
|
29
89
|
* the CLI commands. Re-declared here so commands don't need to import the
|
|
@@ -51,11 +111,10 @@ export interface AgentConfigLike {
|
|
|
51
111
|
* `"500ms"`); default `"30m"`. Parsed into ms by the build step. */
|
|
52
112
|
idleTimeout?: string;
|
|
53
113
|
entry?: string;
|
|
54
|
-
engagements?:
|
|
55
|
-
id: string;
|
|
56
|
-
entry: string;
|
|
57
|
-
}>;
|
|
114
|
+
engagements?: ConfigEngagement[];
|
|
58
115
|
agents?: AgentConfigLike[];
|
|
116
|
+
/** ADR-038 §3.6 agent-level param declarations, carried into the manifest. */
|
|
117
|
+
params?: Record<string, ParamDecl>;
|
|
59
118
|
cubbies?: Array<{
|
|
60
119
|
alias: string;
|
|
61
120
|
migrations?: string;
|
|
@@ -71,6 +130,8 @@ export interface AgentConfigLike {
|
|
|
71
130
|
models?: Record<string, string>;
|
|
72
131
|
uses?: Record<string, string>;
|
|
73
132
|
eventSchemas?: Record<string, JSONSchema>;
|
|
133
|
+
/** Widget declarations; each is uploaded by `cef push` as a directory DAG. */
|
|
134
|
+
widgets?: ConfigWidget[];
|
|
74
135
|
targeting?: Targeting;
|
|
75
136
|
}
|
|
76
137
|
/** Single engagement, normalized for build-pipeline consumers. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/build/load-config.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED,4DAA4D;AAC5D,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACpC;AAED,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,qCAAqC;AACrC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EA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AE,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,kEAAkE;AAClE,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;CACf;AA2BD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,eAAe,CAAC,CAqC1B;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,EAAE,CAUrE;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,MAAM,GAChB,oBAAoB,EAAE,CAiDxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../src/build/load-config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../src/build/load-config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAoJnC;;;;;;;;;GASG;AACH,KAAK,UAAU,qBAAqB,CAAC,KAAa;IAChD,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAA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AC;YAClD,MAAM,IAAI,KAAK,CACb,wBAAwB,KAAK,CAAC,EAAE,oCAAoC,CACrE,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,gCAAgC,CAAC,CAAC,EAAE,yCAAyC,CAC9E,CAAC;QACJ,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACf,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,KAAK,CACb,wBAAwB,KAAK,CAAC,EAAE,kBAAkB,CAAC,CAAC,EAAE,qBAAqB,CAC5E,CAAC;QACJ,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/build/manifest.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentCard, JSONSchema, Targeting } from "./load-config.js";
|
|
1
|
+
import type { AgentCard, EngagementLimit, JSONSchema, ParamDecl, Targeting } from "./load-config.js";
|
|
2
2
|
/**
|
|
3
3
|
* Per-engagement manifest input. Each engagement carries its own routing
|
|
4
4
|
* (`events` map) and its lifecycle method names (extracted from decorator
|
|
@@ -23,6 +23,19 @@ export interface ManifestEngagementInput {
|
|
|
23
23
|
};
|
|
24
24
|
/** Event types this engagement publishes (lint-derived or author-pinned). */
|
|
25
25
|
publishes: string[];
|
|
26
|
+
/**
|
|
27
|
+
* ADR-038 §3.3/§3.6 on-declaration selection fields, already merged by the
|
|
28
|
+
* build pipeline (decorator metadata ⊕ config engagement entry). All
|
|
29
|
+
* optional; omitted from the emitted manifest when absent so the wire shape
|
|
30
|
+
* is unchanged for engagements that declare no selection metadata.
|
|
31
|
+
*/
|
|
32
|
+
conditions?: string[];
|
|
33
|
+
priority?: number;
|
|
34
|
+
weight?: number;
|
|
35
|
+
limit?: EngagementLimit;
|
|
36
|
+
params?: Record<string, unknown>;
|
|
37
|
+
/** When `false`, the engagement is declared but not selectable. */
|
|
38
|
+
enabled?: boolean;
|
|
26
39
|
}
|
|
27
40
|
/**
|
|
28
41
|
* Subset of `AgentConfig` (from `@cef-ai/agent-sdk/config`) that the manifest
|
|
@@ -57,6 +70,29 @@ export interface ManifestConfigInput {
|
|
|
57
70
|
models?: Record<string, string>;
|
|
58
71
|
uses?: Record<string, string>;
|
|
59
72
|
eventSchemas?: Record<string, JSONSchema>;
|
|
73
|
+
/** ADR-038 §3.6 agent-level param declarations; emitted verbatim into
|
|
74
|
+
* `manifest.params` when present (omitted otherwise). */
|
|
75
|
+
params?: Record<string, ParamDecl>;
|
|
76
|
+
/** Widget declarations copied from `cef.config.ts`; each emitted as a
|
|
77
|
+
* {@link ManifestWidget} with a placeholder `dag` ref that `cef push`
|
|
78
|
+
* fills in. */
|
|
79
|
+
widgets?: Array<{
|
|
80
|
+
id: string;
|
|
81
|
+
name?: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
cubbyAlias?: string;
|
|
84
|
+
kind?: string;
|
|
85
|
+
config?: Record<string, unknown>;
|
|
86
|
+
queries?: Array<{
|
|
87
|
+
id: string;
|
|
88
|
+
label?: string;
|
|
89
|
+
sql: string;
|
|
90
|
+
timeoutMs?: number;
|
|
91
|
+
}>;
|
|
92
|
+
events?: string[];
|
|
93
|
+
dir: string;
|
|
94
|
+
entry: string;
|
|
95
|
+
}>;
|
|
60
96
|
}
|
|
61
97
|
export interface ManifestInput {
|
|
62
98
|
/** Marketplace alias / build id (becomes `manifest.alias`). */
|
|
@@ -99,6 +135,20 @@ export interface ManifestEngagement {
|
|
|
99
135
|
id: string;
|
|
100
136
|
goal: string;
|
|
101
137
|
handlers: Record<string, string>;
|
|
138
|
+
/**
|
|
139
|
+
* ADR-038 §3.3/§3.6 on-declaration selection fields. Each is present only
|
|
140
|
+
* when the engagement declared it (via the `@Condition`/`@Priority`/… class
|
|
141
|
+
* decorators or the config `engagements[]` entry), keeping the wire shape
|
|
142
|
+
* unchanged for engagements without selection metadata. `conditions` are
|
|
143
|
+
* ANDed; `priority` lower = higher; `enabled: false` marks the engagement
|
|
144
|
+
* non-selectable.
|
|
145
|
+
*/
|
|
146
|
+
conditions?: string[];
|
|
147
|
+
priority?: number;
|
|
148
|
+
weight?: number;
|
|
149
|
+
limit?: EngagementLimit;
|
|
150
|
+
params?: Record<string, unknown>;
|
|
151
|
+
enabled?: boolean;
|
|
102
152
|
}
|
|
103
153
|
/** Settings declaration as emitted into the manifest. */
|
|
104
154
|
export type ManifestSetting = NonNullable<ManifestConfigInput["settings"]>[number];
|
|
@@ -115,6 +165,42 @@ export interface BundleRef {
|
|
|
115
165
|
/** LEAF `bundle.js` piece CID (base32). */
|
|
116
166
|
cid: string;
|
|
117
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* A widget entry as emitted into the manifest. The author-facing fields
|
|
170
|
+
* (`id`/`name`/… + `entry`) are copied verbatim from the `cef.config.ts`
|
|
171
|
+
* {@link WidgetDecl}. `dag` is a content-addressed reference to the widget's
|
|
172
|
+
* uploaded directory DAG on DDC: `bucketId` is the DDC bucket id (decimal
|
|
173
|
+
* string) and `cid` is the DIRECTORY node CID. `cef build` emits an empty
|
|
174
|
+
* placeholder (`{ bucketId: "", cid: "" }`); `cef push` uploads the widget
|
|
175
|
+
* directory and stamps in the real `{ bucketId, cid }`.
|
|
176
|
+
*
|
|
177
|
+
* Consumers resolve the widget's entry at `<gateway>/<bucketId>/<cid>/<entry>`
|
|
178
|
+
* — the content gateway serves the directory DAG by path, so the entry HTML's
|
|
179
|
+
* relative `./sibling.js` refs resolve under the directory CID. No gateway URL
|
|
180
|
+
* is baked in.
|
|
181
|
+
*/
|
|
182
|
+
export interface ManifestWidget {
|
|
183
|
+
id: string;
|
|
184
|
+
name?: string;
|
|
185
|
+
description?: string;
|
|
186
|
+
cubbyAlias?: string;
|
|
187
|
+
kind?: string;
|
|
188
|
+
config?: Record<string, unknown>;
|
|
189
|
+
queries?: Array<{
|
|
190
|
+
id: string;
|
|
191
|
+
label?: string;
|
|
192
|
+
sql: string;
|
|
193
|
+
timeoutMs?: number;
|
|
194
|
+
}>;
|
|
195
|
+
events?: string[];
|
|
196
|
+
/** Entry file within the uploaded directory DAG, e.g. `"hiring.html"`. */
|
|
197
|
+
entry: string;
|
|
198
|
+
/** Content-addressed ref to the widget's directory DAG on DDC. */
|
|
199
|
+
dag: {
|
|
200
|
+
bucketId: string;
|
|
201
|
+
cid: string;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
118
204
|
/**
|
|
119
205
|
* Manifest body per `prototype.md` §"AgentManifest". Identity / signature
|
|
120
206
|
* fields (`agentId`, `agentServicePubkey`, `signature`) are filled in by
|
|
@@ -152,6 +238,22 @@ export interface CefManifest {
|
|
|
152
238
|
models: Record<string, string>;
|
|
153
239
|
uses: Record<string, string>;
|
|
154
240
|
targeting: Targeting;
|
|
241
|
+
/**
|
|
242
|
+
* ADR-038 §3.6 agent-level param declarations. Present only when the config
|
|
243
|
+
* declared `params` — omitted otherwise so the wire shape is unchanged for
|
|
244
|
+
* agents that declare none. The preferred selection surface is the
|
|
245
|
+
* on-declaration engagement fields above; {@link CefManifest.targeting}
|
|
246
|
+
* remains for back-compat.
|
|
247
|
+
*/
|
|
248
|
+
params?: Record<string, ParamDecl>;
|
|
249
|
+
/**
|
|
250
|
+
* Widgets shipped with the agent. Present only when the config declared
|
|
251
|
+
* `widgets` — omitted otherwise so the wire shape is unchanged for agents
|
|
252
|
+
* with no widgets. `cef build` emits each entry with a placeholder
|
|
253
|
+
* `dag: { bucketId: "", cid: "" }`; `cef push` uploads each widget's
|
|
254
|
+
* directory to DDC as one directory DAG and stamps in the real ref.
|
|
255
|
+
*/
|
|
256
|
+
widgets?: ManifestWidget[];
|
|
155
257
|
source: string;
|
|
156
258
|
signature: string;
|
|
157
259
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/build/manifest.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACV,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,+EAA+E;IAC/E,SAAS,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,6EAA6E;IAC7E,SAAS,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/build/manifest.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,UAAU,EACV,SAAS,EACT,SAAS,EACV,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,+EAA+E;IAC/E,SAAS,EAAE;QAAE,KAAK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E;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,WAAW,CAAC,CAKtB"}
|
package/dist/build/manifest.js
CHANGED
|
@@ -79,11 +79,26 @@ export async function buildManifest(input) {
|
|
|
79
79
|
handlers[SYNTHETIC_CLOSE_EVENT] = LIFECYCLE_CLOSE_KEY;
|
|
80
80
|
for (const t of e.publishes)
|
|
81
81
|
allPublishes.add(t);
|
|
82
|
-
|
|
82
|
+
const out = {
|
|
83
83
|
id: e.id,
|
|
84
84
|
goal: e.goal ?? "",
|
|
85
85
|
handlers,
|
|
86
86
|
};
|
|
87
|
+
// ADR-038 on-declaration selection fields: only emitted when present, so
|
|
88
|
+
// engagements without selection metadata keep the legacy wire shape.
|
|
89
|
+
if (e.conditions && e.conditions.length > 0)
|
|
90
|
+
out.conditions = e.conditions;
|
|
91
|
+
if (e.priority !== undefined)
|
|
92
|
+
out.priority = e.priority;
|
|
93
|
+
if (e.weight !== undefined)
|
|
94
|
+
out.weight = e.weight;
|
|
95
|
+
if (e.limit !== undefined)
|
|
96
|
+
out.limit = e.limit;
|
|
97
|
+
if (e.params && Object.keys(e.params).length > 0)
|
|
98
|
+
out.params = e.params;
|
|
99
|
+
if (e.enabled === false)
|
|
100
|
+
out.enabled = false;
|
|
101
|
+
return out;
|
|
87
102
|
});
|
|
88
103
|
const cubbies = [];
|
|
89
104
|
for (const c of config.cubbies ?? []) {
|
|
@@ -105,7 +120,7 @@ export async function buildManifest(input) {
|
|
|
105
120
|
const aliasFinal = config.alias ?? agentId;
|
|
106
121
|
const asPubkeyFinal = config.agentServicePubkey ?? "";
|
|
107
122
|
const agentIdFinal = asPubkeyFinal ? `${asPubkeyFinal}:${aliasFinal}` : "";
|
|
108
|
-
|
|
123
|
+
const manifest = {
|
|
109
124
|
agentId: agentIdFinal,
|
|
110
125
|
agentServicePubkey: asPubkeyFinal,
|
|
111
126
|
version,
|
|
@@ -128,6 +143,53 @@ export async function buildManifest(input) {
|
|
|
128
143
|
source: config.source ?? "",
|
|
129
144
|
signature: "",
|
|
130
145
|
};
|
|
146
|
+
// Agent-level param declarations: emitted only when present so agents that
|
|
147
|
+
// declare none keep the legacy wire shape (ADR-038 §3.6).
|
|
148
|
+
if (config.params && Object.keys(config.params).length > 0) {
|
|
149
|
+
manifest.params = config.params;
|
|
150
|
+
}
|
|
151
|
+
// Widgets: emit one ManifestWidget per declared widget, copying the author
|
|
152
|
+
// fields + entry with a placeholder content-addressed `dag` ref that `cef
|
|
153
|
+
// push` fills in (mirrors the `bundle` placeholder). Only emitted when the
|
|
154
|
+
// config declares widgets so the wire shape is unchanged otherwise. Widget
|
|
155
|
+
// ids must be unique within the agent.
|
|
156
|
+
if (config.widgets && config.widgets.length > 0) {
|
|
157
|
+
const seen = new Set();
|
|
158
|
+
const manifestWidgets = [];
|
|
159
|
+
for (const w of config.widgets) {
|
|
160
|
+
if (!w.id || typeof w.id !== "string") {
|
|
161
|
+
throw new Error(`[@cef-ai/cli] agent "${agentId}": widget declaration is missing a string 'id'`);
|
|
162
|
+
}
|
|
163
|
+
if (seen.has(w.id)) {
|
|
164
|
+
throw new Error(`[@cef-ai/cli] agent "${agentId}": duplicate widget id "${w.id}"`);
|
|
165
|
+
}
|
|
166
|
+
seen.add(w.id);
|
|
167
|
+
const mw = {
|
|
168
|
+
id: w.id,
|
|
169
|
+
entry: w.entry,
|
|
170
|
+
// Placeholder content-addressed dir DAG ref; `cef push` rewrites this
|
|
171
|
+
// with the real { bucketId, cid } after uploading the widget dir.
|
|
172
|
+
dag: { bucketId: "", cid: "" },
|
|
173
|
+
};
|
|
174
|
+
if (w.name !== undefined)
|
|
175
|
+
mw.name = w.name;
|
|
176
|
+
if (w.description !== undefined)
|
|
177
|
+
mw.description = w.description;
|
|
178
|
+
if (w.cubbyAlias !== undefined)
|
|
179
|
+
mw.cubbyAlias = w.cubbyAlias;
|
|
180
|
+
if (w.kind !== undefined)
|
|
181
|
+
mw.kind = w.kind;
|
|
182
|
+
if (w.config !== undefined)
|
|
183
|
+
mw.config = w.config;
|
|
184
|
+
if (w.queries !== undefined)
|
|
185
|
+
mw.queries = w.queries;
|
|
186
|
+
if (w.events !== undefined)
|
|
187
|
+
mw.events = w.events;
|
|
188
|
+
manifestWidgets.push(mw);
|
|
189
|
+
}
|
|
190
|
+
manifest.widgets = manifestWidgets;
|
|
191
|
+
}
|
|
192
|
+
return manifest;
|
|
131
193
|
}
|
|
132
194
|
/**
|
|
133
195
|
* Build the manifest and write it as pretty-printed JSON to `out`. Returns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/build/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/build/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AA8P9C,MAAM,UAAU,GAAc,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;AAC5D,kFAAkF;AAClF,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAEnC;;;;;GAKG;AACH,KAAK,UAAU,cAAc,CAC3B,GAAW;IAEX,MAAM,OAAO,GAAG,MAAM,EAAE,CA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AAE,MAAM,CAAC,CAAC;IAC1E,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/cli-program.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
export declare const DEFAULT_MARKETPLACE_URL = "https://agent-marketplace.compute.dev.ddcdragon.com";
|
|
3
|
+
/**
|
|
4
|
+
* Default platform API endpoint for `cef deploy` (the dev environment).
|
|
5
|
+
* Override per-invocation with `--endpoint` or `$CEF_ENDPOINT`; for the test
|
|
6
|
+
* environment use `https://orchestrator.compute.test.ddcdragon.com/`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_ENDPOINT = "https://orchestrator.compute.dev.ddcdragon.com/";
|
|
3
9
|
export interface BuildProgramOptions {
|
|
4
10
|
/** Optional fetch override threaded into `cef publish`. Tests use this. */
|
|
5
11
|
fetchImpl?: typeof fetch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-program.d.ts","sourceRoot":"","sources":["../src/cli-program.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-program.d.ts","sourceRoot":"","sources":["../src/cli-program.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,eAAO,MAAM,uBAAuB,wDACmB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,oDACsB,CAAC;AAEpD,MAAM,WAAW,mBAAmB;IAClC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,KAAK,CAAC;CACnC;AAQD,wBAAgB,YAAY,CAAC,IAAI,GAAE,mBAAwB,GAAG,OAAO,CA8dpE"}
|
package/dist/cli-program.js
CHANGED
|
@@ -10,12 +10,20 @@ import path from "node:path";
|
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
import { Command } from "commander";
|
|
12
12
|
import { cefBuild } from "./commands/build.js";
|
|
13
|
+
import { cefDeploy } from "./commands/deploy.js";
|
|
14
|
+
import { cefInit } from "./commands/init.js";
|
|
13
15
|
import { cefInspect } from "./commands/inspect.js";
|
|
14
16
|
import { cefKeypairGenerate } from "./commands/keypair.js";
|
|
15
17
|
import { cefPublish } from "./commands/publish.js";
|
|
16
18
|
import { cefPush } from "./commands/push.js";
|
|
17
19
|
import { cefTypegen } from "./commands/typegen.js";
|
|
18
20
|
export const DEFAULT_MARKETPLACE_URL = "https://agent-marketplace.compute.dev.ddcdragon.com";
|
|
21
|
+
/**
|
|
22
|
+
* Default platform API endpoint for `cef deploy` (the dev environment).
|
|
23
|
+
* Override per-invocation with `--endpoint` or `$CEF_ENDPOINT`; for the test
|
|
24
|
+
* environment use `https://orchestrator.compute.test.ddcdragon.com/`.
|
|
25
|
+
*/
|
|
26
|
+
export const DEFAULT_ENDPOINT = "https://orchestrator.compute.dev.ddcdragon.com/";
|
|
19
27
|
function defaultOnError(err) {
|
|
20
28
|
const msg = err instanceof Error ? err.message : String(err);
|
|
21
29
|
console.error(msg);
|
|
@@ -32,6 +40,54 @@ export function buildProgram(opts = {}) {
|
|
|
32
40
|
.name("cef")
|
|
33
41
|
.description("CEF agent build & test CLI")
|
|
34
42
|
.version(pkg.version);
|
|
43
|
+
program
|
|
44
|
+
.command("init")
|
|
45
|
+
.argument("[dir]", "Target directory for the new agent project")
|
|
46
|
+
.description("Scaffold a new hello-world agent project")
|
|
47
|
+
.option("--name <alias>", "Agent id/alias (default: slug of the directory)")
|
|
48
|
+
.option("-y, --yes", "Accept all defaults; do not prompt")
|
|
49
|
+
.option("--pm <manager>", "Package manager: pnpm | npm | yarn | bun")
|
|
50
|
+
.option("--no-install", "Skip dependency install")
|
|
51
|
+
.option("--no-git", "Skip git init")
|
|
52
|
+
.option("--no-ai", "Skip the AI-friendly files (AGENTS.md / CLAUDE.md / .claude)")
|
|
53
|
+
.option("--force", "Scaffold into a non-empty directory")
|
|
54
|
+
.option("--template <name>", "Template to use", "hello-world")
|
|
55
|
+
.action(async (dir, subOpts) => {
|
|
56
|
+
try {
|
|
57
|
+
if (subOpts.pm !== undefined &&
|
|
58
|
+
!["pnpm", "npm", "yarn", "bun"].includes(subOpts.pm)) {
|
|
59
|
+
throw new Error(`[cef init] --pm must be pnpm, npm, yarn, or bun (got "${subOpts.pm}")`);
|
|
60
|
+
}
|
|
61
|
+
const result = await cefInit({
|
|
62
|
+
...(dir !== undefined ? { dir } : {}),
|
|
63
|
+
...(subOpts.name !== undefined ? { name: subOpts.name } : {}),
|
|
64
|
+
...(subOpts.yes !== undefined ? { yes: subOpts.yes } : {}),
|
|
65
|
+
...(subOpts.pm !== undefined
|
|
66
|
+
? { pm: subOpts.pm }
|
|
67
|
+
: {}),
|
|
68
|
+
...(subOpts.install !== undefined ? { install: subOpts.install } : {}),
|
|
69
|
+
...(subOpts.git !== undefined ? { git: subOpts.git } : {}),
|
|
70
|
+
...(subOpts.ai !== undefined ? { ai: subOpts.ai } : {}),
|
|
71
|
+
...(subOpts.force !== undefined ? { force: subOpts.force } : {}),
|
|
72
|
+
...(subOpts.template !== undefined
|
|
73
|
+
? { template: subOpts.template }
|
|
74
|
+
: {}),
|
|
75
|
+
});
|
|
76
|
+
console.log(`✓ Scaffolded ${result.agentId} in ${result.dir}`);
|
|
77
|
+
console.log(` ${result.files.length} files · ${result.pm} · ${result.installed ? "deps installed" : "deps not installed"}`);
|
|
78
|
+
console.log("\nNext steps:");
|
|
79
|
+
for (const step of result.nextSteps)
|
|
80
|
+
console.log(` ${step}`);
|
|
81
|
+
if (result.aiFiles) {
|
|
82
|
+
console.log("\nAI-assisted dev (Claude Code): trust the folder to auto-install the `cef` plugin, or run:");
|
|
83
|
+
console.log(" /plugin marketplace add CEF-AI/cef-plugins");
|
|
84
|
+
console.log(" /plugin install cef@cef");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
onError(e);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
35
91
|
program
|
|
36
92
|
.command("build")
|
|
37
93
|
.description("Build agent bundle.js + manifest.json")
|
|
@@ -118,9 +174,9 @@ export function buildProgram(opts = {}) {
|
|
|
118
174
|
};
|
|
119
175
|
const result = await cefPublish(publishOpts);
|
|
120
176
|
console.log(`✓ Published ${result.agentId}@${result.version}`);
|
|
121
|
-
console.log(` agentId:
|
|
122
|
-
console.log(`
|
|
123
|
-
console.log(`
|
|
177
|
+
console.log(` agentId: ${result.agentId}`);
|
|
178
|
+
console.log(` version: ${result.version}`);
|
|
179
|
+
console.log(` pubkey: ${result.pubkey}`);
|
|
124
180
|
}
|
|
125
181
|
catch (e) {
|
|
126
182
|
// CredentialsError carries either a single-line typo message or
|
|
@@ -136,6 +192,8 @@ export function buildProgram(opts = {}) {
|
|
|
136
192
|
.option("--agent <id>", "Which dist/<id>/ to push (defaults to the only built agent)")
|
|
137
193
|
.requiredOption("--bucket <numericId>", "DDC bucket id (decimal) owned by the substrate signer")
|
|
138
194
|
.option("--secret-phrase <phrase>", "Sr25519 substrate secret phrase for the DDC bucket owner (overrides $CEF_DDC_SECRET_PHRASE)")
|
|
195
|
+
.option("--access-token <token>", "DDC access token granted by the bucket owner, for pushing without the bucket's secret phrase (overrides $CEF_DDC_ACCESS_TOKEN)")
|
|
196
|
+
.option("--as-pubkey <hex>", "Agent Service pubkey (hex, as shown in ROC) to stamp into the manifest identity (agentServicePubkey + agentId <asPubkey>:<alias>). The DDC signing key is unrelated to AS identity, so pass it explicitly.")
|
|
139
197
|
.option("--endpoint <url>", "DDC blockchain endpoint (overrides --preset)")
|
|
140
198
|
.option("--preset <name>", "DDC network preset: MAINNET | TESTNET | DEVNET (default MAINNET)")
|
|
141
199
|
.option("--cdn <url>", "CDN endpoint override")
|
|
@@ -156,6 +214,12 @@ export function buildProgram(opts = {}) {
|
|
|
156
214
|
...(subOpts.secretPhrase !== undefined
|
|
157
215
|
? { secretPhrase: subOpts.secretPhrase }
|
|
158
216
|
: {}),
|
|
217
|
+
...(subOpts.accessToken !== undefined
|
|
218
|
+
? { accessToken: subOpts.accessToken }
|
|
219
|
+
: {}),
|
|
220
|
+
...(subOpts.asPubkey !== undefined
|
|
221
|
+
? { agentServicePubkey: subOpts.asPubkey }
|
|
222
|
+
: {}),
|
|
159
223
|
...(subOpts.endpoint !== undefined
|
|
160
224
|
? { endpoint: subOpts.endpoint }
|
|
161
225
|
: {}),
|
|
@@ -168,6 +232,70 @@ export function buildProgram(opts = {}) {
|
|
|
168
232
|
console.log(` agentId: ${result.agentId}`);
|
|
169
233
|
console.log(` bucket: ${result.bucketId}`);
|
|
170
234
|
console.log(` cid: ${result.cid}`);
|
|
235
|
+
console.log(` manifest: ${result.manifestCid}`);
|
|
236
|
+
console.log(` version: ${result.versionCid}`);
|
|
237
|
+
if (result.widgets.length > 0) {
|
|
238
|
+
console.log(` widgets: ${result.widgets.length} uploaded as directory DAGs`);
|
|
239
|
+
for (const w of result.widgets) {
|
|
240
|
+
console.log(` - ${w.id}: ${w.dirCid} (${w.fileCount} files)`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
catch (e) {
|
|
245
|
+
onError(e);
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
program
|
|
249
|
+
.command("deploy")
|
|
250
|
+
.description("Make an agent live: apply the deployments/ folder to the platform")
|
|
251
|
+
.option("--endpoint <url>", "Platform API base URL (overrides $CEF_ENDPOINT)")
|
|
252
|
+
.option("--agent <id>", "Which dist/<id>/ to read identity from (defaults to the only built agent)")
|
|
253
|
+
.option("--version <v>", 'Override the version of every applied record ("latest" allowed)')
|
|
254
|
+
.option("--author <who>", "Audit author (defaults to git user.email)")
|
|
255
|
+
.option("--note <text>", "Audit note recorded on the applied set")
|
|
256
|
+
.option("--dry-run", "Print the assembled deployment set without applying")
|
|
257
|
+
.option("--as-pubkey <hex>", "Agent Service pubkey for the composite agentId (overrides manifest)")
|
|
258
|
+
.option("--header <k:v>", "Extra request header (repeatable) — for an endpoint that requires auth", (val, acc) => {
|
|
259
|
+
acc.push(val);
|
|
260
|
+
return acc;
|
|
261
|
+
}, [])
|
|
262
|
+
.option("--out <dir>", "Output directory the build wrote to", "dist")
|
|
263
|
+
.option("--deployments <path>", "Deployment records: a directory (default) or a single set/record file", "deployments")
|
|
264
|
+
.action(async (subOpts) => {
|
|
265
|
+
try {
|
|
266
|
+
const endpoint = subOpts.endpoint ?? process.env.CEF_ENDPOINT ?? DEFAULT_ENDPOINT;
|
|
267
|
+
const extraHeaders = {};
|
|
268
|
+
for (const h of subOpts.header ?? []) {
|
|
269
|
+
const idx = h.indexOf(":");
|
|
270
|
+
if (idx === -1) {
|
|
271
|
+
throw new Error(`[cef deploy] --header must be "Key: Value" (got "${h}")`);
|
|
272
|
+
}
|
|
273
|
+
extraHeaders[h.slice(0, idx).trim()] = h.slice(idx + 1).trim();
|
|
274
|
+
}
|
|
275
|
+
const deployOpts = {
|
|
276
|
+
endpoint,
|
|
277
|
+
...(subOpts.agent !== undefined ? { agentId: subOpts.agent } : {}),
|
|
278
|
+
...(subOpts.version !== undefined ? { version: subOpts.version } : {}),
|
|
279
|
+
...(subOpts.author !== undefined ? { author: subOpts.author } : {}),
|
|
280
|
+
...(subOpts.note !== undefined ? { note: subOpts.note } : {}),
|
|
281
|
+
...(subOpts.dryRun !== undefined ? { dryRun: subOpts.dryRun } : {}),
|
|
282
|
+
...(subOpts.asPubkey !== undefined
|
|
283
|
+
? { agentServicePubkey: subOpts.asPubkey }
|
|
284
|
+
: {}),
|
|
285
|
+
...(Object.keys(extraHeaders).length > 0 ? { extraHeaders } : {}),
|
|
286
|
+
...(subOpts.out !== undefined ? { distDir: subOpts.out } : {}),
|
|
287
|
+
...(subOpts.deployments !== undefined
|
|
288
|
+
? { deploymentsPath: subOpts.deployments }
|
|
289
|
+
: {}),
|
|
290
|
+
...(opts.fetchImpl !== undefined ? { fetchImpl: opts.fetchImpl } : {}),
|
|
291
|
+
};
|
|
292
|
+
const result = await cefDeploy(deployOpts);
|
|
293
|
+
if (result.dryRun) {
|
|
294
|
+
console.log(`[dry-run] ${result.agentId} — would apply ${result.deployments.length} deployment(s): ${result.deployments.join(", ")}`);
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
console.log(`✓ Deployed ${result.agentId} — ${result.deployments.length} deployment(s) [${result.deployments.join(", ")}] (revision ${result.revision})`);
|
|
298
|
+
}
|
|
171
299
|
}
|
|
172
300
|
catch (e) {
|
|
173
301
|
onError(e);
|