@dam-agents/cli 0.2.18-rc1 → 0.2.18-rc2
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/dist/bin.js +23 -24
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -27867,11 +27867,13 @@ var agentDisconnectSlackInputSchema = idSchema.extend({
|
|
|
27867
27867
|
slackChannelId: external_exports.string().min(1).optional()
|
|
27868
27868
|
});
|
|
27869
27869
|
var agentKindSchema = external_exports.enum(["knowledge-base", "experiment"]);
|
|
27870
|
+
var AGENT_ID_RE = /^agent-[0-9a-f]{16}$/;
|
|
27871
|
+
var agentNameSchema = external_exports.string().min(1).refine((n) => !AGENT_ID_RE.test(n), {
|
|
27872
|
+
message: "agent name cannot have the shape of an agent ID"
|
|
27873
|
+
});
|
|
27870
27874
|
var agentCreateInputSchema = external_exports.object({
|
|
27871
27875
|
kbShareRoots: external_exports.array(external_exports.string().min(1)).min(1).max(20).optional(),
|
|
27872
|
-
name:
|
|
27873
|
-
message: "agent name cannot start with 'agent-' (reserved for IDs)"
|
|
27874
|
-
}),
|
|
27876
|
+
name: agentNameSchema,
|
|
27875
27877
|
templateId: external_exports.string().optional(),
|
|
27876
27878
|
image: external_exports.string().optional(),
|
|
27877
27879
|
description: external_exports.string().optional(),
|
|
@@ -28128,9 +28130,7 @@ var experimentIdInputSchema = external_exports.object({
|
|
|
28128
28130
|
id: external_exports.string().min(1)
|
|
28129
28131
|
});
|
|
28130
28132
|
var experimentSandboxCreateInputSchema = external_exports.object({
|
|
28131
|
-
name:
|
|
28132
|
-
message: "agent name cannot start with 'agent-' (reserved for IDs)"
|
|
28133
|
-
}),
|
|
28133
|
+
name: agentNameSchema,
|
|
28134
28134
|
templateId: external_exports.string().optional(),
|
|
28135
28135
|
image: external_exports.string().optional(),
|
|
28136
28136
|
description: external_exports.string().optional(),
|
|
@@ -28288,9 +28288,7 @@ var starterKitScheduleOverrideSchema = external_exports.object({
|
|
|
28288
28288
|
var starterKitApplyInputSchema = external_exports.object({
|
|
28289
28289
|
catalog: starterKitCatalogNameSchema,
|
|
28290
28290
|
kitId: starterKitIdSchema,
|
|
28291
|
-
name:
|
|
28292
|
-
message: "agent name cannot start with 'agent-' (reserved for IDs)"
|
|
28293
|
-
}),
|
|
28291
|
+
name: agentNameSchema,
|
|
28294
28292
|
templateId: external_exports.string().min(1).optional(),
|
|
28295
28293
|
connectionIds: external_exports.array(external_exports.string().min(1)).default([]),
|
|
28296
28294
|
slackChannelId: external_exports.string().min(1).optional(),
|
|
@@ -32867,7 +32865,6 @@ function printTrpcError(e2, host) {
|
|
|
32867
32865
|
}
|
|
32868
32866
|
|
|
32869
32867
|
// src/modules/agent/commands/create-helpers.ts
|
|
32870
|
-
var RESERVED_AGENT_PREFIX = "agent-";
|
|
32871
32868
|
function parseEnvFlag(values) {
|
|
32872
32869
|
const map3 = /* @__PURE__ */ new Map();
|
|
32873
32870
|
const duplicates = /* @__PURE__ */ new Set();
|
|
@@ -32887,7 +32884,7 @@ function parseEnvFlag(values) {
|
|
|
32887
32884
|
}
|
|
32888
32885
|
function validateAgentName(name) {
|
|
32889
32886
|
if (name.length === 0) return err2("empty");
|
|
32890
|
-
if (
|
|
32887
|
+
if (AGENT_ID_RE.test(name)) return err2("id-shape");
|
|
32891
32888
|
return ok2(void 0);
|
|
32892
32889
|
}
|
|
32893
32890
|
|
|
@@ -32910,7 +32907,10 @@ var EXIT_SIGINT = 130;
|
|
|
32910
32907
|
// src/modules/agent/commands/create.ts
|
|
32911
32908
|
var DEFAULT_TIMEOUT_SECONDS = 120;
|
|
32912
32909
|
function buildCreateCommand(deps) {
|
|
32913
|
-
return new Command("create").description("Create a new Agent from a template on the active host").argument(
|
|
32910
|
+
return new Command("create").description("Create a new Agent from a template on the active host").argument(
|
|
32911
|
+
"<name>",
|
|
32912
|
+
"Agent name (1+ chars; not `agent-` plus 16 hex characters, the shape of an ID)"
|
|
32913
|
+
).option(
|
|
32914
32914
|
"--server <url>",
|
|
32915
32915
|
"override the configured server URL for this call"
|
|
32916
32916
|
).option(
|
|
@@ -32946,9 +32946,9 @@ function buildCreateCommand(deps) {
|
|
|
32946
32946
|
async function runCreate(name, opts, deps) {
|
|
32947
32947
|
const nameCheck = validateAgentName(name);
|
|
32948
32948
|
if (!nameCheck.ok) {
|
|
32949
|
-
if (nameCheck.error === "
|
|
32949
|
+
if (nameCheck.error === "id-shape") {
|
|
32950
32950
|
process.stderr.write(
|
|
32951
|
-
`error: agent name \`${name}\`
|
|
32951
|
+
`error: agent name \`${name}\` has the shape of an agent ID (\`agent-\` and 16 hex characters)
|
|
32952
32952
|
`
|
|
32953
32953
|
);
|
|
32954
32954
|
} else {
|
|
@@ -34218,8 +34218,8 @@ async function runCreate2(opts, deps) {
|
|
|
34218
34218
|
validate(value) {
|
|
34219
34219
|
const check2 = validateAgentName(value ?? "");
|
|
34220
34220
|
if (check2.ok) return void 0;
|
|
34221
|
-
if (check2.error === "
|
|
34222
|
-
return "name cannot
|
|
34221
|
+
if (check2.error === "id-shape") {
|
|
34222
|
+
return "name cannot have the shape of an agent ID (`agent-` and 16 hex characters)";
|
|
34223
34223
|
}
|
|
34224
34224
|
return "name cannot be empty";
|
|
34225
34225
|
}
|
|
@@ -34664,11 +34664,10 @@ function errorReason2(e2) {
|
|
|
34664
34664
|
}
|
|
34665
34665
|
|
|
34666
34666
|
// src/modules/agent/services/agent-resolver.ts
|
|
34667
|
-
var AGENT_ID_PREFIX = "agent-";
|
|
34668
34667
|
function createAgentResolver(deps) {
|
|
34669
34668
|
return {
|
|
34670
34669
|
async resolve(ref) {
|
|
34671
|
-
if (
|
|
34670
|
+
if (AGENT_ID_RE.test(ref)) {
|
|
34672
34671
|
const got = await deps.agentService.get(ref);
|
|
34673
34672
|
if (!got.ok) return got;
|
|
34674
34673
|
if (got.value === null)
|
|
@@ -34772,7 +34771,7 @@ function buildDeleteCommand(deps) {
|
|
|
34772
34771
|
"emit { deleted, id, name } or { cancelled: true } as JSON"
|
|
34773
34772
|
).addHelpText(
|
|
34774
34773
|
"after",
|
|
34775
|
-
"\nExamples:\n dam agent delete my-agent\n dam agent delete agent-
|
|
34774
|
+
"\nExamples:\n dam agent delete my-agent\n dam agent delete agent-3f9c2b7e41d08a65 --yes\n"
|
|
34776
34775
|
).action(
|
|
34777
34776
|
async (ref, opts) => {
|
|
34778
34777
|
await runDelete(ref, opts, deps);
|
|
@@ -34854,7 +34853,7 @@ function buildGetCommand(deps) {
|
|
|
34854
34853
|
"override the configured server URL for this call"
|
|
34855
34854
|
).option("--json", "emit raw JSON instead of the default vertical layout").addHelpText(
|
|
34856
34855
|
"after",
|
|
34857
|
-
"\nExamples:\n dam agent get my-agent\n dam agent get agent-
|
|
34856
|
+
"\nExamples:\n dam agent get my-agent\n dam agent get agent-3f9c2b7e41d08a65 --json\n"
|
|
34858
34857
|
).action(async (ref, opts) => {
|
|
34859
34858
|
const host = await resolveActiveHost(deps, {
|
|
34860
34859
|
flag: opts.server ? { server: opts.server } : void 0,
|
|
@@ -41976,7 +41975,7 @@ function createProcessEnvReader() {
|
|
|
41976
41975
|
|
|
41977
41976
|
// src/modules/cli/infrastructure/package-version.ts
|
|
41978
41977
|
function readPackageVersion() {
|
|
41979
|
-
return true ? "0.2.18-
|
|
41978
|
+
return true ? "0.2.18-rc2" : DEV_VERSION;
|
|
41980
41979
|
}
|
|
41981
41980
|
|
|
41982
41981
|
// src/modules/cli/infrastructure/version-probe.ts
|
|
@@ -43559,7 +43558,7 @@ function buildListCommand5(deps) {
|
|
|
43559
43558
|
"override the configured server URL for this call"
|
|
43560
43559
|
).option("--json", "emit raw JSON instead of the default table").addHelpText(
|
|
43561
43560
|
"after",
|
|
43562
|
-
"\nExamples:\n dam network list my-agent\n dam network list agent-
|
|
43561
|
+
"\nExamples:\n dam network list my-agent\n dam network list agent-3f9c2b7e41d08a65 --json\n"
|
|
43563
43562
|
).action(async (ref, opts) => {
|
|
43564
43563
|
const host = await resolveActiveHost(deps, {
|
|
43565
43564
|
flag: opts.server ? { server: opts.server } : void 0,
|
|
@@ -45069,7 +45068,7 @@ function buildListCommand6(deps) {
|
|
|
45069
45068
|
"override the configured server URL for this call"
|
|
45070
45069
|
).option("--json", "emit raw JSON instead of the default table").addHelpText(
|
|
45071
45070
|
"after",
|
|
45072
|
-
"\nExamples:\n dam schedule list my-agent\n dam schedule list agent-
|
|
45071
|
+
"\nExamples:\n dam schedule list my-agent\n dam schedule list agent-3f9c2b7e41d08a65 --json\n"
|
|
45073
45072
|
).action(async (ref, opts) => {
|
|
45074
45073
|
const host = await resolveActiveHost(deps, {
|
|
45075
45074
|
flag: opts.server ? { server: opts.server } : void 0,
|
|
@@ -47080,7 +47079,7 @@ function buildMetricsCommand(deps) {
|
|
|
47080
47079
|
"override the configured server URL for this call"
|
|
47081
47080
|
).option("--json", "emit raw JSON instead of the default report").addHelpText(
|
|
47082
47081
|
"after",
|
|
47083
|
-
"\nExamples:\n dam metrics my-agent\n dam metrics my-agent --session sess-abc123\n dam metrics agent-
|
|
47082
|
+
"\nExamples:\n dam metrics my-agent\n dam metrics my-agent --session sess-abc123\n dam metrics agent-3f9c2b7e41d08a65 --since 168 --json\n"
|
|
47084
47083
|
).action(
|
|
47085
47084
|
async (ref, opts) => {
|
|
47086
47085
|
const host = await resolveActiveHost(deps, {
|
package/package.json
CHANGED