@dam-agents/cli 0.2.17-rc1 → 0.2.18-rc1
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 +2052 -1242
- package/package.json +3 -3
package/dist/bin.js
CHANGED
|
@@ -26748,319 +26748,170 @@ var liveEventSchema = external_exports.discriminatedUnion("topic", [
|
|
|
26748
26748
|
experimentId: external_exports.string().min(1),
|
|
26749
26749
|
agentId: external_exports.string().min(1)
|
|
26750
26750
|
}),
|
|
26751
|
+
external_exports.object({
|
|
26752
|
+
topic: external_exports.literal("attention"),
|
|
26753
|
+
agentId: external_exports.string().min(1)
|
|
26754
|
+
}),
|
|
26751
26755
|
external_exports.object({
|
|
26752
26756
|
topic: external_exports.literal("artifacts"),
|
|
26753
26757
|
artifactId: external_exports.string().min(1).optional(),
|
|
26754
26758
|
agentId: external_exports.string().min(1).optional()
|
|
26755
26759
|
})
|
|
26756
26760
|
]);
|
|
26757
|
-
var podSessionsNoticeSchema = external_exports.discriminatedUnion("topic", [
|
|
26758
|
-
external_exports.object({ topic: external_exports.literal("sync") }),
|
|
26759
|
-
external_exports.object({ topic: external_exports.literal("sessions"), agentId: external_exports.string().min(1) })
|
|
26760
|
-
]);
|
|
26761
26761
|
|
|
26762
|
-
// ../api-server-api/src/modules/
|
|
26763
|
-
var
|
|
26764
|
-
var
|
|
26765
|
-
|
|
26766
|
-
|
|
26767
|
-
|
|
26768
|
-
|
|
26769
|
-
|
|
26770
|
-
|
|
26771
|
-
|
|
26772
|
-
}
|
|
26773
|
-
|
|
26774
|
-
|
|
26775
|
-
|
|
26776
|
-
}
|
|
26777
|
-
|
|
26778
|
-
|
|
26779
|
-
|
|
26780
|
-
|
|
26781
|
-
|
|
26782
|
-
|
|
26783
|
-
|
|
26784
|
-
}
|
|
26785
|
-
|
|
26786
|
-
|
|
26787
|
-
|
|
26788
|
-
|
|
26789
|
-
}
|
|
26790
|
-
var
|
|
26791
|
-
|
|
26792
|
-
|
|
26793
|
-
|
|
26794
|
-
|
|
26795
|
-
|
|
26796
|
-
|
|
26797
|
-
|
|
26798
|
-
|
|
26799
|
-
|
|
26800
|
-
|
|
26801
|
-
|
|
26802
|
-
|
|
26803
|
-
|
|
26804
|
-
|
|
26805
|
-
|
|
26806
|
-
|
|
26807
|
-
|
|
26808
|
-
|
|
26809
|
-
|
|
26810
|
-
|
|
26811
|
-
|
|
26812
|
-
|
|
26813
|
-
|
|
26814
|
-
|
|
26815
|
-
|
|
26816
|
-
|
|
26817
|
-
|
|
26818
|
-
|
|
26819
|
-
|
|
26820
|
-
|
|
26821
|
-
|
|
26822
|
-
|
|
26823
|
-
|
|
26824
|
-
|
|
26825
|
-
|
|
26826
|
-
|
|
26827
|
-
|
|
26828
|
-
|
|
26829
|
-
|
|
26830
|
-
|
|
26831
|
-
|
|
26832
|
-
|
|
26833
|
-
|
|
26834
|
-
|
|
26835
|
-
|
|
26836
|
-
|
|
26837
|
-
|
|
26838
|
-
|
|
26839
|
-
|
|
26840
|
-
|
|
26841
|
-
|
|
26842
|
-
|
|
26843
|
-
|
|
26844
|
-
|
|
26845
|
-
|
|
26846
|
-
|
|
26847
|
-
|
|
26848
|
-
|
|
26849
|
-
|
|
26850
|
-
|
|
26851
|
-
|
|
26852
|
-
|
|
26853
|
-
|
|
26854
|
-
|
|
26855
|
-
|
|
26856
|
-
|
|
26857
|
-
|
|
26858
|
-
|
|
26859
|
-
|
|
26860
|
-
|
|
26861
|
-
|
|
26862
|
-
|
|
26863
|
-
|
|
26864
|
-
|
|
26865
|
-
}
|
|
26866
|
-
|
|
26867
|
-
|
|
26868
|
-
|
|
26869
|
-
|
|
26870
|
-
|
|
26871
|
-
|
|
26872
|
-
|
|
26873
|
-
|
|
26874
|
-
|
|
26875
|
-
|
|
26876
|
-
|
|
26877
|
-
|
|
26878
|
-
|
|
26879
|
-
|
|
26880
|
-
|
|
26881
|
-
}
|
|
26882
|
-
|
|
26883
|
-
|
|
26884
|
-
|
|
26885
|
-
}
|
|
26886
|
-
|
|
26887
|
-
var skillSetApplyInputSchema = external_exports.object({
|
|
26888
|
-
agentId: external_exports.string().min(1),
|
|
26889
|
-
setIds: external_exports.array(external_exports.string().min(1)).min(1).max(50)
|
|
26890
|
-
});
|
|
26891
|
-
var skillSetSkipReasonSchema = external_exports.enum([
|
|
26892
|
-
"source-not-connected",
|
|
26893
|
-
"source-unreadable",
|
|
26894
|
-
"not-in-source"
|
|
26895
|
-
]);
|
|
26896
|
-
var skillSetApplyResultSchema = external_exports.object({
|
|
26897
|
-
installed: external_exports.array(skillRefSchema),
|
|
26898
|
-
added: external_exports.number().int().nonnegative(),
|
|
26899
|
-
skipped: external_exports.array(
|
|
26900
|
-
skillSetEntrySchema.extend({ reason: skillSetSkipReasonSchema })
|
|
26901
|
-
)
|
|
26902
|
-
});
|
|
26903
|
-
var MAX_SKILL_BATCH_ENTRIES = 500;
|
|
26904
|
-
var skillApplyBatchInputSchema = external_exports.object({
|
|
26905
|
-
agentId: external_exports.string().min(1),
|
|
26906
|
-
install: external_exports.array(
|
|
26907
|
-
external_exports.object({
|
|
26908
|
-
source: external_exports.string().url(),
|
|
26909
|
-
name: external_exports.string().min(1),
|
|
26910
|
-
version: external_exports.string().min(1),
|
|
26911
|
-
contentHash: external_exports.string().optional()
|
|
26912
|
-
})
|
|
26913
|
-
).max(MAX_SKILL_BATCH_ENTRIES).default([]),
|
|
26914
|
-
uninstall: external_exports.array(
|
|
26915
|
-
external_exports.object({
|
|
26916
|
-
source: external_exports.string().url(),
|
|
26917
|
-
name: external_exports.string().min(1)
|
|
26918
|
-
})
|
|
26919
|
-
).max(MAX_SKILL_BATCH_ENTRIES).default([])
|
|
26920
|
-
}).refine(
|
|
26921
|
-
(v2) => v2.install.length + v2.uninstall.length <= MAX_SKILL_BATCH_ENTRIES,
|
|
26922
|
-
{
|
|
26923
|
-
message: `one batch carries at most ${MAX_SKILL_BATCH_ENTRIES} skills, install and uninstall combined`
|
|
26762
|
+
// ../api-server-api/src/modules/connections/providers.ts
|
|
26763
|
+
var DEFAULT_ENV_PLACEHOLDER = "dummy-placeholder";
|
|
26764
|
+
var IBM_LITELLM_HOST = "ete-litellm.ai-models.vpc.res.ibm.com";
|
|
26765
|
+
var IBM_LITELLM_BASE_URL = `https://${IBM_LITELLM_HOST}`;
|
|
26766
|
+
function ibmLitellmEnvMappings() {
|
|
26767
|
+
return [
|
|
26768
|
+
{ envName: "ANTHROPIC_AUTH_TOKEN", placeholder: "sk-dummy" },
|
|
26769
|
+
{ envName: "ANTHROPIC_BASE_URL", placeholder: IBM_LITELLM_BASE_URL },
|
|
26770
|
+
{ envName: "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS", placeholder: "1" },
|
|
26771
|
+
{ envName: "OPENAI_PROXY_URL", placeholder: IBM_LITELLM_BASE_URL },
|
|
26772
|
+
{ envName: "OPENAI_PROXY_MODEL", placeholder: "aws/claude-opus-4-8" },
|
|
26773
|
+
{ envName: "OPENAI_PROXY_CONTEXT_WINDOW", placeholder: "200000" },
|
|
26774
|
+
{ envName: "OPENAI_PROXY_MAX_TOKENS", placeholder: "8192" },
|
|
26775
|
+
{ envName: "OPENAI_API_KEY", placeholder: DEFAULT_ENV_PLACEHOLDER },
|
|
26776
|
+
{ envName: "OPENAI_BASE_URL", placeholder: IBM_LITELLM_BASE_URL },
|
|
26777
|
+
{ envName: "OPENAI_MODEL", placeholder: "gpt-5.5" },
|
|
26778
|
+
{ envName: "BOB_GATEWAY_URL", placeholder: IBM_LITELLM_BASE_URL },
|
|
26779
|
+
{ envName: "BOBSHELL_API_KEY", placeholder: DEFAULT_ENV_PLACEHOLDER }
|
|
26780
|
+
];
|
|
26781
|
+
}
|
|
26782
|
+
function openaiEnvMappings() {
|
|
26783
|
+
return [
|
|
26784
|
+
{ envName: "OPENAI_API_KEY", placeholder: DEFAULT_ENV_PLACEHOLDER },
|
|
26785
|
+
{ envName: "OPENAI_BASE_URL", placeholder: "https://api.openai.com/v1" }
|
|
26786
|
+
];
|
|
26787
|
+
}
|
|
26788
|
+
var BOB_HOST = "api.us-east.bob.ibm.com";
|
|
26789
|
+
var BOB_BASE_URL = `https://${BOB_HOST}`;
|
|
26790
|
+
var BOB_PLACEHOLDER = "dummy-placeholder";
|
|
26791
|
+
function bobEnvMappings(pins = {}) {
|
|
26792
|
+
const out = [
|
|
26793
|
+
{ envName: "BOBSHELL_API_KEY", placeholder: BOB_PLACEHOLDER },
|
|
26794
|
+
{ envName: "BOB_DEFAULT_GATEWAY_URL", placeholder: BOB_BASE_URL }
|
|
26795
|
+
];
|
|
26796
|
+
const push = (envName, value) => {
|
|
26797
|
+
const trimmed = value?.trim();
|
|
26798
|
+
if (trimmed) out.push({ envName, placeholder: trimmed });
|
|
26799
|
+
};
|
|
26800
|
+
push("BOB_SHELL_MODEL", pins.model);
|
|
26801
|
+
push("BOB_INSTANCE_ID", pins.agentId);
|
|
26802
|
+
push("BOB_TEAM_ID", pins.teamId);
|
|
26803
|
+
push("BOB_MAX_COINS", pins.maxCost);
|
|
26804
|
+
push("BOB_CHAT_MODE", pins.chatMode);
|
|
26805
|
+
return out;
|
|
26806
|
+
}
|
|
26807
|
+
var PROVIDERS = {
|
|
26808
|
+
anthropic: {
|
|
26809
|
+
id: "anthropic",
|
|
26810
|
+
displayName: "Anthropic",
|
|
26811
|
+
hostPattern: "api.anthropic.com",
|
|
26812
|
+
modes: [
|
|
26813
|
+
{
|
|
26814
|
+
key: "oauth",
|
|
26815
|
+
label: "OAuth Token",
|
|
26816
|
+
templateId: "anthropic-oauth",
|
|
26817
|
+
tokenPrefix: "sk-ant-oat",
|
|
26818
|
+
defaultEnvMappings: [
|
|
26819
|
+
{
|
|
26820
|
+
envName: "CLAUDE_CODE_OAUTH_TOKEN",
|
|
26821
|
+
placeholder: DEFAULT_ENV_PLACEHOLDER
|
|
26822
|
+
}
|
|
26823
|
+
]
|
|
26824
|
+
},
|
|
26825
|
+
{
|
|
26826
|
+
key: "api-key",
|
|
26827
|
+
label: "API Key",
|
|
26828
|
+
templateId: "anthropic",
|
|
26829
|
+
tokenPrefix: "sk-ant-api",
|
|
26830
|
+
isDefault: true,
|
|
26831
|
+
defaultEnvMappings: [
|
|
26832
|
+
{
|
|
26833
|
+
envName: "ANTHROPIC_API_KEY",
|
|
26834
|
+
placeholder: DEFAULT_ENV_PLACEHOLDER
|
|
26835
|
+
}
|
|
26836
|
+
],
|
|
26837
|
+
injection: { headerName: "x-api-key", valueFormat: "{value}" }
|
|
26838
|
+
}
|
|
26839
|
+
]
|
|
26840
|
+
},
|
|
26841
|
+
"ibm-litellm": {
|
|
26842
|
+
id: "ibm-litellm",
|
|
26843
|
+
displayName: "IBM LiteLLM ETE Proxy",
|
|
26844
|
+
hostPattern: IBM_LITELLM_HOST,
|
|
26845
|
+
modes: [
|
|
26846
|
+
{
|
|
26847
|
+
key: "api-key",
|
|
26848
|
+
label: "API Token",
|
|
26849
|
+
templateId: "ibm-litellm",
|
|
26850
|
+
defaultEnvMappings: ibmLitellmEnvMappings()
|
|
26851
|
+
}
|
|
26852
|
+
]
|
|
26853
|
+
},
|
|
26854
|
+
openai: {
|
|
26855
|
+
id: "openai",
|
|
26856
|
+
displayName: "OpenAI",
|
|
26857
|
+
hostPattern: "api.openai.com",
|
|
26858
|
+
pathPattern: "/v1/*",
|
|
26859
|
+
modes: [
|
|
26860
|
+
{
|
|
26861
|
+
key: "api-key",
|
|
26862
|
+
label: "API Key",
|
|
26863
|
+
templateId: "openai",
|
|
26864
|
+
defaultEnvMappings: openaiEnvMappings()
|
|
26865
|
+
}
|
|
26866
|
+
]
|
|
26867
|
+
},
|
|
26868
|
+
bob: {
|
|
26869
|
+
id: "bob",
|
|
26870
|
+
displayName: "Bob Shell",
|
|
26871
|
+
hostPattern: BOB_HOST,
|
|
26872
|
+
modes: [
|
|
26873
|
+
{
|
|
26874
|
+
key: "api-key",
|
|
26875
|
+
label: "API Key",
|
|
26876
|
+
templateId: "bob",
|
|
26877
|
+
defaultEnvMappings: bobEnvMappings(),
|
|
26878
|
+
injection: {
|
|
26879
|
+
headerName: "Authorization",
|
|
26880
|
+
valueFormat: "Apikey {value}"
|
|
26881
|
+
},
|
|
26882
|
+
extraInjections: [
|
|
26883
|
+
{ headerName: "X-Bobshell-Internal", queryParamName: "key" }
|
|
26884
|
+
]
|
|
26885
|
+
}
|
|
26886
|
+
]
|
|
26924
26887
|
}
|
|
26888
|
+
};
|
|
26889
|
+
var PROVIDER_PRESET_TYPES = Object.keys(
|
|
26890
|
+
PROVIDERS
|
|
26925
26891
|
);
|
|
26926
|
-
|
|
26927
|
-
|
|
26928
|
-
}
|
|
26929
|
-
var
|
|
26930
|
-
|
|
26931
|
-
|
|
26932
|
-
|
|
26933
|
-
|
|
26934
|
-
name: external_exports.string().min(1)
|
|
26935
|
-
});
|
|
26936
|
-
var skillReadLocalInputSchema = external_exports.object({
|
|
26937
|
-
agentId: external_exports.string().min(1),
|
|
26938
|
-
name: external_exports.string().min(1)
|
|
26939
|
-
});
|
|
26940
|
-
var skillLocalFilesSchema = external_exports.object({
|
|
26941
|
-
dir: external_exports.string(),
|
|
26942
|
-
files: external_exports.array(
|
|
26943
|
-
external_exports.object({
|
|
26944
|
-
relPath: external_exports.string(),
|
|
26945
|
-
content: external_exports.string(),
|
|
26946
|
-
base64: external_exports.literal(true).optional()
|
|
26947
|
-
})
|
|
26892
|
+
function isProviderPresetType(type) {
|
|
26893
|
+
return type in PROVIDERS;
|
|
26894
|
+
}
|
|
26895
|
+
var TEMPLATE_TO_PROVIDER = new Map(
|
|
26896
|
+
PROVIDER_PRESET_TYPES.flatMap(
|
|
26897
|
+
(type) => PROVIDERS[type].modes.map(
|
|
26898
|
+
(mode) => [mode.templateId, type]
|
|
26899
|
+
)
|
|
26948
26900
|
)
|
|
26949
|
-
});
|
|
26950
|
-
var skillPublishInputSchema = external_exports.object({
|
|
26951
|
-
agentId: external_exports.string().min(1),
|
|
26952
|
-
sourceId: external_exports.string().min(1),
|
|
26953
|
-
name: external_exports.string().min(1),
|
|
26954
|
-
title: external_exports.string().optional(),
|
|
26955
|
-
body: external_exports.string().optional()
|
|
26956
|
-
});
|
|
26957
|
-
var skillCreateLocalInputSchema = external_exports.object({
|
|
26958
|
-
agentId: external_exports.string().min(1),
|
|
26959
|
-
skills: external_exports.array(
|
|
26960
|
-
external_exports.object({
|
|
26961
|
-
name: external_exports.string().min(1).max(128),
|
|
26962
|
-
content: external_exports.string().max(2 * 1024 * 1024)
|
|
26963
|
-
})
|
|
26964
|
-
).min(1).max(50)
|
|
26965
|
-
}).refine(
|
|
26966
|
-
(v2) => v2.skills.reduce((n, s) => n + s.content.length, 0) <= 5 * 1024 * 1024,
|
|
26967
|
-
"batch exceeds 5 MB"
|
|
26968
26901
|
);
|
|
26969
|
-
|
|
26970
|
-
|
|
26971
|
-
|
|
26972
|
-
|
|
26973
|
-
|
|
26974
|
-
|
|
26975
|
-
|
|
26976
|
-
|
|
26977
|
-
|
|
26978
|
-
|
|
26979
|
-
|
|
26980
|
-
|
|
26981
|
-
|
|
26982
|
-
});
|
|
26983
|
-
var envVarConfigMapSchema = external_exports.object({
|
|
26984
|
-
name: external_exports.string(),
|
|
26985
|
-
value: external_exports.string()
|
|
26986
|
-
});
|
|
26987
|
-
var skillSourceSeedSchema = external_exports.object({
|
|
26988
|
-
name: external_exports.string(),
|
|
26989
|
-
gitUrl: external_exports.string(),
|
|
26990
|
-
path: skillSourcePathSchema.optional()
|
|
26991
|
-
});
|
|
26992
|
-
var templateCategorySchema = external_exports.enum(["harness", "preconfigured"]).default("harness");
|
|
26993
|
-
var harnessFamilySchema = external_exports.enum([
|
|
26994
|
-
"claude-code",
|
|
26995
|
-
"codex",
|
|
26996
|
-
"pi",
|
|
26997
|
-
"bob"
|
|
26998
|
-
]);
|
|
26999
|
-
var templateSpecSchema = external_exports.object({
|
|
27000
|
-
version: external_exports.string(),
|
|
27001
|
-
image: external_exports.string(),
|
|
27002
|
-
name: external_exports.string().optional(),
|
|
27003
|
-
description: external_exports.string().optional(),
|
|
27004
|
-
category: templateCategorySchema,
|
|
27005
|
-
harness: harnessFamilySchema.optional(),
|
|
27006
|
-
tags: external_exports.array(external_exports.string()).optional(),
|
|
27007
|
-
docsUrl: external_exports.string().optional(),
|
|
27008
|
-
releaseNotesUrl: external_exports.string().optional(),
|
|
27009
|
-
setupNote: external_exports.object({ title: external_exports.string(), body: external_exports.string() }).optional(),
|
|
27010
|
-
experimental: external_exports.boolean().optional(),
|
|
27011
|
-
mounts: external_exports.array(mountSchema).optional(),
|
|
27012
|
-
init: external_exports.string().optional(),
|
|
27013
|
-
env: external_exports.array(envVarConfigMapSchema).optional(),
|
|
27014
|
-
resources: resourcesSchema.optional(),
|
|
27015
|
-
imagePullPolicy: external_exports.string().optional(),
|
|
27016
|
-
imagePullSecretRef: external_exports.string().optional(),
|
|
27017
|
-
hibernationTimeout: external_exports.string().optional(),
|
|
27018
|
-
storageSize: external_exports.string().optional(),
|
|
27019
|
-
storageClass: external_exports.string().optional(),
|
|
27020
|
-
backend: external_exports.object({
|
|
27021
|
-
type: external_exports.enum(["container", "vm"]),
|
|
27022
|
-
vm: external_exports.object({}).passthrough().optional()
|
|
27023
|
-
}).optional(),
|
|
27024
|
-
runtimeClassName: external_exports.string().optional(),
|
|
27025
|
-
nodeSelector: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
27026
|
-
skillSources: external_exports.array(skillSourceSeedSchema).optional()
|
|
27027
|
-
}).passthrough();
|
|
27028
|
-
|
|
27029
|
-
// ../api-server-api/src/modules/repos/schemas.ts
|
|
27030
|
-
var repoSchema = external_exports.object({
|
|
27031
|
-
id: external_exports.string().min(1),
|
|
27032
|
-
name: external_exports.string().min(1),
|
|
27033
|
-
url: external_exports.url(),
|
|
27034
|
-
ref: external_exports.string().min(1).optional(),
|
|
27035
|
-
description: external_exports.string().optional(),
|
|
27036
|
-
compatibleTemplates: external_exports.array(external_exports.string()).default([])
|
|
27037
|
-
});
|
|
27038
|
-
|
|
27039
|
-
// ../api-server-api/src/modules/invocations/schemas.ts
|
|
27040
|
-
var DEFAULT_INVOCATION_TTL_MS = 60 * 60 * 1e3;
|
|
27041
|
-
var MIN_INVOCATION_TTL_MS = 60 * 1e3;
|
|
27042
|
-
var MAX_INVOCATION_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
27043
|
-
var spawnInvocationRequestSchema = external_exports.object({
|
|
27044
|
-
image: external_exports.string().min(1).optional(),
|
|
27045
|
-
templateId: external_exports.string().min(1).optional(),
|
|
27046
|
-
connections: external_exports.array(external_exports.string().min(1)).optional(),
|
|
27047
|
-
prompt: external_exports.string().min(1),
|
|
27048
|
-
schema: external_exports.unknown(),
|
|
27049
|
-
ttlMs: external_exports.number().int().min(MIN_INVOCATION_TTL_MS).max(MAX_INVOCATION_TTL_MS).optional(),
|
|
27050
|
-
memory: external_exports.string().regex(/^\d+(Mi|Gi)$/, "memory must look like '512Mi' or '4Gi'").optional(),
|
|
27051
|
-
cpu: external_exports.string().regex(/^\d+(\.\d+)?m?$/, "cpu must look like '2', '0.5' or '500m'").optional(),
|
|
27052
|
-
experimentSpanId: external_exports.string().min(1).max(300).optional()
|
|
27053
|
-
}).refine((d2) => d2.image !== void 0 || d2.templateId !== void 0, {
|
|
27054
|
-
message: "either image or templateId is required"
|
|
27055
|
-
});
|
|
27056
|
-
var spawnInvocationResponseSchema = external_exports.object({
|
|
27057
|
-
id: external_exports.string().min(1)
|
|
27058
|
-
});
|
|
27059
|
-
var invocationViewSchema = external_exports.object({
|
|
27060
|
-
status: external_exports.enum(["running", "done", "failed"]),
|
|
27061
|
-
result: external_exports.unknown(),
|
|
27062
|
-
errorReason: external_exports.string().optional()
|
|
27063
|
-
});
|
|
26902
|
+
var PROVIDER_TEMPLATE_IDS = new Set(
|
|
26903
|
+
TEMPLATE_TO_PROVIDER.keys()
|
|
26904
|
+
);
|
|
26905
|
+
function providerTypeForTemplateId(templateId) {
|
|
26906
|
+
return TEMPLATE_TO_PROVIDER.get(templateId) ?? null;
|
|
26907
|
+
}
|
|
26908
|
+
function templateIdForProvider(type, value) {
|
|
26909
|
+
const modes = PROVIDERS[type].modes;
|
|
26910
|
+
const matched = modes.find(
|
|
26911
|
+
(mode) => mode.tokenPrefix !== void 0 && value.startsWith(mode.tokenPrefix)
|
|
26912
|
+
);
|
|
26913
|
+
return (matched ?? modes.find((mode) => mode.isDefault) ?? modes[0]).templateId;
|
|
26914
|
+
}
|
|
27064
26915
|
|
|
27065
26916
|
// ../agent-runtime-api/src/modules/files/schemas.ts
|
|
27066
26917
|
var pathSchema = external_exports.string().min(1);
|
|
@@ -27117,6 +26968,7 @@ var podSessionSchema = external_exports.object({
|
|
|
27117
26968
|
title: external_exports.string().nullable(),
|
|
27118
26969
|
scheduleId: external_exports.string().nullable(),
|
|
27119
26970
|
experimentId: external_exports.string().nullable(),
|
|
26971
|
+
initialization: external_exports.boolean().optional(),
|
|
27120
26972
|
threadTs: external_exports.string().nullable(),
|
|
27121
26973
|
seenAt: external_exports.string().nullable(),
|
|
27122
26974
|
runStartedAt: external_exports.string().nullable(),
|
|
@@ -27142,14 +26994,14 @@ var sessionDirectoryReportSchema = external_exports.object({
|
|
|
27142
26994
|
});
|
|
27143
26995
|
|
|
27144
26996
|
// ../agent-runtime-api/src/modules/skills/schemas.ts
|
|
27145
|
-
var
|
|
26997
|
+
var skillInstallInputSchema = external_exports.object({
|
|
27146
26998
|
sourceUrl: external_exports.string().min(1),
|
|
27147
26999
|
name: external_exports.string().min(1),
|
|
27148
27000
|
version: external_exports.string().min(1),
|
|
27149
27001
|
skillPaths: external_exports.array(external_exports.string().min(1)).min(1),
|
|
27150
27002
|
path: external_exports.string().optional()
|
|
27151
27003
|
});
|
|
27152
|
-
var
|
|
27004
|
+
var skillUninstallInputSchema = external_exports.object({
|
|
27153
27005
|
name: external_exports.string().min(1),
|
|
27154
27006
|
skillPaths: external_exports.array(external_exports.string().min(1)).min(1)
|
|
27155
27007
|
});
|
|
@@ -27157,7 +27009,7 @@ var skillScanInputSchema = external_exports.object({
|
|
|
27157
27009
|
source: external_exports.string().min(1),
|
|
27158
27010
|
path: external_exports.string().optional()
|
|
27159
27011
|
});
|
|
27160
|
-
var
|
|
27012
|
+
var skillPublishInputSchema = external_exports.object({
|
|
27161
27013
|
name: external_exports.string().min(1),
|
|
27162
27014
|
owner: external_exports.string().min(1),
|
|
27163
27015
|
repo: external_exports.string().min(1),
|
|
@@ -27165,10 +27017,10 @@ var skillPublishInputSchema2 = external_exports.object({
|
|
|
27165
27017
|
body: external_exports.string(),
|
|
27166
27018
|
path: external_exports.string().optional()
|
|
27167
27019
|
});
|
|
27168
|
-
var
|
|
27020
|
+
var skillListLocalInputSchema = external_exports.object({
|
|
27169
27021
|
hashNames: external_exports.array(external_exports.string()).optional()
|
|
27170
27022
|
});
|
|
27171
|
-
var
|
|
27023
|
+
var skillReadLocalInputSchema = external_exports.object({
|
|
27172
27024
|
name: external_exports.string().min(1)
|
|
27173
27025
|
});
|
|
27174
27026
|
var skillReadPullRequestInputSchema = external_exports.object({
|
|
@@ -27181,7 +27033,7 @@ var skillReadSkillFileInputSchema = external_exports.object({
|
|
|
27181
27033
|
version: external_exports.string().min(1),
|
|
27182
27034
|
dir: external_exports.string().min(1)
|
|
27183
27035
|
});
|
|
27184
|
-
var
|
|
27036
|
+
var skillDeleteLocalInputSchema = external_exports.object({
|
|
27185
27037
|
name: external_exports.string().min(1)
|
|
27186
27038
|
});
|
|
27187
27039
|
var skillWriteLocalInputSchema = external_exports.object({
|
|
@@ -27196,6 +27048,97 @@ var skillWriteLocalInputSchema = external_exports.object({
|
|
|
27196
27048
|
// ../agent-runtime-api/src/modules/skills/source-roots.ts
|
|
27197
27049
|
var STAGED_SKILLS_DIR = "/usr/local/share/dam-skills";
|
|
27198
27050
|
|
|
27051
|
+
// ../agent-runtime-api/src/modules/skills/git-url.ts
|
|
27052
|
+
var BROWSE_MARKERS = ["tree", "blob"];
|
|
27053
|
+
var DEFAULT_PORTS = ["80", "443"];
|
|
27054
|
+
var GITHUB_HOST = "github.com";
|
|
27055
|
+
function normalizeGitUrl(input) {
|
|
27056
|
+
const trimmed = input.trim();
|
|
27057
|
+
if (trimmed.length === 0) return null;
|
|
27058
|
+
const url2 = parseUrl(
|
|
27059
|
+
/^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`
|
|
27060
|
+
);
|
|
27061
|
+
if (!url2) return null;
|
|
27062
|
+
if (url2.protocol !== "https:" && url2.protocol !== "http:") return null;
|
|
27063
|
+
url2.protocol = "https:";
|
|
27064
|
+
url2.search = "";
|
|
27065
|
+
url2.hash = "";
|
|
27066
|
+
url2.username = "";
|
|
27067
|
+
url2.password = "";
|
|
27068
|
+
if (DEFAULT_PORTS.includes(url2.port)) url2.port = "";
|
|
27069
|
+
if (url2.hostname === `www.${GITHUB_HOST}`) url2.hostname = GITHUB_HOST;
|
|
27070
|
+
if (url2.hostname.length === 0) return null;
|
|
27071
|
+
const isGithub = url2.hostname === GITHUB_HOST;
|
|
27072
|
+
const segments = url2.pathname.split("/").filter((s) => s.length > 0);
|
|
27073
|
+
const browsed = splitBrowseUrl(segments);
|
|
27074
|
+
const repoSegments = stripRepoSuffix(
|
|
27075
|
+
isGithub ? browsed.repoSegments.slice(0, 2).map((s) => s.toLowerCase()) : browsed.repoSegments
|
|
27076
|
+
);
|
|
27077
|
+
if (repoSegments.length < 2) return null;
|
|
27078
|
+
url2.pathname = `/${repoSegments.join("/")}`;
|
|
27079
|
+
const path2 = browsed.path && decodePath(browsed.path);
|
|
27080
|
+
return {
|
|
27081
|
+
gitUrl: url2.toString().replace(/\/$/, ""),
|
|
27082
|
+
...path2 ? { path: path2 } : {},
|
|
27083
|
+
...browsed.ref !== void 0 ? { ref: browsed.ref } : {}
|
|
27084
|
+
};
|
|
27085
|
+
}
|
|
27086
|
+
function canonicalSourceLocation(gitUrl, path2) {
|
|
27087
|
+
const normalized = normalizeGitUrl(gitUrl);
|
|
27088
|
+
if (!normalized) return null;
|
|
27089
|
+
const resolved = path2?.trim() || normalized.path;
|
|
27090
|
+
return {
|
|
27091
|
+
gitUrl: normalized.gitUrl,
|
|
27092
|
+
...resolved ? { path: resolved } : {}
|
|
27093
|
+
};
|
|
27094
|
+
}
|
|
27095
|
+
function parseUrl(candidate) {
|
|
27096
|
+
try {
|
|
27097
|
+
return new URL(candidate);
|
|
27098
|
+
} catch {
|
|
27099
|
+
return null;
|
|
27100
|
+
}
|
|
27101
|
+
}
|
|
27102
|
+
function decodePath(path2) {
|
|
27103
|
+
const decoded = [];
|
|
27104
|
+
for (const segment of path2.split("/")) {
|
|
27105
|
+
let value;
|
|
27106
|
+
try {
|
|
27107
|
+
value = decodeURIComponent(segment);
|
|
27108
|
+
} catch {
|
|
27109
|
+
return null;
|
|
27110
|
+
}
|
|
27111
|
+
if (value === "" || value === "." || value === "..") return null;
|
|
27112
|
+
if (value.includes("/") || value.includes("\\") || value.includes("\0")) {
|
|
27113
|
+
return null;
|
|
27114
|
+
}
|
|
27115
|
+
decoded.push(value);
|
|
27116
|
+
}
|
|
27117
|
+
return decoded.join("/");
|
|
27118
|
+
}
|
|
27119
|
+
function splitBrowseUrl(segments) {
|
|
27120
|
+
const marker = segments.findIndex(
|
|
27121
|
+
(s, i) => i >= 2 && BROWSE_MARKERS.includes(s)
|
|
27122
|
+
);
|
|
27123
|
+
if (marker === -1 || marker + 1 >= segments.length) {
|
|
27124
|
+
return { repoSegments: segments };
|
|
27125
|
+
}
|
|
27126
|
+
const before = segments.slice(0, marker);
|
|
27127
|
+
const rest = segments.slice(marker + 2);
|
|
27128
|
+
const dir = segments[marker] === "blob" ? rest.slice(0, -1) : rest;
|
|
27129
|
+
return {
|
|
27130
|
+
repoSegments: before[before.length - 1] === "-" ? before.slice(0, -1) : before,
|
|
27131
|
+
...dir.length > 0 ? { path: dir.join("/") } : {},
|
|
27132
|
+
ref: segments[marker + 1]
|
|
27133
|
+
};
|
|
27134
|
+
}
|
|
27135
|
+
function stripRepoSuffix(segments) {
|
|
27136
|
+
if (segments.length === 0) return segments;
|
|
27137
|
+
const last = segments[segments.length - 1].replace(/\.git$/, "");
|
|
27138
|
+
if (last.length === 0) return segments.slice(0, -1);
|
|
27139
|
+
return [...segments.slice(0, -1), last];
|
|
27140
|
+
}
|
|
27141
|
+
|
|
27199
27142
|
// ../agent-runtime-api/src/modules/workspace/paths.ts
|
|
27200
27143
|
var AGENT_HOME_DIR = "/home/agent";
|
|
27201
27144
|
var AGENT_WORK_DIR = `${AGENT_HOME_DIR}/work`;
|
|
@@ -27238,6 +27181,7 @@ var eventKind = external_exports.enum([
|
|
|
27238
27181
|
"workspace-seed",
|
|
27239
27182
|
"workspace-command",
|
|
27240
27183
|
"experiment-execute",
|
|
27184
|
+
"initialization",
|
|
27241
27185
|
"harness-config"
|
|
27242
27186
|
]);
|
|
27243
27187
|
var mergeMode = external_exports.enum([
|
|
@@ -27259,10 +27203,20 @@ var egressAllowContribution = external_exports.object({
|
|
|
27259
27203
|
port: egressPort,
|
|
27260
27204
|
pathPattern: external_exports.string().optional()
|
|
27261
27205
|
});
|
|
27206
|
+
var anchoredPathSegments = /^\/(?:[A-Za-z0-9._~-]+\/)*$/;
|
|
27207
|
+
var anchoredPath = external_exports.string().regex(anchoredPathSegments).refine(
|
|
27208
|
+
(p2) => p2.split("/").every((seg) => seg !== "." && seg !== ".."),
|
|
27209
|
+
"path segments must not be relative"
|
|
27210
|
+
);
|
|
27211
|
+
var pathRewrite = external_exports.object({
|
|
27212
|
+
prefix: anchoredPath,
|
|
27213
|
+
replacement: anchoredPath
|
|
27214
|
+
});
|
|
27262
27215
|
var egressInjectContribution = external_exports.object({
|
|
27263
27216
|
kind: external_exports.literal("egress-inject"),
|
|
27264
27217
|
host: external_exports.string().min(1),
|
|
27265
27218
|
pathPattern: external_exports.string().optional(),
|
|
27219
|
+
pathRewrites: external_exports.array(pathRewrite).min(1).max(8).optional(),
|
|
27266
27220
|
headerName: external_exports.string().min(1),
|
|
27267
27221
|
valueFormat: external_exports.string().min(1),
|
|
27268
27222
|
encoding: external_exports.literal("basic-x-access-token").optional(),
|
|
@@ -27304,7 +27258,10 @@ var triggerEventPayload = external_exports.object({
|
|
|
27304
27258
|
scheduleId: external_exports.string().min(1),
|
|
27305
27259
|
task: external_exports.string().min(1),
|
|
27306
27260
|
sessionMode: external_exports.enum(["continuous", "fresh"]).optional(),
|
|
27307
|
-
mcpServers: external_exports.array(external_exports.unknown()).optional()
|
|
27261
|
+
mcpServers: external_exports.array(external_exports.unknown()).optional(),
|
|
27262
|
+
precheck: external_exports.string().min(1).optional(),
|
|
27263
|
+
fireAt: external_exports.string().datetime({ offset: true }).optional(),
|
|
27264
|
+
lastRunAt: external_exports.string().datetime({ offset: true }).optional()
|
|
27308
27265
|
});
|
|
27309
27266
|
var triggerEvent = external_exports.object({
|
|
27310
27267
|
id: external_exports.string().min(1),
|
|
@@ -27313,6 +27270,12 @@ var triggerEvent = external_exports.object({
|
|
|
27313
27270
|
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27314
27271
|
payload: triggerEventPayload
|
|
27315
27272
|
});
|
|
27273
|
+
var eventOutcome = external_exports.enum(["ok", "declined", "failed"]);
|
|
27274
|
+
var eventReportInput = external_exports.object({
|
|
27275
|
+
eventId: external_exports.string().min(1),
|
|
27276
|
+
outcome: eventOutcome,
|
|
27277
|
+
detail: external_exports.string().max(2e3).optional()
|
|
27278
|
+
});
|
|
27316
27279
|
var scheduleResetEventPayload = external_exports.object({
|
|
27317
27280
|
scheduleId: external_exports.string().min(1)
|
|
27318
27281
|
});
|
|
@@ -27325,7 +27288,10 @@ var scheduleResetEvent = external_exports.object({
|
|
|
27325
27288
|
});
|
|
27326
27289
|
var workspaceSeedEventPayload = external_exports.object({
|
|
27327
27290
|
url: external_exports.string().min(1),
|
|
27328
|
-
ref: external_exports.string().min(1).optional()
|
|
27291
|
+
ref: external_exports.string().min(1).optional(),
|
|
27292
|
+
commit: external_exports.string().min(1).optional(),
|
|
27293
|
+
branch: external_exports.string().min(1).optional(),
|
|
27294
|
+
into: external_exports.enum(["work", "home"]).optional()
|
|
27329
27295
|
});
|
|
27330
27296
|
var workspaceSeedEvent = external_exports.object({
|
|
27331
27297
|
id: external_exports.string().min(1),
|
|
@@ -27344,129 +27310,458 @@ var workspaceCommandEvent = external_exports.object({
|
|
|
27344
27310
|
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27345
27311
|
payload: workspaceCommandEventPayload
|
|
27346
27312
|
});
|
|
27347
|
-
var experimentExecuteEventPayload = external_exports.object({
|
|
27348
|
-
experimentId: external_exports.string().min(1),
|
|
27349
|
-
task: external_exports.string().min(1)
|
|
27313
|
+
var experimentExecuteEventPayload = external_exports.object({
|
|
27314
|
+
experimentId: external_exports.string().min(1),
|
|
27315
|
+
task: external_exports.string().min(1)
|
|
27316
|
+
});
|
|
27317
|
+
var experimentExecuteEvent = external_exports.object({
|
|
27318
|
+
id: external_exports.string().min(1),
|
|
27319
|
+
kind: external_exports.literal("experiment-execute"),
|
|
27320
|
+
version: external_exports.number().int().nonnegative(),
|
|
27321
|
+
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27322
|
+
payload: experimentExecuteEventPayload
|
|
27323
|
+
});
|
|
27324
|
+
var initializationEventPayload = external_exports.object({
|
|
27325
|
+
task: external_exports.string().min(1)
|
|
27326
|
+
});
|
|
27327
|
+
var initializationEvent = external_exports.object({
|
|
27328
|
+
id: external_exports.string().min(1),
|
|
27329
|
+
kind: external_exports.literal("initialization"),
|
|
27330
|
+
version: external_exports.number().int().nonnegative(),
|
|
27331
|
+
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27332
|
+
payload: initializationEventPayload
|
|
27333
|
+
});
|
|
27334
|
+
var harnessConfigEventPayload = external_exports.object({
|
|
27335
|
+
model: external_exports.string().min(1).optional(),
|
|
27336
|
+
mode: external_exports.string().min(1).optional(),
|
|
27337
|
+
configOptions: external_exports.record(external_exports.string().min(1), external_exports.string()).optional(),
|
|
27338
|
+
unset: external_exports.array(external_exports.string().min(1)).optional()
|
|
27339
|
+
});
|
|
27340
|
+
var harnessConfigEvent = external_exports.object({
|
|
27341
|
+
id: external_exports.string().min(1),
|
|
27342
|
+
kind: external_exports.literal("harness-config"),
|
|
27343
|
+
version: external_exports.number().int().nonnegative(),
|
|
27344
|
+
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27345
|
+
payload: harnessConfigEventPayload
|
|
27346
|
+
});
|
|
27347
|
+
var event = external_exports.discriminatedUnion("kind", [
|
|
27348
|
+
triggerEvent,
|
|
27349
|
+
scheduleResetEvent,
|
|
27350
|
+
workspaceSeedEvent,
|
|
27351
|
+
workspaceCommandEvent,
|
|
27352
|
+
experimentExecuteEvent,
|
|
27353
|
+
initializationEvent,
|
|
27354
|
+
harnessConfigEvent
|
|
27355
|
+
]);
|
|
27356
|
+
var harnessConfigChoice = external_exports.object({
|
|
27357
|
+
value: external_exports.string().min(1),
|
|
27358
|
+
name: external_exports.string().min(1),
|
|
27359
|
+
description: external_exports.string().optional()
|
|
27360
|
+
});
|
|
27361
|
+
var harnessConfigOptionGroup = external_exports.object({
|
|
27362
|
+
id: external_exports.string().min(1),
|
|
27363
|
+
name: external_exports.string().min(1),
|
|
27364
|
+
description: external_exports.string().optional(),
|
|
27365
|
+
category: external_exports.string().min(1),
|
|
27366
|
+
choices: external_exports.array(harnessConfigChoice)
|
|
27367
|
+
});
|
|
27368
|
+
var harnessConfigCatalog = external_exports.object({
|
|
27369
|
+
options: external_exports.array(harnessConfigOptionGroup),
|
|
27370
|
+
modelConstraints: external_exports.record(external_exports.string().min(1), external_exports.record(external_exports.string().min(1), external_exports.array(external_exports.string()))).optional()
|
|
27371
|
+
});
|
|
27372
|
+
var harnessConfigCurrent = external_exports.object({
|
|
27373
|
+
model: external_exports.string().nullable(),
|
|
27374
|
+
mode: external_exports.string().nullable(),
|
|
27375
|
+
configOptions: external_exports.record(external_exports.string().min(1), external_exports.string()),
|
|
27376
|
+
availableModels: external_exports.array(harnessConfigChoice).nullable().optional()
|
|
27377
|
+
});
|
|
27378
|
+
var capabilities = external_exports.object({
|
|
27379
|
+
contributions: external_exports.array(contributionKind),
|
|
27380
|
+
events: external_exports.array(eventKind),
|
|
27381
|
+
harnessConfig: external_exports.boolean().optional(),
|
|
27382
|
+
harnessConfigCatalog: harnessConfigCatalog.optional(),
|
|
27383
|
+
kbPublish: external_exports.number().int().optional(),
|
|
27384
|
+
liveUpdates: external_exports.boolean().optional()
|
|
27385
|
+
});
|
|
27386
|
+
var runtimeFeatureFlags = external_exports.looseObject({
|
|
27387
|
+
liveUpdates: external_exports.boolean().optional().catch(void 0)
|
|
27388
|
+
});
|
|
27389
|
+
var stateSlice = external_exports.object({
|
|
27390
|
+
contributions: external_exports.array(contribution),
|
|
27391
|
+
hash: external_exports.string().min(1)
|
|
27392
|
+
});
|
|
27393
|
+
var applyStateInput = external_exports.object({
|
|
27394
|
+
version: external_exports.number().int().positive(),
|
|
27395
|
+
state: stateSlice,
|
|
27396
|
+
events: external_exports.array(event)
|
|
27397
|
+
});
|
|
27398
|
+
var driverFailure = external_exports.object({
|
|
27399
|
+
kind: contributionKind,
|
|
27400
|
+
message: external_exports.string().min(1)
|
|
27401
|
+
});
|
|
27402
|
+
var applyStateResult = external_exports.discriminatedUnion("status", [
|
|
27403
|
+
external_exports.object({
|
|
27404
|
+
status: external_exports.literal("ok"),
|
|
27405
|
+
appliedVersion: external_exports.number().int().nonnegative(),
|
|
27406
|
+
appliedHash: external_exports.string().min(1).nullable(),
|
|
27407
|
+
failures: external_exports.array(driverFailure).default([]),
|
|
27408
|
+
settledEvents: external_exports.array(external_exports.string()).default([]),
|
|
27409
|
+
harnessConfigCurrent: harnessConfigCurrent.optional()
|
|
27410
|
+
}),
|
|
27411
|
+
external_exports.object({
|
|
27412
|
+
status: external_exports.literal("stale"),
|
|
27413
|
+
appliedVersion: external_exports.number().int().nonnegative(),
|
|
27414
|
+
settledEvents: external_exports.array(external_exports.string()).default([]),
|
|
27415
|
+
harnessConfigCurrent: harnessConfigCurrent.optional()
|
|
27416
|
+
})
|
|
27417
|
+
]);
|
|
27418
|
+
var helloInput = external_exports.object({
|
|
27419
|
+
lastAppliedVersion: external_exports.number().int().nonnegative().optional(),
|
|
27420
|
+
lastAppliedHash: external_exports.string().optional(),
|
|
27421
|
+
protocolVersion: external_exports.literal("v1"),
|
|
27422
|
+
agentRuntimeVersion: external_exports.string(),
|
|
27423
|
+
capabilities,
|
|
27424
|
+
harnessConfigCurrent: harnessConfigCurrent.optional()
|
|
27425
|
+
});
|
|
27426
|
+
var helloResult = external_exports.object({
|
|
27427
|
+
version: external_exports.number().int().positive().optional(),
|
|
27428
|
+
state: stateSlice.optional(),
|
|
27429
|
+
events: external_exports.array(event)
|
|
27430
|
+
});
|
|
27431
|
+
|
|
27432
|
+
// ../agent-runtime-api/src/modules/kb-snapshot/caps.ts
|
|
27433
|
+
var PER_FILE_MAX_BYTES = 2 * 1024 * 1024;
|
|
27434
|
+
var TOTAL_MAX_BYTES = 200 * 1024 * 1024;
|
|
27435
|
+
var kbPublishCapsSchema = external_exports.object({
|
|
27436
|
+
perFileMaxBytes: external_exports.number().int().positive(),
|
|
27437
|
+
totalMaxBytes: external_exports.number().int().positive(),
|
|
27438
|
+
maxFiles: external_exports.number().int().positive(),
|
|
27439
|
+
maxWalkDepth: external_exports.number().int().positive()
|
|
27440
|
+
});
|
|
27441
|
+
|
|
27442
|
+
// ../agent-runtime-api/src/modules/kb-publish/schemas.ts
|
|
27443
|
+
var kbPublishSyncInputSchema = external_exports.object({
|
|
27444
|
+
roots: external_exports.array(external_exports.string().min(1)).max(16).nullable(),
|
|
27445
|
+
caps: kbPublishCapsSchema,
|
|
27446
|
+
flush: external_exports.boolean()
|
|
27447
|
+
});
|
|
27448
|
+
|
|
27449
|
+
// ../api-server-api/src/modules/skills/schemas.ts
|
|
27450
|
+
var skillSourcePathSchema = external_exports.string().transform((p2) => p2.trim().replace(/^\/+|\/+$/g, "")).refine((p2) => !p2.split("/").includes(".."), "path must not contain '..'");
|
|
27451
|
+
var skillSourceSchema = external_exports.object({
|
|
27452
|
+
id: external_exports.string(),
|
|
27453
|
+
name: external_exports.string(),
|
|
27454
|
+
gitUrl: external_exports.string(),
|
|
27455
|
+
path: external_exports.string().optional(),
|
|
27456
|
+
system: external_exports.boolean().optional(),
|
|
27457
|
+
fromTemplate: external_exports.object({ templateId: external_exports.string(), templateName: external_exports.string() }).optional(),
|
|
27458
|
+
canPublish: external_exports.boolean().optional()
|
|
27459
|
+
});
|
|
27460
|
+
var skillPublishResultSchema = external_exports.object({
|
|
27461
|
+
prUrl: external_exports.string().url(),
|
|
27462
|
+
branch: external_exports.string()
|
|
27463
|
+
});
|
|
27464
|
+
var skillSchema = external_exports.object({
|
|
27465
|
+
source: external_exports.string(),
|
|
27466
|
+
name: external_exports.string(),
|
|
27467
|
+
description: external_exports.string(),
|
|
27468
|
+
version: external_exports.string(),
|
|
27469
|
+
contentHash: external_exports.string(),
|
|
27470
|
+
dir: external_exports.string().optional()
|
|
27471
|
+
});
|
|
27472
|
+
var skillListResultSchema = external_exports.object({
|
|
27473
|
+
skills: external_exports.array(skillSchema),
|
|
27474
|
+
scannedAt: external_exports.string().datetime(),
|
|
27475
|
+
visibility: external_exports.enum(["public", "private"]).optional()
|
|
27476
|
+
});
|
|
27477
|
+
var scanFailureCodes = [
|
|
27478
|
+
"needs_github_connection",
|
|
27479
|
+
"needs_sandbox",
|
|
27480
|
+
"repo_unreachable",
|
|
27481
|
+
"agent_unreachable",
|
|
27482
|
+
"source_path_not_found",
|
|
27483
|
+
"source_path_empty",
|
|
27484
|
+
"other"
|
|
27485
|
+
];
|
|
27486
|
+
var scanFailureSchema = external_exports.object({
|
|
27487
|
+
code: external_exports.enum(scanFailureCodes),
|
|
27488
|
+
title: external_exports.string(),
|
|
27489
|
+
detail: external_exports.string()
|
|
27490
|
+
});
|
|
27491
|
+
var skillRefSchema = external_exports.object({
|
|
27492
|
+
source: external_exports.string(),
|
|
27493
|
+
name: external_exports.string(),
|
|
27494
|
+
version: external_exports.string(),
|
|
27495
|
+
contentHash: external_exports.string().optional(),
|
|
27496
|
+
path: external_exports.string().optional()
|
|
27497
|
+
});
|
|
27498
|
+
var localSkillSchema = external_exports.object({
|
|
27499
|
+
name: external_exports.string(),
|
|
27500
|
+
description: external_exports.string(),
|
|
27501
|
+
skillPath: external_exports.string(),
|
|
27502
|
+
origin: external_exports.enum(["system", "system-modified", "user"]).optional(),
|
|
27503
|
+
contentHash: external_exports.string().optional()
|
|
27504
|
+
});
|
|
27505
|
+
var skillPublishRecordSchema = external_exports.object({
|
|
27506
|
+
skillName: external_exports.string(),
|
|
27507
|
+
sourceId: external_exports.string(),
|
|
27508
|
+
sourceName: external_exports.string(),
|
|
27509
|
+
sourceGitUrl: external_exports.string(),
|
|
27510
|
+
prUrl: external_exports.string(),
|
|
27511
|
+
publishedAt: external_exports.string(),
|
|
27512
|
+
prState: external_exports.enum(["draft", "open", "merged", "closed"]).nullable(),
|
|
27513
|
+
prStateCheckedAt: external_exports.string().nullable()
|
|
27514
|
+
});
|
|
27515
|
+
var skillStateOutputSchema = external_exports.object({
|
|
27516
|
+
installed: external_exports.array(skillRefSchema),
|
|
27517
|
+
standalone: external_exports.array(localSkillSchema),
|
|
27518
|
+
instancePublishes: external_exports.array(skillPublishRecordSchema),
|
|
27519
|
+
standaloneSnapshot: external_exports.object({ capturedAt: external_exports.string().datetime() }).optional()
|
|
27520
|
+
});
|
|
27521
|
+
var skillListSourcesInputSchema = external_exports.object({ agentId: external_exports.string().min(1).optional() }).optional();
|
|
27522
|
+
var INVALID_GIT_URL_MESSAGE = "Enter a repository URL such as https://github.com/owner/repo";
|
|
27523
|
+
var skillCreateSourceFieldsSchema = external_exports.object({
|
|
27524
|
+
name: external_exports.string().min(1).max(128),
|
|
27525
|
+
gitUrl: external_exports.string(),
|
|
27526
|
+
path: skillSourcePathSchema.optional()
|
|
27527
|
+
});
|
|
27528
|
+
var skillCreateSourceInputSchema = skillCreateSourceFieldsSchema.transform((input, ctx) => {
|
|
27529
|
+
const location = canonicalSourceLocation(input.gitUrl, input.path);
|
|
27530
|
+
if (!location) {
|
|
27531
|
+
ctx.addIssue({
|
|
27532
|
+
code: "custom",
|
|
27533
|
+
path: ["gitUrl"],
|
|
27534
|
+
message: INVALID_GIT_URL_MESSAGE
|
|
27535
|
+
});
|
|
27536
|
+
return external_exports.NEVER;
|
|
27537
|
+
}
|
|
27538
|
+
return { name: input.name, ...location };
|
|
27539
|
+
});
|
|
27540
|
+
var skillDeleteSourceInputSchema = external_exports.object({
|
|
27541
|
+
id: external_exports.string().min(1)
|
|
27542
|
+
});
|
|
27543
|
+
var skillRefreshSourceInputSchema = external_exports.object({
|
|
27544
|
+
id: external_exports.string().min(1)
|
|
27545
|
+
});
|
|
27546
|
+
var skillListInputSchema = external_exports.object({
|
|
27547
|
+
sourceId: external_exports.string().min(1),
|
|
27548
|
+
agentId: external_exports.string().min(1).optional()
|
|
27549
|
+
});
|
|
27550
|
+
var skillGetContentInputSchema = external_exports.object({
|
|
27551
|
+
sourceId: external_exports.string().min(1),
|
|
27552
|
+
name: external_exports.string().min(1),
|
|
27553
|
+
agentId: external_exports.string().min(1).optional()
|
|
27554
|
+
});
|
|
27555
|
+
var skillContentSchema = external_exports.object({
|
|
27556
|
+
content: external_exports.string(),
|
|
27557
|
+
dir: external_exports.string().optional()
|
|
27558
|
+
});
|
|
27559
|
+
var skillInstallInputSchema2 = external_exports.object({
|
|
27560
|
+
agentId: external_exports.string().min(1),
|
|
27561
|
+
source: external_exports.string().url(),
|
|
27562
|
+
name: external_exports.string().min(1),
|
|
27563
|
+
version: external_exports.string().min(1),
|
|
27564
|
+
contentHash: external_exports.string().optional()
|
|
27565
|
+
});
|
|
27566
|
+
var skillUninstallInputSchema2 = external_exports.object({
|
|
27567
|
+
agentId: external_exports.string().min(1),
|
|
27568
|
+
source: external_exports.string().url(),
|
|
27569
|
+
name: external_exports.string().min(1)
|
|
27570
|
+
});
|
|
27571
|
+
var skillSetEntrySchema = external_exports.object({
|
|
27572
|
+
source: external_exports.string().url(),
|
|
27573
|
+
name: external_exports.string().min(1)
|
|
27574
|
+
});
|
|
27575
|
+
var skillSetNameSchema = resourceNameSchema("my-skill-set");
|
|
27576
|
+
var skillSetSchema = external_exports.object({
|
|
27577
|
+
id: external_exports.string(),
|
|
27578
|
+
name: external_exports.string(),
|
|
27579
|
+
skills: external_exports.array(skillSetEntrySchema),
|
|
27580
|
+
createdAt: external_exports.string()
|
|
27581
|
+
});
|
|
27582
|
+
var skillSetCreateInputSchema = external_exports.object({
|
|
27583
|
+
name: skillSetNameSchema,
|
|
27584
|
+
skills: external_exports.array(skillSetEntrySchema).min(1).max(500)
|
|
27350
27585
|
});
|
|
27351
|
-
var
|
|
27352
|
-
|
|
27353
|
-
|
|
27354
|
-
|
|
27355
|
-
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27356
|
-
payload: experimentExecuteEventPayload
|
|
27586
|
+
var skillSetDeleteInputSchema = external_exports.object({ id: external_exports.string().min(1) });
|
|
27587
|
+
var skillSetApplyInputSchema = external_exports.object({
|
|
27588
|
+
agentId: external_exports.string().min(1),
|
|
27589
|
+
setIds: external_exports.array(external_exports.string().min(1)).min(1).max(50)
|
|
27357
27590
|
});
|
|
27358
|
-
var
|
|
27359
|
-
|
|
27360
|
-
|
|
27361
|
-
|
|
27362
|
-
|
|
27591
|
+
var skillSetSkipReasonSchema = external_exports.enum([
|
|
27592
|
+
"source-not-connected",
|
|
27593
|
+
"source-unreadable",
|
|
27594
|
+
"not-in-source"
|
|
27595
|
+
]);
|
|
27596
|
+
var skillSetApplyResultSchema = external_exports.object({
|
|
27597
|
+
installed: external_exports.array(skillRefSchema),
|
|
27598
|
+
added: external_exports.number().int().nonnegative(),
|
|
27599
|
+
skipped: external_exports.array(
|
|
27600
|
+
skillSetEntrySchema.extend({ reason: skillSetSkipReasonSchema })
|
|
27601
|
+
)
|
|
27363
27602
|
});
|
|
27364
|
-
var
|
|
27365
|
-
|
|
27366
|
-
|
|
27367
|
-
|
|
27368
|
-
|
|
27369
|
-
|
|
27603
|
+
var MAX_SKILL_BATCH_ENTRIES = 500;
|
|
27604
|
+
var skillApplyBatchInputSchema = external_exports.object({
|
|
27605
|
+
agentId: external_exports.string().min(1),
|
|
27606
|
+
install: external_exports.array(
|
|
27607
|
+
external_exports.object({
|
|
27608
|
+
source: external_exports.string().url(),
|
|
27609
|
+
name: external_exports.string().min(1),
|
|
27610
|
+
version: external_exports.string().min(1),
|
|
27611
|
+
contentHash: external_exports.string().optional()
|
|
27612
|
+
})
|
|
27613
|
+
).max(MAX_SKILL_BATCH_ENTRIES).default([]),
|
|
27614
|
+
uninstall: external_exports.array(
|
|
27615
|
+
external_exports.object({
|
|
27616
|
+
source: external_exports.string().url(),
|
|
27617
|
+
name: external_exports.string().min(1)
|
|
27618
|
+
})
|
|
27619
|
+
).max(MAX_SKILL_BATCH_ENTRIES).default([])
|
|
27620
|
+
}).refine(
|
|
27621
|
+
(v2) => v2.install.length + v2.uninstall.length <= MAX_SKILL_BATCH_ENTRIES,
|
|
27622
|
+
{
|
|
27623
|
+
message: `one batch carries at most ${MAX_SKILL_BATCH_ENTRIES} skills, install and uninstall combined`
|
|
27624
|
+
}
|
|
27625
|
+
);
|
|
27626
|
+
var skillListLocalInputSchema2 = external_exports.object({
|
|
27627
|
+
agentId: external_exports.string().min(1)
|
|
27370
27628
|
});
|
|
27371
|
-
var
|
|
27372
|
-
|
|
27373
|
-
scheduleResetEvent,
|
|
27374
|
-
workspaceSeedEvent,
|
|
27375
|
-
workspaceCommandEvent,
|
|
27376
|
-
experimentExecuteEvent,
|
|
27377
|
-
harnessConfigEvent
|
|
27378
|
-
]);
|
|
27379
|
-
var harnessConfigChoice = external_exports.object({
|
|
27380
|
-
value: external_exports.string().min(1),
|
|
27381
|
-
name: external_exports.string().min(1),
|
|
27382
|
-
description: external_exports.string().optional()
|
|
27629
|
+
var skillStateInputSchema = external_exports.object({
|
|
27630
|
+
agentId: external_exports.string().min(1)
|
|
27383
27631
|
});
|
|
27384
|
-
var
|
|
27385
|
-
|
|
27386
|
-
name: external_exports.string().min(1)
|
|
27387
|
-
description: external_exports.string().optional(),
|
|
27388
|
-
category: external_exports.string().min(1),
|
|
27389
|
-
choices: external_exports.array(harnessConfigChoice)
|
|
27632
|
+
var skillDeleteLocalInputSchema2 = external_exports.object({
|
|
27633
|
+
agentId: external_exports.string().min(1),
|
|
27634
|
+
name: external_exports.string().min(1)
|
|
27390
27635
|
});
|
|
27391
|
-
var
|
|
27392
|
-
|
|
27393
|
-
|
|
27636
|
+
var skillReadLocalInputSchema2 = external_exports.object({
|
|
27637
|
+
agentId: external_exports.string().min(1),
|
|
27638
|
+
name: external_exports.string().min(1)
|
|
27394
27639
|
});
|
|
27395
|
-
var
|
|
27396
|
-
|
|
27397
|
-
|
|
27398
|
-
|
|
27399
|
-
|
|
27640
|
+
var skillLocalFilesSchema = external_exports.object({
|
|
27641
|
+
dir: external_exports.string(),
|
|
27642
|
+
files: external_exports.array(
|
|
27643
|
+
external_exports.object({
|
|
27644
|
+
relPath: external_exports.string(),
|
|
27645
|
+
content: external_exports.string(),
|
|
27646
|
+
base64: external_exports.literal(true).optional()
|
|
27647
|
+
})
|
|
27648
|
+
)
|
|
27400
27649
|
});
|
|
27401
|
-
var
|
|
27402
|
-
|
|
27403
|
-
|
|
27404
|
-
|
|
27405
|
-
|
|
27406
|
-
|
|
27407
|
-
liveUpdates: external_exports.boolean().optional()
|
|
27650
|
+
var skillPublishInputSchema2 = external_exports.object({
|
|
27651
|
+
agentId: external_exports.string().min(1),
|
|
27652
|
+
sourceId: external_exports.string().min(1),
|
|
27653
|
+
name: external_exports.string().min(1),
|
|
27654
|
+
title: external_exports.string().optional(),
|
|
27655
|
+
body: external_exports.string().optional()
|
|
27408
27656
|
});
|
|
27409
|
-
var
|
|
27410
|
-
|
|
27657
|
+
var skillCreateLocalInputSchema = external_exports.object({
|
|
27658
|
+
agentId: external_exports.string().min(1),
|
|
27659
|
+
skills: external_exports.array(
|
|
27660
|
+
external_exports.object({
|
|
27661
|
+
name: external_exports.string().min(1).max(128),
|
|
27662
|
+
content: external_exports.string().max(2 * 1024 * 1024)
|
|
27663
|
+
})
|
|
27664
|
+
).min(1).max(50)
|
|
27665
|
+
}).refine(
|
|
27666
|
+
(v2) => v2.skills.reduce((n, s) => n + s.content.length, 0) <= 5 * 1024 * 1024,
|
|
27667
|
+
"batch exceeds 5 MB"
|
|
27668
|
+
);
|
|
27669
|
+
|
|
27670
|
+
// ../api-server-api/src/modules/templates/schemas.ts
|
|
27671
|
+
var templateGetInputSchema = external_exports.object({
|
|
27672
|
+
id: external_exports.string().min(1)
|
|
27411
27673
|
});
|
|
27412
|
-
var
|
|
27413
|
-
|
|
27414
|
-
|
|
27674
|
+
var mountSchema = external_exports.object({
|
|
27675
|
+
path: external_exports.string(),
|
|
27676
|
+
persist: external_exports.boolean(),
|
|
27677
|
+
size: external_exports.string().optional()
|
|
27415
27678
|
});
|
|
27416
|
-
var
|
|
27417
|
-
|
|
27418
|
-
|
|
27419
|
-
events: external_exports.array(event)
|
|
27679
|
+
var resourcesSchema = external_exports.object({
|
|
27680
|
+
requests: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
27681
|
+
limits: external_exports.record(external_exports.string(), external_exports.string()).optional()
|
|
27420
27682
|
});
|
|
27421
|
-
var
|
|
27422
|
-
|
|
27423
|
-
|
|
27683
|
+
var envVarConfigMapSchema = external_exports.object({
|
|
27684
|
+
name: external_exports.string(),
|
|
27685
|
+
value: external_exports.string()
|
|
27424
27686
|
});
|
|
27425
|
-
var
|
|
27426
|
-
external_exports.
|
|
27427
|
-
|
|
27428
|
-
|
|
27429
|
-
appliedHash: external_exports.string().min(1).nullable(),
|
|
27430
|
-
failures: external_exports.array(driverFailure).default([]),
|
|
27431
|
-
settledEvents: external_exports.array(external_exports.string()).default([]),
|
|
27432
|
-
harnessConfigCurrent: harnessConfigCurrent.optional()
|
|
27433
|
-
}),
|
|
27434
|
-
external_exports.object({
|
|
27435
|
-
status: external_exports.literal("stale"),
|
|
27436
|
-
appliedVersion: external_exports.number().int().nonnegative(),
|
|
27437
|
-
settledEvents: external_exports.array(external_exports.string()).default([]),
|
|
27438
|
-
harnessConfigCurrent: harnessConfigCurrent.optional()
|
|
27439
|
-
})
|
|
27440
|
-
]);
|
|
27441
|
-
var helloInput = external_exports.object({
|
|
27442
|
-
lastAppliedVersion: external_exports.number().int().nonnegative().optional(),
|
|
27443
|
-
lastAppliedHash: external_exports.string().optional(),
|
|
27444
|
-
protocolVersion: external_exports.literal("v1"),
|
|
27445
|
-
agentRuntimeVersion: external_exports.string(),
|
|
27446
|
-
capabilities,
|
|
27447
|
-
harnessConfigCurrent: harnessConfigCurrent.optional()
|
|
27687
|
+
var skillSourceSeedSchema = external_exports.object({
|
|
27688
|
+
name: external_exports.string(),
|
|
27689
|
+
gitUrl: external_exports.string(),
|
|
27690
|
+
path: skillSourcePathSchema.optional()
|
|
27448
27691
|
});
|
|
27449
|
-
var
|
|
27450
|
-
|
|
27451
|
-
|
|
27452
|
-
|
|
27692
|
+
var templateCategorySchema = external_exports.enum(["harness"]).default("harness");
|
|
27693
|
+
var harnessFamilySchema = external_exports.enum([
|
|
27694
|
+
"claude-code",
|
|
27695
|
+
"codex",
|
|
27696
|
+
"pi",
|
|
27697
|
+
"bob"
|
|
27698
|
+
]);
|
|
27699
|
+
var templateSpecSchema = external_exports.object({
|
|
27700
|
+
version: external_exports.string(),
|
|
27701
|
+
image: external_exports.string(),
|
|
27702
|
+
name: external_exports.string().optional(),
|
|
27703
|
+
description: external_exports.string().optional(),
|
|
27704
|
+
category: templateCategorySchema,
|
|
27705
|
+
harness: harnessFamilySchema.optional(),
|
|
27706
|
+
providers: external_exports.array(
|
|
27707
|
+
external_exports.custom(
|
|
27708
|
+
(v2) => typeof v2 === "string" && isProviderPresetType(v2),
|
|
27709
|
+
"unknown provider type"
|
|
27710
|
+
)
|
|
27711
|
+
).optional(),
|
|
27712
|
+
tags: external_exports.array(external_exports.string()).optional(),
|
|
27713
|
+
docsUrl: external_exports.string().optional(),
|
|
27714
|
+
releaseNotesUrl: external_exports.string().optional(),
|
|
27715
|
+
setupNote: external_exports.object({ title: external_exports.string(), body: external_exports.string() }).optional(),
|
|
27716
|
+
experimental: external_exports.boolean().optional(),
|
|
27717
|
+
mounts: external_exports.array(mountSchema).optional(),
|
|
27718
|
+
init: external_exports.string().optional(),
|
|
27719
|
+
env: external_exports.array(envVarConfigMapSchema).optional(),
|
|
27720
|
+
resources: resourcesSchema.optional(),
|
|
27721
|
+
imagePullPolicy: external_exports.string().optional(),
|
|
27722
|
+
imagePullSecretRef: external_exports.string().optional(),
|
|
27723
|
+
hibernationTimeout: external_exports.string().optional(),
|
|
27724
|
+
storageSize: external_exports.string().optional(),
|
|
27725
|
+
storageClass: external_exports.string().optional(),
|
|
27726
|
+
runtimeClassName: external_exports.string().optional(),
|
|
27727
|
+
nodeSelector: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
27728
|
+
skillSources: external_exports.array(skillSourceSeedSchema).optional()
|
|
27729
|
+
}).passthrough();
|
|
27730
|
+
|
|
27731
|
+
// ../api-server-api/src/modules/repos/schemas.ts
|
|
27732
|
+
var repoSchema = external_exports.object({
|
|
27733
|
+
id: external_exports.string().min(1),
|
|
27734
|
+
name: external_exports.string().min(1),
|
|
27735
|
+
url: external_exports.url(),
|
|
27736
|
+
ref: external_exports.string().min(1).optional(),
|
|
27737
|
+
description: external_exports.string().optional(),
|
|
27738
|
+
compatibleTemplates: external_exports.array(external_exports.string()).default([])
|
|
27453
27739
|
});
|
|
27454
27740
|
|
|
27455
|
-
// ../
|
|
27456
|
-
var
|
|
27457
|
-
var
|
|
27458
|
-
var
|
|
27459
|
-
|
|
27460
|
-
|
|
27461
|
-
|
|
27462
|
-
|
|
27741
|
+
// ../api-server-api/src/modules/invocations/schemas.ts
|
|
27742
|
+
var DEFAULT_INVOCATION_TTL_MS = 60 * 60 * 1e3;
|
|
27743
|
+
var MIN_INVOCATION_TTL_MS = 60 * 1e3;
|
|
27744
|
+
var MAX_INVOCATION_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
27745
|
+
var spawnInvocationRequestSchema = external_exports.object({
|
|
27746
|
+
image: external_exports.string().min(1).optional(),
|
|
27747
|
+
templateId: external_exports.string().min(1).optional(),
|
|
27748
|
+
connections: external_exports.array(external_exports.string().min(1)).optional(),
|
|
27749
|
+
prompt: external_exports.string().min(1),
|
|
27750
|
+
schema: external_exports.unknown(),
|
|
27751
|
+
ttlMs: external_exports.number().int().min(MIN_INVOCATION_TTL_MS).max(MAX_INVOCATION_TTL_MS).optional(),
|
|
27752
|
+
memory: external_exports.string().regex(/^\d+(Mi|Gi)$/, "memory must look like '512Mi' or '4Gi'").optional(),
|
|
27753
|
+
cpu: external_exports.string().regex(/^\d+(\.\d+)?m?$/, "cpu must look like '2', '0.5' or '500m'").optional(),
|
|
27754
|
+
experimentSpanId: external_exports.string().min(1).max(300).optional()
|
|
27755
|
+
}).refine((d2) => d2.image !== void 0 || d2.templateId !== void 0, {
|
|
27756
|
+
message: "either image or templateId is required"
|
|
27463
27757
|
});
|
|
27464
|
-
|
|
27465
|
-
|
|
27466
|
-
|
|
27467
|
-
|
|
27468
|
-
|
|
27469
|
-
|
|
27758
|
+
var spawnInvocationResponseSchema = external_exports.object({
|
|
27759
|
+
id: external_exports.string().min(1)
|
|
27760
|
+
});
|
|
27761
|
+
var invocationViewSchema = external_exports.object({
|
|
27762
|
+
status: external_exports.enum(["running", "done", "failed"]),
|
|
27763
|
+
result: external_exports.unknown(),
|
|
27764
|
+
errorReason: external_exports.string().optional()
|
|
27470
27765
|
});
|
|
27471
27766
|
|
|
27472
27767
|
// ../api-server-api/src/modules/harness-config/schemas.ts
|
|
@@ -27558,6 +27853,13 @@ var agentSizeSchema = external_exports.object({
|
|
|
27558
27853
|
cpu: cpuQuantitySchema.optional(),
|
|
27559
27854
|
memory: memoryQuantitySchema.optional()
|
|
27560
27855
|
});
|
|
27856
|
+
var storageQuantitySchema = external_exports.string().regex(/^\d+(Mi|Gi)$/, "storage must look like '512Mi' or '10Gi'").refine((v2) => toMemoryMi(v2) >= 1024, {
|
|
27857
|
+
message: "storage must be at least 1Gi"
|
|
27858
|
+
});
|
|
27859
|
+
var agentRetryWorkspaceInputSchema = external_exports.object({
|
|
27860
|
+
id: external_exports.string().min(1),
|
|
27861
|
+
kind: external_exports.enum(["workspace-seed", "workspace-command"])
|
|
27862
|
+
});
|
|
27561
27863
|
var agentUpgradeInputSchema = idSchema.extend({
|
|
27562
27864
|
expectedToImage: external_exports.string().min(1).optional()
|
|
27563
27865
|
});
|
|
@@ -27566,6 +27868,7 @@ var agentDisconnectSlackInputSchema = idSchema.extend({
|
|
|
27566
27868
|
});
|
|
27567
27869
|
var agentKindSchema = external_exports.enum(["knowledge-base", "experiment"]);
|
|
27568
27870
|
var agentCreateInputSchema = external_exports.object({
|
|
27871
|
+
kbShareRoots: external_exports.array(external_exports.string().min(1)).min(1).max(20).optional(),
|
|
27569
27872
|
name: external_exports.string().min(1).refine((n) => !n.startsWith("agent-"), {
|
|
27570
27873
|
message: "agent name cannot start with 'agent-' (reserved for IDs)"
|
|
27571
27874
|
}),
|
|
@@ -27581,9 +27884,18 @@ var agentCreateInputSchema = external_exports.object({
|
|
|
27581
27884
|
}).optional(),
|
|
27582
27885
|
egressPreset: egressPresetSchema.optional(),
|
|
27583
27886
|
hibernationTimeoutMin: external_exports.number().int().min(0).optional(),
|
|
27584
|
-
gitRepo: external_exports.object({
|
|
27887
|
+
gitRepo: external_exports.object({
|
|
27888
|
+
url: external_exports.url(),
|
|
27889
|
+
ref: external_exports.string().min(1).optional(),
|
|
27890
|
+
commit: external_exports.string().min(1).optional(),
|
|
27891
|
+
branch: external_exports.string().min(1).optional(),
|
|
27892
|
+
into: external_exports.enum(["work", "home"]).optional()
|
|
27893
|
+
}).optional(),
|
|
27585
27894
|
connectionIds: external_exports.array(external_exports.string()).optional(),
|
|
27895
|
+
providerConnectionId: external_exports.string().min(1).optional(),
|
|
27586
27896
|
size: agentSizeSchema.optional(),
|
|
27897
|
+
vm: external_exports.boolean().optional(),
|
|
27898
|
+
storage: storageQuantitySchema.optional(),
|
|
27587
27899
|
sweepable: external_exports.boolean().optional(),
|
|
27588
27900
|
lifetimeMs: external_exports.number().int().min(0).optional()
|
|
27589
27901
|
}).refine((d2) => d2.templateId !== void 0 || d2.image !== void 0, {
|
|
@@ -27614,6 +27926,9 @@ var agentBindTelegramChatInputSchema = external_exports.object({
|
|
|
27614
27926
|
agentId: external_exports.string().min(1),
|
|
27615
27927
|
flowId: external_exports.string().min(1)
|
|
27616
27928
|
});
|
|
27929
|
+
var agentPeekBindFlowInputSchema = external_exports.object({
|
|
27930
|
+
flowId: external_exports.string().min(1)
|
|
27931
|
+
});
|
|
27617
27932
|
var agentBindSlackChannelInputSchema = external_exports.object({
|
|
27618
27933
|
agentId: external_exports.string().min(1),
|
|
27619
27934
|
flowId: external_exports.string().min(1)
|
|
@@ -27635,12 +27950,15 @@ var scheduleListInputSchema = external_exports.object({
|
|
|
27635
27950
|
var scheduleGetInputSchema = external_exports.object({
|
|
27636
27951
|
id: external_exports.string().min(1)
|
|
27637
27952
|
});
|
|
27953
|
+
var PRECHECK_MAX_LENGTH = 8e3;
|
|
27954
|
+
var precheckSchema = external_exports.string().trim().min(1).max(PRECHECK_MAX_LENGTH);
|
|
27638
27955
|
var scheduleCreateCronInputSchema = external_exports.object({
|
|
27639
27956
|
name: external_exports.string().min(1),
|
|
27640
27957
|
agentId: external_exports.string().min(1),
|
|
27641
27958
|
cron: external_exports.string().min(1),
|
|
27642
27959
|
task: external_exports.string().min(1),
|
|
27643
|
-
sessionMode: scheduleSessionModeSchema.optional()
|
|
27960
|
+
sessionMode: scheduleSessionModeSchema.optional(),
|
|
27961
|
+
precheck: precheckSchema.optional()
|
|
27644
27962
|
});
|
|
27645
27963
|
var scheduleCreateRRuleInputSchema = external_exports.object({
|
|
27646
27964
|
name: external_exports.string().min(1),
|
|
@@ -27649,7 +27967,8 @@ var scheduleCreateRRuleInputSchema = external_exports.object({
|
|
|
27649
27967
|
timezone: external_exports.string().min(1),
|
|
27650
27968
|
quietHours: external_exports.array(quietWindowSchema).optional(),
|
|
27651
27969
|
task: external_exports.string().min(1),
|
|
27652
|
-
sessionMode: scheduleSessionModeSchema.optional()
|
|
27970
|
+
sessionMode: scheduleSessionModeSchema.optional(),
|
|
27971
|
+
precheck: precheckSchema.optional()
|
|
27653
27972
|
});
|
|
27654
27973
|
var scheduleUpdateRRuleInputSchema = external_exports.object({
|
|
27655
27974
|
id: external_exports.string().min(1),
|
|
@@ -27658,7 +27977,8 @@ var scheduleUpdateRRuleInputSchema = external_exports.object({
|
|
|
27658
27977
|
timezone: external_exports.string().min(1),
|
|
27659
27978
|
quietHours: external_exports.array(quietWindowSchema),
|
|
27660
27979
|
task: external_exports.string().min(1),
|
|
27661
|
-
sessionMode: scheduleSessionModeSchema.optional()
|
|
27980
|
+
sessionMode: scheduleSessionModeSchema.optional(),
|
|
27981
|
+
precheck: precheckSchema.nullable().optional()
|
|
27662
27982
|
});
|
|
27663
27983
|
var scheduleDeleteInputSchema = external_exports.object({
|
|
27664
27984
|
id: external_exports.string().min(1)
|
|
@@ -27680,6 +28000,7 @@ var scheduleSpecCronSchema = external_exports.object({
|
|
|
27680
28000
|
type: external_exports.literal("cron"),
|
|
27681
28001
|
cron: external_exports.string(),
|
|
27682
28002
|
task: external_exports.string().optional(),
|
|
28003
|
+
precheck: precheckSchema.optional(),
|
|
27683
28004
|
enabled: external_exports.boolean(),
|
|
27684
28005
|
sessionMode: scheduleSessionModeSchema.optional(),
|
|
27685
28006
|
createdBy: scheduleCreatorSchema
|
|
@@ -27691,6 +28012,7 @@ var scheduleSpecRRuleSchema = external_exports.object({
|
|
|
27691
28012
|
timezone: external_exports.string(),
|
|
27692
28013
|
quietHours: external_exports.array(quietWindowConfigMapSchema).optional(),
|
|
27693
28014
|
task: external_exports.string().optional(),
|
|
28015
|
+
precheck: precheckSchema.optional(),
|
|
27694
28016
|
enabled: external_exports.boolean(),
|
|
27695
28017
|
sessionMode: scheduleSessionModeSchema.optional(),
|
|
27696
28018
|
createdBy: scheduleCreatorSchema
|
|
@@ -27702,8 +28024,17 @@ var scheduleSpecSchema = external_exports.discriminatedUnion("type", [
|
|
|
27702
28024
|
var scheduleStatusSchema = external_exports.object({
|
|
27703
28025
|
lastRun: external_exports.string().optional(),
|
|
27704
28026
|
nextRun: external_exports.string().optional(),
|
|
27705
|
-
lastResult: external_exports.string().optional()
|
|
27706
|
-
|
|
28027
|
+
lastResult: external_exports.string().optional(),
|
|
28028
|
+
lastDeclinedAt: external_exports.string().optional(),
|
|
28029
|
+
declinedCount: external_exports.number().int().nonnegative().optional(),
|
|
28030
|
+
lastPrecheckError: external_exports.string().optional(),
|
|
28031
|
+
precheckFailedCount: external_exports.number().int().nonnegative().optional()
|
|
28032
|
+
});
|
|
28033
|
+
var precheckVerdictSchema = external_exports.enum([
|
|
28034
|
+
"allowed",
|
|
28035
|
+
"declined",
|
|
28036
|
+
"precheck-failed"
|
|
28037
|
+
]);
|
|
27707
28038
|
|
|
27708
28039
|
// ../api-server-api/src/modules/experiments/schemas.ts
|
|
27709
28040
|
var SCRIPT_CONTENT_MAX_BYTES = 256 * 1024;
|
|
@@ -27810,21 +28141,162 @@ var experimentSandboxCreateInputSchema = external_exports.object({
|
|
|
27810
28141
|
message: "Either templateId or image is required"
|
|
27811
28142
|
});
|
|
27812
28143
|
|
|
27813
|
-
// ../api-server-api/src/modules/
|
|
27814
|
-
var
|
|
27815
|
-
var
|
|
28144
|
+
// ../api-server-api/src/modules/starter-kits/schemas.ts
|
|
28145
|
+
var starterKitIdSchema = external_exports.string().min(1).regex(/^[a-z0-9][a-z0-9-]*$/, "lowercase letters, digits and dashes");
|
|
28146
|
+
var starterKitCatalogNameSchema = starterKitIdSchema;
|
|
28147
|
+
var starterKitCategorySchema = external_exports.enum([
|
|
28148
|
+
"knowledge",
|
|
28149
|
+
"software",
|
|
28150
|
+
"productivity",
|
|
28151
|
+
"research"
|
|
28152
|
+
]);
|
|
28153
|
+
var starterKitConnectionRequirementSchema = external_exports.object({
|
|
28154
|
+
accepts: external_exports.array(external_exports.string().min(1)).min(1),
|
|
28155
|
+
required: external_exports.boolean().default(false),
|
|
28156
|
+
note: external_exports.string().optional()
|
|
28157
|
+
});
|
|
28158
|
+
var starterKitChannelSchema = external_exports.object({
|
|
28159
|
+
type: external_exports.enum(["slack", "telegram"]),
|
|
28160
|
+
note: external_exports.string().optional()
|
|
28161
|
+
});
|
|
28162
|
+
var scheduleCommon = {
|
|
28163
|
+
name: external_exports.string().min(1),
|
|
28164
|
+
task: external_exports.string().min(1),
|
|
28165
|
+
enabled: external_exports.boolean().default(true),
|
|
28166
|
+
sessionMode: external_exports.enum(["continuous", "fresh"]).optional(),
|
|
28167
|
+
precheck: precheckSchema.optional()
|
|
28168
|
+
};
|
|
28169
|
+
var starterKitCronScheduleSchema = external_exports.object({
|
|
28170
|
+
...scheduleCommon,
|
|
28171
|
+
cron: external_exports.string().min(1)
|
|
28172
|
+
});
|
|
28173
|
+
var starterKitRRuleScheduleSchema = external_exports.object({
|
|
28174
|
+
...scheduleCommon,
|
|
28175
|
+
rrule: external_exports.string().min(1),
|
|
28176
|
+
timezone: external_exports.string().min(1)
|
|
28177
|
+
});
|
|
28178
|
+
var starterKitScheduleSchema = external_exports.union([
|
|
28179
|
+
starterKitCronScheduleSchema,
|
|
28180
|
+
starterKitRRuleScheduleSchema
|
|
28181
|
+
]);
|
|
28182
|
+
var starterKitExternalSkillSchema = external_exports.object({
|
|
28183
|
+
source: external_exports.url(),
|
|
28184
|
+
name: external_exports.string().min(1)
|
|
28185
|
+
});
|
|
28186
|
+
var starterKitBundledSkillsSchema = external_exports.object({
|
|
28187
|
+
path: external_exports.string().min(1)
|
|
28188
|
+
});
|
|
28189
|
+
var resolvedSkillSchema = external_exports.object({
|
|
28190
|
+
name: external_exports.string().min(1),
|
|
28191
|
+
description: external_exports.string()
|
|
28192
|
+
});
|
|
28193
|
+
var starterKitEnvVarSchema = external_exports.object({
|
|
28194
|
+
name: external_exports.string().min(1),
|
|
28195
|
+
value: external_exports.string()
|
|
28196
|
+
});
|
|
28197
|
+
var providerListSchema = external_exports.array(
|
|
28198
|
+
external_exports.custom(
|
|
28199
|
+
(v2) => typeof v2 === "string" && isProviderPresetType(v2),
|
|
28200
|
+
"unknown provider type"
|
|
28201
|
+
)
|
|
28202
|
+
);
|
|
28203
|
+
var starterKitImageSchema = external_exports.object({
|
|
28204
|
+
ref: external_exports.string().min(1),
|
|
28205
|
+
harness: harnessFamilySchema.optional(),
|
|
28206
|
+
providers: providerListSchema.optional()
|
|
28207
|
+
});
|
|
28208
|
+
var starterKitKnowledgeBaseSchema = external_exports.object({
|
|
28209
|
+
shareRoots: external_exports.array(external_exports.string().min(1)).min(1).max(20)
|
|
28210
|
+
});
|
|
28211
|
+
var starterKitInstallSchema = external_exports.object({
|
|
28212
|
+
command: external_exports.string().min(1)
|
|
28213
|
+
});
|
|
28214
|
+
var starterKitResourcesSchema = agentSizeSchema.extend({
|
|
28215
|
+
storage: storageQuantitySchema.optional(),
|
|
28216
|
+
note: external_exports.string().min(1).optional()
|
|
28217
|
+
});
|
|
28218
|
+
var harnessCommandNameSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9:_-]*$/, "a command name without the leading slash");
|
|
28219
|
+
var starterKitSchema = external_exports.object({
|
|
28220
|
+
schemaVersion: external_exports.literal("v1"),
|
|
28221
|
+
id: starterKitIdSchema,
|
|
28222
|
+
name: external_exports.string().min(1),
|
|
28223
|
+
description: external_exports.string().min(1),
|
|
28224
|
+
tagline: external_exports.string().min(1).optional(),
|
|
28225
|
+
category: starterKitCategorySchema,
|
|
28226
|
+
icon: external_exports.string().min(1).optional(),
|
|
28227
|
+
video: external_exports.url().optional(),
|
|
28228
|
+
docsUrl: external_exports.url().optional(),
|
|
28229
|
+
image: starterKitImageSchema.optional(),
|
|
28230
|
+
resources: starterKitResourcesSchema.optional(),
|
|
28231
|
+
knowledgeBase: starterKitKnowledgeBaseSchema.optional(),
|
|
28232
|
+
install: starterKitInstallSchema.optional(),
|
|
28233
|
+
harnesses: external_exports.array(harnessFamilySchema).min(1).optional(),
|
|
28234
|
+
providers: providerListSchema.min(1).optional(),
|
|
28235
|
+
seed: external_exports.object({
|
|
28236
|
+
url: external_exports.url().optional(),
|
|
28237
|
+
self: external_exports.literal(true).optional(),
|
|
28238
|
+
ref: external_exports.string().min(1).optional(),
|
|
28239
|
+
commit: external_exports.string().regex(/^[0-9a-f]{40}$/i).optional(),
|
|
28240
|
+
into: external_exports.enum(["work", "home"]).default("work")
|
|
28241
|
+
}).meta({
|
|
28242
|
+
oneOf: [{ required: ["url"] }, { required: ["self"] }]
|
|
28243
|
+
}).refine((seed) => (seed.url ? 1 : 0) + (seed.self ? 1 : 0) === 1, {
|
|
28244
|
+
message: "a seed names exactly one of `url` (another repository) or `self: true` (the repository this kit is read from)"
|
|
28245
|
+
}).optional(),
|
|
28246
|
+
onboarding: external_exports.union([
|
|
28247
|
+
external_exports.literal(false),
|
|
28248
|
+
external_exports.object({ prompt: external_exports.string().min(1) }),
|
|
28249
|
+
external_exports.object({ command: harnessCommandNameSchema })
|
|
28250
|
+
]).optional(),
|
|
28251
|
+
connections: external_exports.array(starterKitConnectionRequirementSchema).default([]),
|
|
28252
|
+
channels: external_exports.array(starterKitChannelSchema).default([]),
|
|
28253
|
+
schedules: external_exports.array(starterKitScheduleSchema).default([]),
|
|
28254
|
+
skills: external_exports.array(starterKitExternalSkillSchema).default([]),
|
|
28255
|
+
bundledSkills: starterKitBundledSkillsSchema.optional(),
|
|
28256
|
+
env: external_exports.array(starterKitEnvVarSchema).default([]),
|
|
28257
|
+
hibernationTimeoutMin: external_exports.number().int().min(0).optional()
|
|
28258
|
+
});
|
|
28259
|
+
var onboardingStepSchema = external_exports.object({
|
|
28260
|
+
id: external_exports.string().min(1).max(64),
|
|
28261
|
+
label: external_exports.string().min(1).max(120),
|
|
28262
|
+
done: external_exports.boolean()
|
|
28263
|
+
});
|
|
28264
|
+
var starterKitCatalogEntrySchema = external_exports.object({
|
|
28265
|
+
path: external_exports.string().min(1).default("."),
|
|
28266
|
+
url: external_exports.url().optional(),
|
|
28267
|
+
ref: external_exports.string().min(1).optional()
|
|
28268
|
+
});
|
|
28269
|
+
var starterKitCatalogSchema = external_exports.object({
|
|
28270
|
+
kits: external_exports.array(starterKitCatalogEntrySchema)
|
|
28271
|
+
});
|
|
28272
|
+
var starterKitGetInputSchema = external_exports.object({
|
|
28273
|
+
catalog: starterKitCatalogNameSchema,
|
|
28274
|
+
id: starterKitIdSchema
|
|
28275
|
+
});
|
|
28276
|
+
var starterKitScheduleTimingSchema = external_exports.union([
|
|
28277
|
+
external_exports.object({ cron: external_exports.string().min(1) }),
|
|
28278
|
+
external_exports.object({ rrule: external_exports.string().min(1), timezone: external_exports.string().min(1) })
|
|
28279
|
+
]);
|
|
28280
|
+
var starterKitScheduleOverrideSchema = external_exports.object({
|
|
28281
|
+
name: external_exports.string().min(1),
|
|
28282
|
+
timing: starterKitScheduleTimingSchema.optional(),
|
|
28283
|
+
sessionMode: external_exports.enum(["continuous", "fresh"]).optional(),
|
|
28284
|
+
enabled: external_exports.boolean().optional(),
|
|
28285
|
+
quietHours: external_exports.array(quietWindowSchema).optional(),
|
|
28286
|
+
precheck: precheckSchema.nullable().optional()
|
|
28287
|
+
});
|
|
28288
|
+
var starterKitApplyInputSchema = external_exports.object({
|
|
28289
|
+
catalog: starterKitCatalogNameSchema,
|
|
28290
|
+
kitId: starterKitIdSchema,
|
|
27816
28291
|
name: external_exports.string().min(1).refine((n) => !n.startsWith("agent-"), {
|
|
27817
28292
|
message: "agent name cannot start with 'agent-' (reserved for IDs)"
|
|
27818
28293
|
}),
|
|
27819
|
-
templateId: external_exports.string().optional(),
|
|
27820
|
-
|
|
27821
|
-
|
|
27822
|
-
|
|
27823
|
-
|
|
27824
|
-
|
|
27825
|
-
kbTemplateId: knowledgeBaseTemplateIdSchema.default("llm-wiki")
|
|
27826
|
-
}).refine((d2) => d2.templateId !== void 0 || d2.image !== void 0, {
|
|
27827
|
-
message: "Either templateId or image is required"
|
|
28294
|
+
templateId: external_exports.string().min(1).optional(),
|
|
28295
|
+
connectionIds: external_exports.array(external_exports.string().min(1)).default([]),
|
|
28296
|
+
slackChannelId: external_exports.string().min(1).optional(),
|
|
28297
|
+
skipSchedules: external_exports.array(external_exports.string().min(1)).default([]),
|
|
28298
|
+
scheduleOverrides: external_exports.array(starterKitScheduleOverrideSchema).default([]),
|
|
28299
|
+
skipSeed: external_exports.boolean().optional()
|
|
27828
28300
|
});
|
|
27829
28301
|
|
|
27830
28302
|
// ../api-server-api/src/modules/kb-shares/schemas.ts
|
|
@@ -27853,6 +28325,14 @@ var kbSharePublishStateSchema = external_exports.enum([
|
|
|
27853
28325
|
"failed"
|
|
27854
28326
|
]);
|
|
27855
28327
|
|
|
28328
|
+
// ../api-server-api/src/modules/artifact-library/prompt.ts
|
|
28329
|
+
var ARTIFACT_PROMPT_TYPE = "artifact.prompt";
|
|
28330
|
+
var ARTIFACT_PROMPT_MAX_LENGTH = 16384;
|
|
28331
|
+
var artifactPromptSchema = external_exports.object({
|
|
28332
|
+
type: external_exports.literal(ARTIFACT_PROMPT_TYPE),
|
|
28333
|
+
prompt: external_exports.string().trim().min(1).max(ARTIFACT_PROMPT_MAX_LENGTH)
|
|
28334
|
+
});
|
|
28335
|
+
|
|
27856
28336
|
// ../api-server-api/src/modules/artifact-library/schemas.ts
|
|
27857
28337
|
var artifactKindSchema = external_exports.enum([
|
|
27858
28338
|
"html",
|
|
@@ -27870,6 +28350,7 @@ var artifactVisibilitySchema = external_exports.enum([
|
|
|
27870
28350
|
var artifactCreateVisibilitySchema = external_exports.enum(["private", "public"]);
|
|
27871
28351
|
var VIEWER_ALLOWLIST_MAX = 50;
|
|
27872
28352
|
var viewerEmailSchema = external_exports.string().trim().toLowerCase().pipe(external_exports.email().max(254));
|
|
28353
|
+
var artifactVersionAuthorSchema = external_exports.enum(["user", "agent"]);
|
|
27873
28354
|
var ARTIFACT_TITLE_MAX_LENGTH = 300;
|
|
27874
28355
|
var titleSchema = external_exports.string().trim().min(1, "title is required").max(ARTIFACT_TITLE_MAX_LENGTH);
|
|
27875
28356
|
var fileNameSchema = external_exports.string().trim().min(1).max(255);
|
|
@@ -27889,6 +28370,7 @@ var contentOrUploadRef = {
|
|
|
27889
28370
|
content: external_exports.string().max(INLINE_CONTENT_MAX_BYTES).optional(),
|
|
27890
28371
|
uploadRef: external_exports.string().min(1).max(1024).optional()
|
|
27891
28372
|
};
|
|
28373
|
+
var sourcePathSchema = external_exports.string().trim().min(1).max(1024);
|
|
27892
28374
|
var artifactCreateInputSchema = external_exports.object({
|
|
27893
28375
|
title: titleSchema,
|
|
27894
28376
|
...contentOrUploadRef,
|
|
@@ -27897,7 +28379,10 @@ var artifactCreateInputSchema = external_exports.object({
|
|
|
27897
28379
|
contentType: external_exports.string().trim().min(1).max(200).optional(),
|
|
27898
28380
|
folderId: external_exports.string().min(1).optional(),
|
|
27899
28381
|
visibility: artifactCreateVisibilitySchema.optional(),
|
|
27900
|
-
|
|
28382
|
+
interactive: external_exports.boolean().optional(),
|
|
28383
|
+
expiresInHours: expiresInHoursSchema.nullish(),
|
|
28384
|
+
sourcePath: sourcePathSchema.optional(),
|
|
28385
|
+
agentId: external_exports.string().min(1).optional()
|
|
27901
28386
|
}).refine((v2) => v2.content == null !== (v2.uploadRef == null), {
|
|
27902
28387
|
message: "provide exactly one of content or uploadRef",
|
|
27903
28388
|
path: ["content"]
|
|
@@ -27908,7 +28393,9 @@ var artifactUpdateInputSchema = external_exports.object({
|
|
|
27908
28393
|
folderId: external_exports.string().min(1).nullish(),
|
|
27909
28394
|
...contentOrUploadRef,
|
|
27910
28395
|
fileName: fileNameSchema.optional(),
|
|
27911
|
-
contentType: external_exports.string().trim().min(1).max(200).optional()
|
|
28396
|
+
contentType: external_exports.string().trim().min(1).max(200).optional(),
|
|
28397
|
+
sourcePath: sourcePathSchema.optional(),
|
|
28398
|
+
expectedVersion: external_exports.number().int().positive().optional()
|
|
27912
28399
|
}).refine((v2) => !(v2.content != null && v2.uploadRef != null), {
|
|
27913
28400
|
message: "provide at most one of content or uploadRef",
|
|
27914
28401
|
path: ["content"]
|
|
@@ -27956,7 +28443,9 @@ var artifactTouchListInputSchema = external_exports.object({
|
|
|
27956
28443
|
var featureIdSchema = external_exports.enum([
|
|
27957
28444
|
"advanced-connections",
|
|
27958
28445
|
"vm-sandboxes",
|
|
27959
|
-
"session-costs"
|
|
28446
|
+
"session-costs",
|
|
28447
|
+
"interactive-artifacts",
|
|
28448
|
+
"agent-telemetry"
|
|
27960
28449
|
]);
|
|
27961
28450
|
var featureSetFlagInputSchema = external_exports.object({
|
|
27962
28451
|
feature: featureIdSchema,
|
|
@@ -31006,153 +31495,6 @@ function parseHHMM(s) {
|
|
|
31006
31495
|
return h2 * 60 + mi;
|
|
31007
31496
|
}
|
|
31008
31497
|
|
|
31009
|
-
// ../api-server-api/src/modules/connections/providers.ts
|
|
31010
|
-
var DEFAULT_ENV_PLACEHOLDER = "dummy-placeholder";
|
|
31011
|
-
var IBM_LITELLM_HOST = "ete-litellm.ai-models.vpc.res.ibm.com";
|
|
31012
|
-
var IBM_LITELLM_BASE_URL = `https://${IBM_LITELLM_HOST}`;
|
|
31013
|
-
function ibmLitellmEnvMappings() {
|
|
31014
|
-
return [
|
|
31015
|
-
{ envName: "ANTHROPIC_AUTH_TOKEN", placeholder: "sk-dummy" },
|
|
31016
|
-
{ envName: "ANTHROPIC_BASE_URL", placeholder: IBM_LITELLM_BASE_URL },
|
|
31017
|
-
{ envName: "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS", placeholder: "1" },
|
|
31018
|
-
{ envName: "OPENAI_PROXY_URL", placeholder: IBM_LITELLM_BASE_URL },
|
|
31019
|
-
{ envName: "OPENAI_PROXY_MODEL", placeholder: "aws/claude-opus-4-8" },
|
|
31020
|
-
{ envName: "OPENAI_PROXY_CONTEXT_WINDOW", placeholder: "200000" },
|
|
31021
|
-
{ envName: "OPENAI_PROXY_MAX_TOKENS", placeholder: "8192" },
|
|
31022
|
-
{ envName: "OPENAI_API_KEY", placeholder: DEFAULT_ENV_PLACEHOLDER },
|
|
31023
|
-
{ envName: "OPENAI_BASE_URL", placeholder: IBM_LITELLM_BASE_URL },
|
|
31024
|
-
{ envName: "OPENAI_MODEL", placeholder: "gpt-5.5" }
|
|
31025
|
-
];
|
|
31026
|
-
}
|
|
31027
|
-
function openaiEnvMappings() {
|
|
31028
|
-
return [
|
|
31029
|
-
{ envName: "OPENAI_API_KEY", placeholder: DEFAULT_ENV_PLACEHOLDER },
|
|
31030
|
-
{ envName: "OPENAI_BASE_URL", placeholder: "https://api.openai.com/v1" }
|
|
31031
|
-
];
|
|
31032
|
-
}
|
|
31033
|
-
var BOB_HOST = "api.us-east.bob.ibm.com";
|
|
31034
|
-
var BOB_PLACEHOLDER = "dummy-placeholder";
|
|
31035
|
-
function bobEnvMappings(pins = {}) {
|
|
31036
|
-
const out = [
|
|
31037
|
-
{ envName: "BOBSHELL_API_KEY", placeholder: BOB_PLACEHOLDER }
|
|
31038
|
-
];
|
|
31039
|
-
const push = (envName, value) => {
|
|
31040
|
-
const trimmed = value?.trim();
|
|
31041
|
-
if (trimmed) out.push({ envName, placeholder: trimmed });
|
|
31042
|
-
};
|
|
31043
|
-
push("BOB_SHELL_MODEL", pins.model);
|
|
31044
|
-
push("BOB_INSTANCE_ID", pins.agentId);
|
|
31045
|
-
push("BOB_TEAM_ID", pins.teamId);
|
|
31046
|
-
push("BOB_MAX_COINS", pins.maxCost);
|
|
31047
|
-
push("BOB_CHAT_MODE", pins.chatMode);
|
|
31048
|
-
return out;
|
|
31049
|
-
}
|
|
31050
|
-
var PROVIDERS = {
|
|
31051
|
-
anthropic: {
|
|
31052
|
-
id: "anthropic",
|
|
31053
|
-
displayName: "Anthropic",
|
|
31054
|
-
hostPattern: "api.anthropic.com",
|
|
31055
|
-
modes: [
|
|
31056
|
-
{
|
|
31057
|
-
key: "oauth",
|
|
31058
|
-
label: "OAuth Token",
|
|
31059
|
-
templateId: "anthropic-oauth",
|
|
31060
|
-
tokenPrefix: "sk-ant-oat",
|
|
31061
|
-
defaultEnvMappings: [
|
|
31062
|
-
{
|
|
31063
|
-
envName: "CLAUDE_CODE_OAUTH_TOKEN",
|
|
31064
|
-
placeholder: DEFAULT_ENV_PLACEHOLDER
|
|
31065
|
-
}
|
|
31066
|
-
]
|
|
31067
|
-
},
|
|
31068
|
-
{
|
|
31069
|
-
key: "api-key",
|
|
31070
|
-
label: "API Key",
|
|
31071
|
-
templateId: "anthropic",
|
|
31072
|
-
tokenPrefix: "sk-ant-api",
|
|
31073
|
-
isDefault: true,
|
|
31074
|
-
defaultEnvMappings: [
|
|
31075
|
-
{
|
|
31076
|
-
envName: "ANTHROPIC_API_KEY",
|
|
31077
|
-
placeholder: DEFAULT_ENV_PLACEHOLDER
|
|
31078
|
-
}
|
|
31079
|
-
],
|
|
31080
|
-
injection: { headerName: "x-api-key", valueFormat: "{value}" }
|
|
31081
|
-
}
|
|
31082
|
-
]
|
|
31083
|
-
},
|
|
31084
|
-
"ibm-litellm": {
|
|
31085
|
-
id: "ibm-litellm",
|
|
31086
|
-
displayName: "IBM LiteLLM ETE Proxy",
|
|
31087
|
-
hostPattern: IBM_LITELLM_HOST,
|
|
31088
|
-
modes: [
|
|
31089
|
-
{
|
|
31090
|
-
key: "api-key",
|
|
31091
|
-
label: "API Token",
|
|
31092
|
-
templateId: "ibm-litellm",
|
|
31093
|
-
defaultEnvMappings: ibmLitellmEnvMappings()
|
|
31094
|
-
}
|
|
31095
|
-
]
|
|
31096
|
-
},
|
|
31097
|
-
openai: {
|
|
31098
|
-
id: "openai",
|
|
31099
|
-
displayName: "OpenAI",
|
|
31100
|
-
hostPattern: "api.openai.com",
|
|
31101
|
-
pathPattern: "/v1/*",
|
|
31102
|
-
modes: [
|
|
31103
|
-
{
|
|
31104
|
-
key: "api-key",
|
|
31105
|
-
label: "API Key",
|
|
31106
|
-
templateId: "openai",
|
|
31107
|
-
defaultEnvMappings: openaiEnvMappings()
|
|
31108
|
-
}
|
|
31109
|
-
]
|
|
31110
|
-
},
|
|
31111
|
-
bob: {
|
|
31112
|
-
id: "bob",
|
|
31113
|
-
displayName: "Bob Shell",
|
|
31114
|
-
hostPattern: BOB_HOST,
|
|
31115
|
-
modes: [
|
|
31116
|
-
{
|
|
31117
|
-
key: "api-key",
|
|
31118
|
-
label: "API Key",
|
|
31119
|
-
templateId: "bob",
|
|
31120
|
-
defaultEnvMappings: bobEnvMappings(),
|
|
31121
|
-
injection: {
|
|
31122
|
-
headerName: "Authorization",
|
|
31123
|
-
valueFormat: "Apikey {value}"
|
|
31124
|
-
},
|
|
31125
|
-
extraInjections: [
|
|
31126
|
-
{ headerName: "X-Bobshell-Internal", queryParamName: "key" }
|
|
31127
|
-
]
|
|
31128
|
-
}
|
|
31129
|
-
]
|
|
31130
|
-
}
|
|
31131
|
-
};
|
|
31132
|
-
var PROVIDER_PRESET_TYPES = Object.keys(
|
|
31133
|
-
PROVIDERS
|
|
31134
|
-
);
|
|
31135
|
-
var TEMPLATE_TO_PROVIDER = new Map(
|
|
31136
|
-
PROVIDER_PRESET_TYPES.flatMap(
|
|
31137
|
-
(type) => PROVIDERS[type].modes.map(
|
|
31138
|
-
(mode) => [mode.templateId, type]
|
|
31139
|
-
)
|
|
31140
|
-
)
|
|
31141
|
-
);
|
|
31142
|
-
var PROVIDER_TEMPLATE_IDS = new Set(
|
|
31143
|
-
TEMPLATE_TO_PROVIDER.keys()
|
|
31144
|
-
);
|
|
31145
|
-
function providerTypeForTemplateId(templateId) {
|
|
31146
|
-
return TEMPLATE_TO_PROVIDER.get(templateId) ?? null;
|
|
31147
|
-
}
|
|
31148
|
-
function templateIdForProvider(type, value) {
|
|
31149
|
-
const modes = PROVIDERS[type].modes;
|
|
31150
|
-
const matched = modes.find(
|
|
31151
|
-
(mode) => mode.tokenPrefix !== void 0 && value.startsWith(mode.tokenPrefix)
|
|
31152
|
-
);
|
|
31153
|
-
return (matched ?? modes.find((mode) => mode.isDefault) ?? modes[0]).templateId;
|
|
31154
|
-
}
|
|
31155
|
-
|
|
31156
31498
|
// ../api-server-api/src/modules/case-studies/constants.ts
|
|
31157
31499
|
var CASE_STUDY_CONTENT_MAX_CHARS = 262144;
|
|
31158
31500
|
var CASE_STUDY_SKILL_NAME = "agent-case-study";
|
|
@@ -31194,8 +31536,10 @@ var caseStudyInspectionFilterSchema = external_exports.object({
|
|
|
31194
31536
|
var METRICS_MAX_SINCE_HOURS = 720;
|
|
31195
31537
|
var METRICS_MAX_LIMIT = 1e3;
|
|
31196
31538
|
var METRICS_DEFAULT_LIMIT = 100;
|
|
31197
|
-
var
|
|
31198
|
-
var
|
|
31539
|
+
var AGENT_TELEMETRY_MAX_DAYS = 30;
|
|
31540
|
+
var AGENT_TELEMETRY_DEFAULT_DAYS = 7;
|
|
31541
|
+
var AGENT_TELEMETRY_MAX_LIMIT = 200;
|
|
31542
|
+
var AGENT_TELEMETRY_DEFAULT_LIMIT = 50;
|
|
31199
31543
|
|
|
31200
31544
|
// ../api-server-api/src/modules/metrics/schemas.ts
|
|
31201
31545
|
var metricsOverviewInputSchema = external_exports.object({
|
|
@@ -31204,9 +31548,22 @@ var metricsOverviewInputSchema = external_exports.object({
|
|
|
31204
31548
|
sinceHours: external_exports.coerce.number().int().positive().max(METRICS_MAX_SINCE_HOURS).optional(),
|
|
31205
31549
|
limit: external_exports.coerce.number().int().positive().max(METRICS_MAX_LIMIT).default(METRICS_DEFAULT_LIMIT)
|
|
31206
31550
|
});
|
|
31207
|
-
var
|
|
31208
|
-
days: external_exports.number().int().min(1).max(
|
|
31209
|
-
`Window length in days, counted back from now (default ${
|
|
31551
|
+
var agentTelemetryShape = {
|
|
31552
|
+
days: external_exports.number().int().min(1).max(AGENT_TELEMETRY_MAX_DAYS).default(AGENT_TELEMETRY_DEFAULT_DAYS).describe(
|
|
31553
|
+
`Window length in days, counted back from now (default ${AGENT_TELEMETRY_DEFAULT_DAYS}, max ${AGENT_TELEMETRY_MAX_DAYS}).`
|
|
31554
|
+
),
|
|
31555
|
+
sessionId: external_exports.string().min(1).optional().describe(
|
|
31556
|
+
"Narrow to a single session, including any harness run that session spawned. Omit to cover every session in the window."
|
|
31557
|
+
),
|
|
31558
|
+
limit: external_exports.number().int().positive().max(AGENT_TELEMETRY_MAX_LIMIT).default(AGENT_TELEMETRY_DEFAULT_LIMIT).describe(
|
|
31559
|
+
`Most rows to return, newest first (default ${AGENT_TELEMETRY_DEFAULT_LIMIT}, max ${AGENT_TELEMETRY_MAX_LIMIT}). Bounds the row list only; a result's own totalsCover states what its totals span.`
|
|
31560
|
+
)
|
|
31561
|
+
};
|
|
31562
|
+
var agentTelemetryInputSchema = external_exports.object(agentTelemetryShape);
|
|
31563
|
+
var agentMetricsInputSchema = external_exports.object({
|
|
31564
|
+
...agentTelemetryShape,
|
|
31565
|
+
granularity: external_exports.enum(["summary", "session", "call"]).default("summary").describe(
|
|
31566
|
+
"Detail level. 'summary': window totals and the per-model split. 'session': adds a row per session \u2014 calls, model time, tokens, cost, first/last activity. 'call': adds a row per LLM call \u2014 model, request latency, tokens, context size, cost."
|
|
31210
31567
|
)
|
|
31211
31568
|
});
|
|
31212
31569
|
var metricsSpendInputSchema = external_exports.object({
|
|
@@ -31365,11 +31722,16 @@ var templateInput = external_exports.object({
|
|
|
31365
31722
|
patternHint: external_exports.string().optional(),
|
|
31366
31723
|
enumValues: external_exports.array(external_exports.string()).optional()
|
|
31367
31724
|
});
|
|
31725
|
+
var connectionFamilyView = external_exports.object({
|
|
31726
|
+
id: external_exports.string(),
|
|
31727
|
+
title: external_exports.string()
|
|
31728
|
+
});
|
|
31368
31729
|
var connectionTemplateView = external_exports.object({
|
|
31369
31730
|
id: external_exports.string(),
|
|
31370
31731
|
name: external_exports.string(),
|
|
31371
31732
|
category: connectionCategory,
|
|
31372
31733
|
isCustom: external_exports.boolean(),
|
|
31734
|
+
family: connectionFamilyView.optional(),
|
|
31373
31735
|
description: external_exports.string().optional(),
|
|
31374
31736
|
iconSlug: external_exports.string().optional(),
|
|
31375
31737
|
authKind,
|
|
@@ -31521,6 +31883,16 @@ var SessionMode = /* @__PURE__ */ ((SessionMode2) => {
|
|
|
31521
31883
|
})(SessionMode || {});
|
|
31522
31884
|
var sessionModeSchema = external_exports.enum(SessionMode);
|
|
31523
31885
|
|
|
31886
|
+
// ../api-server-api/src/modules/attention/schemas.ts
|
|
31887
|
+
var attentionDismissInputSchema = external_exports.object({
|
|
31888
|
+
items: external_exports.array(
|
|
31889
|
+
external_exports.object({
|
|
31890
|
+
kind: external_exports.enum(["session", "approval"]),
|
|
31891
|
+
id: external_exports.string().trim().min(1).max(512)
|
|
31892
|
+
})
|
|
31893
|
+
).min(1).max(200)
|
|
31894
|
+
});
|
|
31895
|
+
|
|
31524
31896
|
// ../api-server-api/src/modules/terminal/protocol.ts
|
|
31525
31897
|
var OP_INPUT = 0;
|
|
31526
31898
|
var OP_OUTPUT = 1;
|
|
@@ -31680,6 +32052,11 @@ var platformTurnEndedNotificationSchema = external_exports.object({
|
|
|
31680
32052
|
method: external_exports.literal("platform/turnEnded"),
|
|
31681
32053
|
params: platformTurnEndedParamsSchema
|
|
31682
32054
|
});
|
|
32055
|
+
var platformFrameMetaSchema = external_exports.object({
|
|
32056
|
+
at: external_exports.string().datetime({ offset: true }).optional(),
|
|
32057
|
+
replayFor: external_exports.string().min(1).optional(),
|
|
32058
|
+
telemetryPromptId: external_exports.string().min(1).optional()
|
|
32059
|
+
});
|
|
31683
32060
|
var platformClippedReplayMetaSchema = external_exports.object({
|
|
31684
32061
|
older: external_exports.string().min(1).optional()
|
|
31685
32062
|
});
|
|
@@ -31734,8 +32111,21 @@ var platformRunResultSchema = external_exports.object({
|
|
|
31734
32111
|
var platformRunResultResponseSchema = external_exports.discriminatedUnion("status", [
|
|
31735
32112
|
external_exports.object({ status: external_exports.literal("done"), result: platformRunResultSchema }),
|
|
31736
32113
|
external_exports.object({ status: external_exports.literal("pending") }),
|
|
32114
|
+
external_exports.object({ status: external_exports.literal("interrupted") }),
|
|
31737
32115
|
external_exports.object({ status: external_exports.literal("none") })
|
|
31738
32116
|
]);
|
|
32117
|
+
var platformRunStartsMetaSchema = external_exports.array(
|
|
32118
|
+
external_exports.string().datetime({ offset: true })
|
|
32119
|
+
);
|
|
32120
|
+
var platformRunStartedParamsSchema = external_exports.object({
|
|
32121
|
+
sessionId: external_exports.string().min(1),
|
|
32122
|
+
at: external_exports.string().datetime({ offset: true })
|
|
32123
|
+
});
|
|
32124
|
+
var platformRunStartedNotificationSchema = external_exports.object({
|
|
32125
|
+
jsonrpc: external_exports.literal("2.0"),
|
|
32126
|
+
method: external_exports.literal("platform/runStarted"),
|
|
32127
|
+
params: platformRunStartedParamsSchema
|
|
32128
|
+
});
|
|
31739
32129
|
var platformPromptStartedParamsSchema = external_exports.object({
|
|
31740
32130
|
sessionId: external_exports.string().min(1),
|
|
31741
32131
|
promptId: external_exports.string().min(1)
|
|
@@ -31809,7 +32199,8 @@ var termsLatestAcceptanceSchema = external_exports.object({
|
|
|
31809
32199
|
var entryPointChoiceSchema = external_exports.enum([
|
|
31810
32200
|
"sandbox",
|
|
31811
32201
|
"experiment",
|
|
31812
|
-
"knowledge-base"
|
|
32202
|
+
"knowledge-base",
|
|
32203
|
+
"starter-kit"
|
|
31813
32204
|
]);
|
|
31814
32205
|
var entryPointChosenInputSchema = external_exports.object({
|
|
31815
32206
|
choice: entryPointChoiceSchema
|
|
@@ -31889,9 +32280,23 @@ var slackFireCommandInputSchema = external_exports.object({
|
|
|
31889
32280
|
channelId: external_exports.string().min(1)
|
|
31890
32281
|
}).strict();
|
|
31891
32282
|
var slackFireCommandResultSchema = external_exports.object({ ack: external_exports.string() }).strict();
|
|
32283
|
+
var slackConnectWorkspaceInputSchema = external_exports.object({
|
|
32284
|
+
teamId: external_exports.string().min(1),
|
|
32285
|
+
teamName: external_exports.string().optional(),
|
|
32286
|
+
botToken: external_exports.string().min(1),
|
|
32287
|
+
channels: external_exports.array(
|
|
32288
|
+
external_exports.object({
|
|
32289
|
+
id: external_exports.string().min(1),
|
|
32290
|
+
name: external_exports.string().min(1),
|
|
32291
|
+
botIsMember: external_exports.boolean()
|
|
32292
|
+
}).strict()
|
|
32293
|
+
)
|
|
32294
|
+
}).strict();
|
|
32295
|
+
var slackConnectWorkspaceResultSchema = external_exports.object({ ok: external_exports.literal(true), secretPath: external_exports.string() }).strict();
|
|
31892
32296
|
var slackOutboundRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
31893
32297
|
external_exports.object({
|
|
31894
32298
|
kind: external_exports.literal("message"),
|
|
32299
|
+
teamId: external_exports.string(),
|
|
31895
32300
|
channel: external_exports.string(),
|
|
31896
32301
|
text: external_exports.string(),
|
|
31897
32302
|
threadTs: external_exports.string().optional(),
|
|
@@ -31899,6 +32304,7 @@ var slackOutboundRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
|
31899
32304
|
}).strict(),
|
|
31900
32305
|
external_exports.object({
|
|
31901
32306
|
kind: external_exports.literal("ephemeral"),
|
|
32307
|
+
teamId: external_exports.string(),
|
|
31902
32308
|
channel: external_exports.string(),
|
|
31903
32309
|
user: external_exports.string(),
|
|
31904
32310
|
text: external_exports.string(),
|
|
@@ -31906,18 +32312,21 @@ var slackOutboundRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
|
31906
32312
|
}).strict(),
|
|
31907
32313
|
external_exports.object({
|
|
31908
32314
|
kind: external_exports.literal("reaction"),
|
|
32315
|
+
teamId: external_exports.string(),
|
|
31909
32316
|
channel: external_exports.string(),
|
|
31910
32317
|
ts: external_exports.string(),
|
|
31911
32318
|
name: external_exports.string()
|
|
31912
32319
|
}).strict(),
|
|
31913
32320
|
external_exports.object({
|
|
31914
32321
|
kind: external_exports.literal("upload"),
|
|
32322
|
+
teamId: external_exports.string(),
|
|
31915
32323
|
channelId: external_exports.string(),
|
|
31916
32324
|
filename: external_exports.string(),
|
|
31917
32325
|
threadTs: external_exports.string().optional()
|
|
31918
32326
|
}).strict(),
|
|
31919
32327
|
external_exports.object({
|
|
31920
32328
|
kind: external_exports.literal("stream_start"),
|
|
32329
|
+
teamId: external_exports.string(),
|
|
31921
32330
|
channel: external_exports.string(),
|
|
31922
32331
|
threadTs: external_exports.string(),
|
|
31923
32332
|
ts: external_exports.string(),
|
|
@@ -31927,18 +32336,21 @@ var slackOutboundRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
|
31927
32336
|
}).strict(),
|
|
31928
32337
|
external_exports.object({
|
|
31929
32338
|
kind: external_exports.literal("stream_append"),
|
|
32339
|
+
teamId: external_exports.string(),
|
|
31930
32340
|
channel: external_exports.string(),
|
|
31931
32341
|
ts: external_exports.string(),
|
|
31932
32342
|
text: external_exports.string()
|
|
31933
32343
|
}).strict(),
|
|
31934
32344
|
external_exports.object({
|
|
31935
32345
|
kind: external_exports.literal("stream_stop"),
|
|
32346
|
+
teamId: external_exports.string(),
|
|
31936
32347
|
channel: external_exports.string(),
|
|
31937
32348
|
ts: external_exports.string(),
|
|
31938
32349
|
text: external_exports.string().optional()
|
|
31939
32350
|
}).strict(),
|
|
31940
32351
|
external_exports.object({
|
|
31941
32352
|
kind: external_exports.literal("status"),
|
|
32353
|
+
teamId: external_exports.string(),
|
|
31942
32354
|
channel: external_exports.string(),
|
|
31943
32355
|
threadTs: external_exports.string(),
|
|
31944
32356
|
status: external_exports.string()
|
|
@@ -32010,6 +32422,62 @@ var kbPublishCompleteInputSchema = external_exports.object({
|
|
|
32010
32422
|
})
|
|
32011
32423
|
});
|
|
32012
32424
|
|
|
32425
|
+
// ../api-server-api/src/modules/telemetry/constants.ts
|
|
32426
|
+
var TELEMETRY_MAX_SINCE_HOURS = 720;
|
|
32427
|
+
var TELEMETRY_DEFAULT_SINCE_HOURS = 24;
|
|
32428
|
+
var TELEMETRY_MAX_TURNS = 500;
|
|
32429
|
+
var TELEMETRY_DEFAULT_TURNS = 100;
|
|
32430
|
+
var TELEMETRY_MAX_SPANS = 2e3;
|
|
32431
|
+
var TELEMETRY_DEFAULT_SPANS = 1e3;
|
|
32432
|
+
var TELEMETRY_MAX_LOGS = 2e3;
|
|
32433
|
+
var TELEMETRY_DEFAULT_LOGS = 1e3;
|
|
32434
|
+
var TELEMETRY_MAX_LOG_ROWS = 1e3;
|
|
32435
|
+
var TELEMETRY_DEFAULT_LOG_ROWS = 200;
|
|
32436
|
+
var TELEMETRY_MAX_TRACE_HOURS = 6;
|
|
32437
|
+
|
|
32438
|
+
// ../api-server-api/src/modules/telemetry/schemas.ts
|
|
32439
|
+
var traceId = external_exports.string().min(1).max(64).regex(/^[0-9a-fA-F]+$/, { message: "traceId must be hexadecimal" });
|
|
32440
|
+
var sinceHours = external_exports.coerce.number().int().positive().max(TELEMETRY_MAX_SINCE_HOURS).default(TELEMETRY_DEFAULT_SINCE_HOURS);
|
|
32441
|
+
var telemetryTurnsInputSchema = external_exports.object({
|
|
32442
|
+
agentId: external_exports.string().min(1),
|
|
32443
|
+
sessionId: external_exports.string().min(1),
|
|
32444
|
+
sinceHours,
|
|
32445
|
+
limit: external_exports.coerce.number().int().positive().max(TELEMETRY_MAX_TURNS).default(TELEMETRY_DEFAULT_TURNS),
|
|
32446
|
+
spanLimit: external_exports.coerce.number().int().positive().max(TELEMETRY_MAX_SPANS).default(TELEMETRY_DEFAULT_SPANS),
|
|
32447
|
+
logLimit: external_exports.coerce.number().int().positive().max(TELEMETRY_MAX_LOGS).default(TELEMETRY_DEFAULT_LOGS)
|
|
32448
|
+
});
|
|
32449
|
+
var telemetryTurnInputSchema = external_exports.object({
|
|
32450
|
+
agentId: external_exports.string().min(1),
|
|
32451
|
+
sessionId: external_exports.string().min(1),
|
|
32452
|
+
promptId: external_exports.string().min(1).max(200).optional(),
|
|
32453
|
+
from: external_exports.string().datetime(),
|
|
32454
|
+
to: external_exports.string().datetime(),
|
|
32455
|
+
spanLimit: external_exports.coerce.number().int().positive().max(TELEMETRY_MAX_SPANS).default(TELEMETRY_DEFAULT_SPANS),
|
|
32456
|
+
logLimit: external_exports.coerce.number().int().positive().max(TELEMETRY_MAX_LOGS).default(TELEMETRY_DEFAULT_LOGS)
|
|
32457
|
+
}).refine(
|
|
32458
|
+
(q2) => Date.parse(q2.to) - Date.parse(q2.from) <= TELEMETRY_MAX_TRACE_HOURS * 36e5,
|
|
32459
|
+
{
|
|
32460
|
+
message: `a turn window may not exceed ${TELEMETRY_MAX_TRACE_HOURS} hours`,
|
|
32461
|
+
path: ["to"]
|
|
32462
|
+
}
|
|
32463
|
+
);
|
|
32464
|
+
var telemetryLogsInputSchema = external_exports.object({
|
|
32465
|
+
agentId: external_exports.string().min(1).optional(),
|
|
32466
|
+
sessionId: external_exports.string().min(1).optional(),
|
|
32467
|
+
traceId: traceId.optional(),
|
|
32468
|
+
event: external_exports.string().min(1).max(200).optional(),
|
|
32469
|
+
contains: external_exports.string().min(1).max(200).optional(),
|
|
32470
|
+
sinceHours,
|
|
32471
|
+
limit: external_exports.coerce.number().int().positive().max(TELEMETRY_MAX_LOG_ROWS).default(TELEMETRY_DEFAULT_LOG_ROWS)
|
|
32472
|
+
});
|
|
32473
|
+
var telemetryExportSignalSchema = external_exports.enum(["spans", "logs"]);
|
|
32474
|
+
var telemetryExportQuerySchema = external_exports.object({
|
|
32475
|
+
agentId: external_exports.string().min(1).optional(),
|
|
32476
|
+
sessionId: external_exports.string().min(1).optional(),
|
|
32477
|
+
signal: telemetryExportSignalSchema.default("logs"),
|
|
32478
|
+
sinceHours
|
|
32479
|
+
});
|
|
32480
|
+
|
|
32013
32481
|
// src/result.ts
|
|
32014
32482
|
var ok2 = (value) => ({ ok: true, value });
|
|
32015
32483
|
var err2 = (error51) => ({ ok: false, error: error51 });
|
|
@@ -32042,6 +32510,129 @@ async function trpcCall(fn) {
|
|
|
32042
32510
|
}
|
|
32043
32511
|
}
|
|
32044
32512
|
|
|
32513
|
+
// src/modules/connection/services/connection-service.ts
|
|
32514
|
+
function createConnectionService(deps) {
|
|
32515
|
+
const readIds = async (agentId) => {
|
|
32516
|
+
const res = await deps.trpc.connections.getAgentConnections.query({
|
|
32517
|
+
agentId
|
|
32518
|
+
});
|
|
32519
|
+
return res.connections.map((c2) => c2.connectionId);
|
|
32520
|
+
};
|
|
32521
|
+
return {
|
|
32522
|
+
async list() {
|
|
32523
|
+
return trpcCall(() => deps.trpc.connections.list.query());
|
|
32524
|
+
},
|
|
32525
|
+
async listTemplates() {
|
|
32526
|
+
return trpcCall(() => deps.trpc.connections.listTemplates.query());
|
|
32527
|
+
},
|
|
32528
|
+
async createConnection(input) {
|
|
32529
|
+
return trpcCall(() => deps.trpc.connections.create.mutate(input));
|
|
32530
|
+
},
|
|
32531
|
+
async update(id, value) {
|
|
32532
|
+
return trpcCall(async () => {
|
|
32533
|
+
await deps.trpc.connections.update.mutate({ id, value });
|
|
32534
|
+
});
|
|
32535
|
+
},
|
|
32536
|
+
async startOAuth(connectionId) {
|
|
32537
|
+
return trpcCall(
|
|
32538
|
+
() => deps.trpc.connections.startOAuth.mutate({ connectionId })
|
|
32539
|
+
);
|
|
32540
|
+
},
|
|
32541
|
+
async discoverMcp(url2) {
|
|
32542
|
+
return trpcCall(() => deps.trpc.connections.discoverMcp.mutate({ url: url2 }));
|
|
32543
|
+
},
|
|
32544
|
+
async probeClusterCa(host) {
|
|
32545
|
+
return trpcCall(
|
|
32546
|
+
() => deps.trpc.connections.probeClusterCa.mutate({ host })
|
|
32547
|
+
);
|
|
32548
|
+
},
|
|
32549
|
+
async getConnection(id) {
|
|
32550
|
+
return trpcCall(() => deps.trpc.connections.get.query({ id }));
|
|
32551
|
+
},
|
|
32552
|
+
async agentConnectionIds(agentId) {
|
|
32553
|
+
return trpcCall(() => readIds(agentId));
|
|
32554
|
+
},
|
|
32555
|
+
async grant(agentId, add) {
|
|
32556
|
+
return trpcCall(async () => {
|
|
32557
|
+
const current = await readIds(agentId);
|
|
32558
|
+
const next = Array.from(/* @__PURE__ */ new Set([...current, ...add]));
|
|
32559
|
+
await deps.trpc.connections.setAgentConnections.mutate({
|
|
32560
|
+
agentId,
|
|
32561
|
+
connectionIds: next
|
|
32562
|
+
});
|
|
32563
|
+
return next;
|
|
32564
|
+
});
|
|
32565
|
+
},
|
|
32566
|
+
async revoke(agentId, remove) {
|
|
32567
|
+
return trpcCall(async () => {
|
|
32568
|
+
const drop = new Set(remove);
|
|
32569
|
+
const current = await readIds(agentId);
|
|
32570
|
+
const next = current.filter((id) => !drop.has(id));
|
|
32571
|
+
await deps.trpc.connections.setAgentConnections.mutate({
|
|
32572
|
+
agentId,
|
|
32573
|
+
connectionIds: next
|
|
32574
|
+
});
|
|
32575
|
+
return next;
|
|
32576
|
+
});
|
|
32577
|
+
},
|
|
32578
|
+
async disconnect(id) {
|
|
32579
|
+
return trpcCall(async () => {
|
|
32580
|
+
await deps.trpc.connections.delete.mutate({ id });
|
|
32581
|
+
});
|
|
32582
|
+
}
|
|
32583
|
+
};
|
|
32584
|
+
}
|
|
32585
|
+
|
|
32586
|
+
// src/modules/connection/domain/config-inputs.ts
|
|
32587
|
+
function configInputsOf(template) {
|
|
32588
|
+
return template.inputs.filter((i) => i.configInput);
|
|
32589
|
+
}
|
|
32590
|
+
function validateConfigInputValue(input, value) {
|
|
32591
|
+
const trimmed = value.trim();
|
|
32592
|
+
if (trimmed === "") return void 0;
|
|
32593
|
+
const label = input.label ?? input.name;
|
|
32594
|
+
if (input.enumValues && !input.enumValues.includes(trimmed)) {
|
|
32595
|
+
const opts = input.enumValues.map((v2) => `\`${v2}\``).join(", ");
|
|
32596
|
+
return `${label}: must be one of ${opts}`;
|
|
32597
|
+
}
|
|
32598
|
+
if (input.pattern && !new RegExp(`^(?:${input.pattern})$`).test(trimmed)) {
|
|
32599
|
+
const expected = input.patternHint ?? `value matching ${input.pattern}`;
|
|
32600
|
+
return `${label}: expected ${expected}`;
|
|
32601
|
+
}
|
|
32602
|
+
return void 0;
|
|
32603
|
+
}
|
|
32604
|
+
function resolveConfigInputFlags(template, rawFlags) {
|
|
32605
|
+
const byName2 = new Map(configInputsOf(template).map((i) => [i.name, i]));
|
|
32606
|
+
const out = {};
|
|
32607
|
+
for (const raw of rawFlags) {
|
|
32608
|
+
const eq = raw.indexOf("=");
|
|
32609
|
+
if (eq < 0) return err2({ kind: "missing-equals", input: raw });
|
|
32610
|
+
const key = raw.slice(0, eq);
|
|
32611
|
+
const value = raw.slice(eq + 1).trim();
|
|
32612
|
+
const input = byName2.get(key);
|
|
32613
|
+
if (!input) {
|
|
32614
|
+
return err2({ kind: "unknown-key", key, validKeys: [...byName2.keys()] });
|
|
32615
|
+
}
|
|
32616
|
+
if (value === "") {
|
|
32617
|
+
delete out[key];
|
|
32618
|
+
continue;
|
|
32619
|
+
}
|
|
32620
|
+
const message = validateConfigInputValue(input, value);
|
|
32621
|
+
if (message) return err2({ kind: "invalid-value", key, message });
|
|
32622
|
+
out[key] = value;
|
|
32623
|
+
}
|
|
32624
|
+
return ok2(out);
|
|
32625
|
+
}
|
|
32626
|
+
|
|
32627
|
+
// src/modules/connection/domain/connection-ref.ts
|
|
32628
|
+
var CONNECTION_ID_PREFIX = "conn-";
|
|
32629
|
+
function resolveConnectionRef(connections, ref) {
|
|
32630
|
+
if (ref.startsWith(CONNECTION_ID_PREFIX)) {
|
|
32631
|
+
return connections.find((c2) => c2.id === ref) ?? null;
|
|
32632
|
+
}
|
|
32633
|
+
return connections.find((c2) => c2.name === ref) ?? null;
|
|
32634
|
+
}
|
|
32635
|
+
|
|
32045
32636
|
// src/modules/shared/format-zod-error.ts
|
|
32046
32637
|
function formatZodError(err3) {
|
|
32047
32638
|
return err3.issues.map((issue2) => {
|
|
@@ -32326,6 +32917,9 @@ function buildCreateCommand(deps) {
|
|
|
32326
32917
|
"--template <id>",
|
|
32327
32918
|
"template id (required; see `dam template list`)"
|
|
32328
32919
|
).option("--description <text>", "free-form description").option(
|
|
32920
|
+
"--provider <id-or-name>",
|
|
32921
|
+
"model-provider connection id or unique name (required; see `dam connection list`)"
|
|
32922
|
+
).option(
|
|
32329
32923
|
"--env <KEY=VAL>",
|
|
32330
32924
|
"env var, repeatable",
|
|
32331
32925
|
(val, prev) => [...prev, val],
|
|
@@ -32338,9 +32932,9 @@ function buildCreateCommand(deps) {
|
|
|
32338
32932
|
[
|
|
32339
32933
|
"",
|
|
32340
32934
|
"Examples:",
|
|
32341
|
-
" dam agent create my-agent --template claude-code",
|
|
32342
|
-
|
|
32343
|
-
' dam agent create my-agent --template pi-agent --
|
|
32935
|
+
" dam agent create my-agent --template claude-code --provider conn-123",
|
|
32936
|
+
' dam agent create my-agent --template claude-code --provider "My provider" --wait',
|
|
32937
|
+
' dam agent create my-agent --template pi-agent --provider conn-123 --description "Coding helper"',
|
|
32344
32938
|
""
|
|
32345
32939
|
].join("\n")
|
|
32346
32940
|
).action(
|
|
@@ -32369,6 +32963,12 @@ async function runCreate(name, opts, deps) {
|
|
|
32369
32963
|
process.exit(EXIT_INVALID_INPUT);
|
|
32370
32964
|
}
|
|
32371
32965
|
const template = opts.template;
|
|
32966
|
+
if (!opts.provider) {
|
|
32967
|
+
process.stderr.write(
|
|
32968
|
+
"error: `--provider <id-or-name>` is required; run `dam connection list` to choose a model provider, or `dam agent create-interactive` to add one\n"
|
|
32969
|
+
);
|
|
32970
|
+
process.exit(EXIT_INVALID_INPUT);
|
|
32971
|
+
}
|
|
32372
32972
|
const envResult = parseEnvFlag(opts.env ?? []);
|
|
32373
32973
|
if (!envResult.ok) {
|
|
32374
32974
|
if (envResult.error.kind === "missing-equals") {
|
|
@@ -32411,8 +33011,8 @@ async function runCreate(name, opts, deps) {
|
|
|
32411
33011
|
printServiceError(tmplResult.error, host);
|
|
32412
33012
|
process.exit(EXIT_RUNTIME_FAILURE);
|
|
32413
33013
|
}
|
|
32414
|
-
const
|
|
32415
|
-
if (!
|
|
33014
|
+
const selectedTemplate = tmplResult.value.find((t) => t.id === template);
|
|
33015
|
+
if (!selectedTemplate) {
|
|
32416
33016
|
process.stderr.write(
|
|
32417
33017
|
`error: unknown template \`${template}\`; available: ${tmplResult.value.map((t) => t.id).join(", ") || "(none)"}
|
|
32418
33018
|
`
|
|
@@ -32420,11 +33020,36 @@ async function runCreate(name, opts, deps) {
|
|
|
32420
33020
|
process.exit(EXIT_INVALID_INPUT);
|
|
32421
33021
|
}
|
|
32422
33022
|
const trpc = deps.createTrpcClient(host);
|
|
33023
|
+
let providerConnectionId = opts.provider;
|
|
33024
|
+
if (!providerConnectionId.startsWith(CONNECTION_ID_PREFIX)) {
|
|
33025
|
+
const connections = await trpcCall(() => trpc.connections.list.query());
|
|
33026
|
+
if (!connections.ok) {
|
|
33027
|
+
printServiceError(connections.error, host);
|
|
33028
|
+
process.stderr.write(
|
|
33029
|
+
"hint: provider name lookup requires credentials:read; pass --provider <connection-id> to create with agents:manage alone\n"
|
|
33030
|
+
);
|
|
33031
|
+
process.exit(EXIT_RUNTIME_FAILURE);
|
|
33032
|
+
}
|
|
33033
|
+
const matches = connections.value.filter(
|
|
33034
|
+
(connection2) => PROVIDER_TEMPLATE_IDS.has(connection2.templateId) && connection2.name === opts.provider
|
|
33035
|
+
);
|
|
33036
|
+
if (matches.length !== 1) {
|
|
33037
|
+
process.stderr.write(
|
|
33038
|
+
matches.length === 0 ? `error: no model-provider connection matches '${opts.provider}'; run \`dam connection list\` to choose a provider, or \`dam agent create-interactive\` to add one
|
|
33039
|
+
` : `error: multiple model-provider connections are named '${opts.provider}'; pass a connection id from \`dam connection list\`
|
|
33040
|
+
`
|
|
33041
|
+
);
|
|
33042
|
+
process.exit(EXIT_INVALID_INPUT);
|
|
33043
|
+
}
|
|
33044
|
+
providerConnectionId = matches[0].id;
|
|
33045
|
+
}
|
|
32423
33046
|
const createInput = await parseOrExit(
|
|
32424
33047
|
agentCreateInputSchema,
|
|
32425
33048
|
{
|
|
32426
33049
|
name,
|
|
32427
33050
|
templateId: template,
|
|
33051
|
+
connectionIds: [providerConnectionId],
|
|
33052
|
+
providerConnectionId,
|
|
32428
33053
|
description: opts.description,
|
|
32429
33054
|
env: env.length > 0 ? env : void 0
|
|
32430
33055
|
},
|
|
@@ -32434,6 +33059,13 @@ async function runCreate(name, opts, deps) {
|
|
|
32434
33059
|
try {
|
|
32435
33060
|
agent = await trpc.agents.create.mutate(createInput);
|
|
32436
33061
|
} catch (e2) {
|
|
33062
|
+
if (e2?.data?.code === "BAD_REQUEST") {
|
|
33063
|
+
process.stderr.write(
|
|
33064
|
+
`error: failed to create agent: ${errorReason(e2)}
|
|
33065
|
+
`
|
|
33066
|
+
);
|
|
33067
|
+
process.exit(EXIT_INVALID_INPUT);
|
|
33068
|
+
}
|
|
32437
33069
|
if (e2?.data?.code === "NOT_FOUND") {
|
|
32438
33070
|
process.stderr.write(
|
|
32439
33071
|
`error: template \`${template}\` was deleted while creating; retry
|
|
@@ -33460,158 +34092,44 @@ ${a}
|
|
|
33460
34092
|
};
|
|
33461
34093
|
var jt = `${e("gray", $)} `;
|
|
33462
34094
|
var Re = (t) => new ht({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, output: t.output, signal: t.signal, input: t.input, render() {
|
|
33463
|
-
const r = t?.withGuide ?? h.withGuide, s = `${`${r ? `${e("gray", $)}
|
|
33464
|
-
` : ""}${M(this.state)} `}${t.message}
|
|
33465
|
-
`, i = t.placeholder ? e("inverse", t.placeholder[0]) + e("dim", t.placeholder.slice(1)) : e(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : i, n = this.value ?? "";
|
|
33466
|
-
switch (this.state) {
|
|
33467
|
-
case "error": {
|
|
33468
|
-
const o = this.error ? ` ${e("yellow", this.error)}` : "", c2 = r ? `${e("yellow", $)} ` : "", a = r ? e("yellow", E2) : "";
|
|
33469
|
-
return `${s.trim()}
|
|
33470
|
-
${c2}${u}
|
|
33471
|
-
${a}${o}
|
|
33472
|
-
`;
|
|
33473
|
-
}
|
|
33474
|
-
case "submit": {
|
|
33475
|
-
const o = n ? ` ${e("dim", n)}` : "", c2 = r ? e("gray", $) : "";
|
|
33476
|
-
return `${s}${c2}${o}`;
|
|
33477
|
-
}
|
|
33478
|
-
case "cancel": {
|
|
33479
|
-
const o = n ? ` ${e(["strikethrough", "dim"], n)}` : "", c2 = r ? e("gray", $) : "";
|
|
33480
|
-
return `${s}${c2}${o}${n.trim() ? `
|
|
33481
|
-
${c2}` : ""}`;
|
|
33482
|
-
}
|
|
33483
|
-
default: {
|
|
33484
|
-
const o = r ? `${e("cyan", $)} ` : "", c2 = r ? e("cyan", E2) : "";
|
|
33485
|
-
return `${s}${o}${u}
|
|
33486
|
-
${c2}
|
|
33487
|
-
`;
|
|
33488
|
-
}
|
|
33489
|
-
}
|
|
33490
|
-
} }).prompt();
|
|
33491
|
-
|
|
33492
|
-
// src/modules/shared/prompt-secret.ts
|
|
33493
|
-
function promptSecret(message) {
|
|
33494
|
-
return Ce({
|
|
33495
|
-
message,
|
|
33496
|
-
validate(v2) {
|
|
33497
|
-
if (!v2 || v2.trim() === "") return "Required";
|
|
33498
|
-
return void 0;
|
|
33499
|
-
}
|
|
33500
|
-
});
|
|
33501
|
-
}
|
|
33502
|
-
|
|
33503
|
-
// src/modules/connection/services/connection-service.ts
|
|
33504
|
-
function createConnectionService(deps) {
|
|
33505
|
-
const readIds = async (agentId) => {
|
|
33506
|
-
const res = await deps.trpc.connections.getAgentConnections.query({
|
|
33507
|
-
agentId
|
|
33508
|
-
});
|
|
33509
|
-
return res.connections.map((c2) => c2.connectionId);
|
|
33510
|
-
};
|
|
33511
|
-
return {
|
|
33512
|
-
async list() {
|
|
33513
|
-
return trpcCall(() => deps.trpc.connections.list.query());
|
|
33514
|
-
},
|
|
33515
|
-
async listTemplates() {
|
|
33516
|
-
return trpcCall(() => deps.trpc.connections.listTemplates.query());
|
|
33517
|
-
},
|
|
33518
|
-
async createConnection(input) {
|
|
33519
|
-
return trpcCall(() => deps.trpc.connections.create.mutate(input));
|
|
33520
|
-
},
|
|
33521
|
-
async update(id, value) {
|
|
33522
|
-
return trpcCall(async () => {
|
|
33523
|
-
await deps.trpc.connections.update.mutate({ id, value });
|
|
33524
|
-
});
|
|
33525
|
-
},
|
|
33526
|
-
async startOAuth(connectionId) {
|
|
33527
|
-
return trpcCall(
|
|
33528
|
-
() => deps.trpc.connections.startOAuth.mutate({ connectionId })
|
|
33529
|
-
);
|
|
33530
|
-
},
|
|
33531
|
-
async discoverMcp(url2) {
|
|
33532
|
-
return trpcCall(() => deps.trpc.connections.discoverMcp.mutate({ url: url2 }));
|
|
33533
|
-
},
|
|
33534
|
-
async probeClusterCa(host) {
|
|
33535
|
-
return trpcCall(
|
|
33536
|
-
() => deps.trpc.connections.probeClusterCa.mutate({ host })
|
|
33537
|
-
);
|
|
33538
|
-
},
|
|
33539
|
-
async getConnection(id) {
|
|
33540
|
-
return trpcCall(() => deps.trpc.connections.get.query({ id }));
|
|
33541
|
-
},
|
|
33542
|
-
async agentConnectionIds(agentId) {
|
|
33543
|
-
return trpcCall(() => readIds(agentId));
|
|
33544
|
-
},
|
|
33545
|
-
async grant(agentId, add) {
|
|
33546
|
-
return trpcCall(async () => {
|
|
33547
|
-
const current = await readIds(agentId);
|
|
33548
|
-
const next = Array.from(/* @__PURE__ */ new Set([...current, ...add]));
|
|
33549
|
-
await deps.trpc.connections.setAgentConnections.mutate({
|
|
33550
|
-
agentId,
|
|
33551
|
-
connectionIds: next
|
|
33552
|
-
});
|
|
33553
|
-
return next;
|
|
33554
|
-
});
|
|
33555
|
-
},
|
|
33556
|
-
async revoke(agentId, remove) {
|
|
33557
|
-
return trpcCall(async () => {
|
|
33558
|
-
const drop = new Set(remove);
|
|
33559
|
-
const current = await readIds(agentId);
|
|
33560
|
-
const next = current.filter((id) => !drop.has(id));
|
|
33561
|
-
await deps.trpc.connections.setAgentConnections.mutate({
|
|
33562
|
-
agentId,
|
|
33563
|
-
connectionIds: next
|
|
33564
|
-
});
|
|
33565
|
-
return next;
|
|
33566
|
-
});
|
|
33567
|
-
},
|
|
33568
|
-
async disconnect(id) {
|
|
33569
|
-
return trpcCall(async () => {
|
|
33570
|
-
await deps.trpc.connections.delete.mutate({ id });
|
|
33571
|
-
});
|
|
34095
|
+
const r = t?.withGuide ?? h.withGuide, s = `${`${r ? `${e("gray", $)}
|
|
34096
|
+
` : ""}${M(this.state)} `}${t.message}
|
|
34097
|
+
`, i = t.placeholder ? e("inverse", t.placeholder[0]) + e("dim", t.placeholder.slice(1)) : e(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : i, n = this.value ?? "";
|
|
34098
|
+
switch (this.state) {
|
|
34099
|
+
case "error": {
|
|
34100
|
+
const o = this.error ? ` ${e("yellow", this.error)}` : "", c2 = r ? `${e("yellow", $)} ` : "", a = r ? e("yellow", E2) : "";
|
|
34101
|
+
return `${s.trim()}
|
|
34102
|
+
${c2}${u}
|
|
34103
|
+
${a}${o}
|
|
34104
|
+
`;
|
|
33572
34105
|
}
|
|
33573
|
-
|
|
33574
|
-
}
|
|
33575
|
-
|
|
33576
|
-
// src/modules/connection/domain/config-inputs.ts
|
|
33577
|
-
function configInputsOf(template) {
|
|
33578
|
-
return template.inputs.filter((i) => i.configInput);
|
|
33579
|
-
}
|
|
33580
|
-
function validateConfigInputValue(input, value) {
|
|
33581
|
-
const trimmed = value.trim();
|
|
33582
|
-
if (trimmed === "") return void 0;
|
|
33583
|
-
const label = input.label ?? input.name;
|
|
33584
|
-
if (input.enumValues && !input.enumValues.includes(trimmed)) {
|
|
33585
|
-
const opts = input.enumValues.map((v2) => `\`${v2}\``).join(", ");
|
|
33586
|
-
return `${label}: must be one of ${opts}`;
|
|
33587
|
-
}
|
|
33588
|
-
if (input.pattern && !new RegExp(`^(?:${input.pattern})$`).test(trimmed)) {
|
|
33589
|
-
const expected = input.patternHint ?? `value matching ${input.pattern}`;
|
|
33590
|
-
return `${label}: expected ${expected}`;
|
|
33591
|
-
}
|
|
33592
|
-
return void 0;
|
|
33593
|
-
}
|
|
33594
|
-
function resolveConfigInputFlags(template, rawFlags) {
|
|
33595
|
-
const byName2 = new Map(configInputsOf(template).map((i) => [i.name, i]));
|
|
33596
|
-
const out = {};
|
|
33597
|
-
for (const raw of rawFlags) {
|
|
33598
|
-
const eq = raw.indexOf("=");
|
|
33599
|
-
if (eq < 0) return err2({ kind: "missing-equals", input: raw });
|
|
33600
|
-
const key = raw.slice(0, eq);
|
|
33601
|
-
const value = raw.slice(eq + 1).trim();
|
|
33602
|
-
const input = byName2.get(key);
|
|
33603
|
-
if (!input) {
|
|
33604
|
-
return err2({ kind: "unknown-key", key, validKeys: [...byName2.keys()] });
|
|
34106
|
+
case "submit": {
|
|
34107
|
+
const o = n ? ` ${e("dim", n)}` : "", c2 = r ? e("gray", $) : "";
|
|
34108
|
+
return `${s}${c2}${o}`;
|
|
33605
34109
|
}
|
|
33606
|
-
|
|
33607
|
-
|
|
33608
|
-
|
|
34110
|
+
case "cancel": {
|
|
34111
|
+
const o = n ? ` ${e(["strikethrough", "dim"], n)}` : "", c2 = r ? e("gray", $) : "";
|
|
34112
|
+
return `${s}${c2}${o}${n.trim() ? `
|
|
34113
|
+
${c2}` : ""}`;
|
|
34114
|
+
}
|
|
34115
|
+
default: {
|
|
34116
|
+
const o = r ? `${e("cyan", $)} ` : "", c2 = r ? e("cyan", E2) : "";
|
|
34117
|
+
return `${s}${o}${u}
|
|
34118
|
+
${c2}
|
|
34119
|
+
`;
|
|
33609
34120
|
}
|
|
33610
|
-
const message = validateConfigInputValue(input, value);
|
|
33611
|
-
if (message) return err2({ kind: "invalid-value", key, message });
|
|
33612
|
-
out[key] = value;
|
|
33613
34121
|
}
|
|
33614
|
-
|
|
34122
|
+
} }).prompt();
|
|
34123
|
+
|
|
34124
|
+
// src/modules/shared/prompt-secret.ts
|
|
34125
|
+
function promptSecret(message) {
|
|
34126
|
+
return Ce({
|
|
34127
|
+
message,
|
|
34128
|
+
validate(v2) {
|
|
34129
|
+
if (!v2 || v2.trim() === "") return "Required";
|
|
34130
|
+
return void 0;
|
|
34131
|
+
}
|
|
34132
|
+
});
|
|
33615
34133
|
}
|
|
33616
34134
|
|
|
33617
34135
|
// src/modules/agent/commands/create-interactive.ts
|
|
@@ -34449,7 +34967,7 @@ function buildListCommand(deps) {
|
|
|
34449
34967
|
}
|
|
34450
34968
|
if (result.value.length === 0) {
|
|
34451
34969
|
process.stderr.write(
|
|
34452
|
-
"No agents.\nhint: create one with `dam agent create <name> --template <id>`\n"
|
|
34970
|
+
"No agents.\nhint: create one with `dam agent create <name> --template <id> --provider <connection-id>`\n"
|
|
34453
34971
|
);
|
|
34454
34972
|
process.exit(EXIT_SUCCESS);
|
|
34455
34973
|
}
|
|
@@ -35473,126 +35991,7 @@ import {
|
|
|
35473
35991
|
} from "fs/promises";
|
|
35474
35992
|
import { dirname } from "path";
|
|
35475
35993
|
|
|
35476
|
-
// ../../node_modules/.pnpm/smol-toml@1.
|
|
35477
|
-
function getLineColFromPtr(string4, ptr) {
|
|
35478
|
-
let lines = string4.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
35479
|
-
return [lines.length, lines.pop().length + 1];
|
|
35480
|
-
}
|
|
35481
|
-
function makeCodeBlock(string4, line, column) {
|
|
35482
|
-
let lines = string4.split(/\r\n|\n|\r/g);
|
|
35483
|
-
let codeblock = "";
|
|
35484
|
-
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
35485
|
-
for (let i = line - 1; i <= line + 1; i++) {
|
|
35486
|
-
let l = lines[i - 1];
|
|
35487
|
-
if (!l)
|
|
35488
|
-
continue;
|
|
35489
|
-
codeblock += i.toString().padEnd(numberLen, " ");
|
|
35490
|
-
codeblock += ": ";
|
|
35491
|
-
codeblock += l;
|
|
35492
|
-
codeblock += "\n";
|
|
35493
|
-
if (i === line) {
|
|
35494
|
-
codeblock += " ".repeat(numberLen + column + 2);
|
|
35495
|
-
codeblock += "^\n";
|
|
35496
|
-
}
|
|
35497
|
-
}
|
|
35498
|
-
return codeblock;
|
|
35499
|
-
}
|
|
35500
|
-
var TomlError = class extends Error {
|
|
35501
|
-
line;
|
|
35502
|
-
column;
|
|
35503
|
-
codeblock;
|
|
35504
|
-
constructor(message, options) {
|
|
35505
|
-
const [line, column] = getLineColFromPtr(options.toml, options.ptr);
|
|
35506
|
-
const codeblock = makeCodeBlock(options.toml, line, column);
|
|
35507
|
-
super(`Invalid TOML document: ${message}
|
|
35508
|
-
|
|
35509
|
-
${codeblock}`, options);
|
|
35510
|
-
this.line = line;
|
|
35511
|
-
this.column = column;
|
|
35512
|
-
this.codeblock = codeblock;
|
|
35513
|
-
}
|
|
35514
|
-
};
|
|
35515
|
-
|
|
35516
|
-
// ../../node_modules/.pnpm/smol-toml@1.6.1/node_modules/smol-toml/dist/util.js
|
|
35517
|
-
function isEscaped(str, ptr) {
|
|
35518
|
-
let i = 0;
|
|
35519
|
-
while (str[ptr - ++i] === "\\")
|
|
35520
|
-
;
|
|
35521
|
-
return --i && i % 2;
|
|
35522
|
-
}
|
|
35523
|
-
function indexOfNewline(str, start = 0, end = str.length) {
|
|
35524
|
-
let idx = str.indexOf("\n", start);
|
|
35525
|
-
if (str[idx - 1] === "\r")
|
|
35526
|
-
idx--;
|
|
35527
|
-
return idx <= end ? idx : -1;
|
|
35528
|
-
}
|
|
35529
|
-
function skipComment(str, ptr) {
|
|
35530
|
-
for (let i = ptr; i < str.length; i++) {
|
|
35531
|
-
let c2 = str[i];
|
|
35532
|
-
if (c2 === "\n")
|
|
35533
|
-
return i;
|
|
35534
|
-
if (c2 === "\r" && str[i + 1] === "\n")
|
|
35535
|
-
return i + 1;
|
|
35536
|
-
if (c2 < " " && c2 !== " " || c2 === "\x7F") {
|
|
35537
|
-
throw new TomlError("control characters are not allowed in comments", {
|
|
35538
|
-
toml: str,
|
|
35539
|
-
ptr
|
|
35540
|
-
});
|
|
35541
|
-
}
|
|
35542
|
-
}
|
|
35543
|
-
return str.length;
|
|
35544
|
-
}
|
|
35545
|
-
function skipVoid(str, ptr, banNewLines, banComments) {
|
|
35546
|
-
let c2;
|
|
35547
|
-
while (1) {
|
|
35548
|
-
while ((c2 = str[ptr]) === " " || c2 === " " || !banNewLines && (c2 === "\n" || c2 === "\r" && str[ptr + 1] === "\n"))
|
|
35549
|
-
ptr++;
|
|
35550
|
-
if (banComments || c2 !== "#")
|
|
35551
|
-
break;
|
|
35552
|
-
ptr = skipComment(str, ptr);
|
|
35553
|
-
}
|
|
35554
|
-
return ptr;
|
|
35555
|
-
}
|
|
35556
|
-
function skipUntil(str, ptr, sep, end, banNewLines = false) {
|
|
35557
|
-
if (!end) {
|
|
35558
|
-
ptr = indexOfNewline(str, ptr);
|
|
35559
|
-
return ptr < 0 ? str.length : ptr;
|
|
35560
|
-
}
|
|
35561
|
-
for (let i = ptr; i < str.length; i++) {
|
|
35562
|
-
let c2 = str[i];
|
|
35563
|
-
if (c2 === "#") {
|
|
35564
|
-
i = indexOfNewline(str, i);
|
|
35565
|
-
} else if (c2 === sep) {
|
|
35566
|
-
return i + 1;
|
|
35567
|
-
} else if (c2 === end || banNewLines && (c2 === "\n" || c2 === "\r" && str[i + 1] === "\n")) {
|
|
35568
|
-
return i;
|
|
35569
|
-
}
|
|
35570
|
-
}
|
|
35571
|
-
throw new TomlError("cannot find end of structure", {
|
|
35572
|
-
toml: str,
|
|
35573
|
-
ptr
|
|
35574
|
-
});
|
|
35575
|
-
}
|
|
35576
|
-
function getStringEnd(str, seek) {
|
|
35577
|
-
let first = str[seek];
|
|
35578
|
-
let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;
|
|
35579
|
-
seek += target.length - 1;
|
|
35580
|
-
do
|
|
35581
|
-
seek = str.indexOf(target, ++seek);
|
|
35582
|
-
while (seek > -1 && first !== "'" && isEscaped(str, seek));
|
|
35583
|
-
if (seek > -1) {
|
|
35584
|
-
seek += target.length;
|
|
35585
|
-
if (target.length > 1) {
|
|
35586
|
-
if (str[seek] === first)
|
|
35587
|
-
seek++;
|
|
35588
|
-
if (str[seek] === first)
|
|
35589
|
-
seek++;
|
|
35590
|
-
}
|
|
35591
|
-
}
|
|
35592
|
-
return seek;
|
|
35593
|
-
}
|
|
35594
|
-
|
|
35595
|
-
// ../../node_modules/.pnpm/smol-toml@1.6.1/node_modules/smol-toml/dist/date.js
|
|
35994
|
+
// ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/date.js
|
|
35596
35995
|
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
35597
35996
|
var TomlDate = class _TomlDate extends Date {
|
|
35598
35997
|
#hasDate = false;
|
|
@@ -35684,99 +36083,224 @@ var TomlDate = class _TomlDate extends Date {
|
|
|
35684
36083
|
}
|
|
35685
36084
|
};
|
|
35686
36085
|
|
|
35687
|
-
// ../../node_modules/.pnpm/smol-toml@1.
|
|
36086
|
+
// ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/error.js
|
|
36087
|
+
function getLineColFromPtr(string4, ptr) {
|
|
36088
|
+
let lines = string4.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
36089
|
+
return [lines.length, lines.pop().length + 1];
|
|
36090
|
+
}
|
|
36091
|
+
function makeCodeBlock(string4, line, column) {
|
|
36092
|
+
let lines = string4.split(/\r\n|\n|\r/g);
|
|
36093
|
+
let codeblock = "";
|
|
36094
|
+
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
36095
|
+
for (let i = line - 1; i <= line + 1; i++) {
|
|
36096
|
+
let l = lines[i - 1];
|
|
36097
|
+
if (!l)
|
|
36098
|
+
continue;
|
|
36099
|
+
codeblock += i.toString().padEnd(numberLen, " ");
|
|
36100
|
+
codeblock += ": ";
|
|
36101
|
+
codeblock += l;
|
|
36102
|
+
codeblock += "\n";
|
|
36103
|
+
if (i === line) {
|
|
36104
|
+
codeblock += " ".repeat(numberLen + column + 2);
|
|
36105
|
+
codeblock += "^\n";
|
|
36106
|
+
}
|
|
36107
|
+
}
|
|
36108
|
+
return codeblock;
|
|
36109
|
+
}
|
|
36110
|
+
var TomlError = class extends Error {
|
|
36111
|
+
line;
|
|
36112
|
+
column;
|
|
36113
|
+
codeblock;
|
|
36114
|
+
constructor(message, options) {
|
|
36115
|
+
const [line, column] = getLineColFromPtr(options.toml, options.ptr);
|
|
36116
|
+
const codeblock = makeCodeBlock(options.toml, line, column);
|
|
36117
|
+
super(`Invalid TOML document: ${message}
|
|
36118
|
+
|
|
36119
|
+
${codeblock}`, options);
|
|
36120
|
+
this.line = line;
|
|
36121
|
+
this.column = column;
|
|
36122
|
+
this.codeblock = codeblock;
|
|
36123
|
+
}
|
|
36124
|
+
};
|
|
36125
|
+
|
|
36126
|
+
// ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/util.js
|
|
36127
|
+
function indexOfNewline(str, start = 0) {
|
|
36128
|
+
let idx = str.indexOf("\n", start);
|
|
36129
|
+
if (str.charCodeAt(idx - 1) === 13)
|
|
36130
|
+
idx--;
|
|
36131
|
+
return idx;
|
|
36132
|
+
}
|
|
36133
|
+
function skipComment(ctx) {
|
|
36134
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
36135
|
+
let c2 = ctx.s.charCodeAt(ctx.p);
|
|
36136
|
+
if (c2 === 10)
|
|
36137
|
+
break;
|
|
36138
|
+
if (c2 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
|
|
36139
|
+
ctx.p++;
|
|
36140
|
+
break;
|
|
36141
|
+
}
|
|
36142
|
+
if (c2 < 32 && c2 !== 9 || c2 === 127) {
|
|
36143
|
+
throw new TomlError("control characters are not allowed in comments", {
|
|
36144
|
+
toml: ctx.s,
|
|
36145
|
+
ptr: ctx.p
|
|
36146
|
+
});
|
|
36147
|
+
}
|
|
36148
|
+
}
|
|
36149
|
+
}
|
|
36150
|
+
function skipVoid(ctx, banNewLines, banComments) {
|
|
36151
|
+
let c2;
|
|
36152
|
+
while (1) {
|
|
36153
|
+
while ((c2 = ctx.s.charCodeAt(ctx.p)) === 32 || c2 === 9 || !banNewLines && (c2 === 10 || c2 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))
|
|
36154
|
+
ctx.p++;
|
|
36155
|
+
if (banComments || c2 !== 35)
|
|
36156
|
+
break;
|
|
36157
|
+
skipComment(ctx);
|
|
36158
|
+
}
|
|
36159
|
+
}
|
|
36160
|
+
function skipUntil(ctx, sep, end) {
|
|
36161
|
+
let ptr = ctx.p;
|
|
36162
|
+
if (!end) {
|
|
36163
|
+
ptr = indexOfNewline(ctx.s, ptr);
|
|
36164
|
+
ctx.p = ptr < 0 ? ctx.s.length : ptr;
|
|
36165
|
+
return;
|
|
36166
|
+
}
|
|
36167
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
36168
|
+
let c2 = ctx.s.charCodeAt(ctx.p);
|
|
36169
|
+
if (c2 === 35) {
|
|
36170
|
+
skipComment(ctx);
|
|
36171
|
+
} else if (c2 === end || c2 === sep) {
|
|
36172
|
+
return;
|
|
36173
|
+
}
|
|
36174
|
+
}
|
|
36175
|
+
throw new TomlError("cannot find end of structure", {
|
|
36176
|
+
toml: ctx.s,
|
|
36177
|
+
ptr
|
|
36178
|
+
});
|
|
36179
|
+
}
|
|
36180
|
+
|
|
36181
|
+
// ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/primitive.js
|
|
35688
36182
|
var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
|
|
35689
36183
|
var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
|
|
35690
36184
|
var LEADING_ZERO = /^[+-]?0[0-9_]/;
|
|
35691
|
-
|
|
35692
|
-
|
|
35693
|
-
|
|
35694
|
-
|
|
35695
|
-
|
|
35696
|
-
|
|
35697
|
-
r: "\r",
|
|
35698
|
-
e: "\x1B",
|
|
35699
|
-
'"': '"',
|
|
35700
|
-
"\\": "\\"
|
|
35701
|
-
};
|
|
35702
|
-
function parseString2(str, ptr = 0, endPtr = str.length) {
|
|
35703
|
-
let isLiteral = str[ptr] === "'";
|
|
35704
|
-
let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
|
|
36185
|
+
function parseString2(ctx) {
|
|
36186
|
+
let start = ctx.p;
|
|
36187
|
+
let c2 = ctx.s.charCodeAt(ctx.p++);
|
|
36188
|
+
let first = c2;
|
|
36189
|
+
let isLiteral = c2 === 39;
|
|
36190
|
+
let isMultiline = c2 === ctx.s.charCodeAt(ctx.p) && c2 === ctx.s.charCodeAt(ctx.p + 1);
|
|
35705
36191
|
if (isMultiline) {
|
|
35706
|
-
|
|
35707
|
-
|
|
35708
|
-
|
|
35709
|
-
|
|
35710
|
-
|
|
35711
|
-
}
|
|
35712
|
-
let tmp = 0;
|
|
35713
|
-
let isEscape;
|
|
36192
|
+
if ((c2 = ctx.s.charCodeAt(ctx.p += 2)) === 10)
|
|
36193
|
+
ctx.p++;
|
|
36194
|
+
else if (c2 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)
|
|
36195
|
+
ctx.p += 2;
|
|
36196
|
+
}
|
|
35714
36197
|
let parsed = "";
|
|
35715
|
-
let sliceStart =
|
|
35716
|
-
|
|
35717
|
-
|
|
35718
|
-
|
|
35719
|
-
|
|
35720
|
-
|
|
35721
|
-
|
|
35722
|
-
ptr: ptr - 1
|
|
35723
|
-
});
|
|
35724
|
-
}
|
|
35725
|
-
} else if (c2 < " " && c2 !== " " || c2 === "\x7F") {
|
|
36198
|
+
let sliceStart = ctx.p;
|
|
36199
|
+
let state = 0;
|
|
36200
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
36201
|
+
c2 = ctx.s.charCodeAt(ctx.p);
|
|
36202
|
+
if (isMultiline && (c2 === 10 || c2 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) {
|
|
36203
|
+
state = state && 3;
|
|
36204
|
+
} else if (c2 < 32 && c2 !== 9 || c2 === 127) {
|
|
35726
36205
|
throw new TomlError("control characters are not allowed in strings", {
|
|
35727
|
-
toml:
|
|
35728
|
-
ptr:
|
|
36206
|
+
toml: ctx.s,
|
|
36207
|
+
ptr: ctx.p
|
|
35729
36208
|
});
|
|
35730
|
-
}
|
|
35731
|
-
|
|
35732
|
-
|
|
35733
|
-
|
|
35734
|
-
|
|
35735
|
-
|
|
35736
|
-
|
|
35737
|
-
|
|
35738
|
-
|
|
35739
|
-
|
|
35740
|
-
|
|
35741
|
-
|
|
35742
|
-
|
|
35743
|
-
|
|
35744
|
-
|
|
35745
|
-
|
|
35746
|
-
|
|
35747
|
-
|
|
35748
|
-
|
|
35749
|
-
|
|
35750
|
-
|
|
35751
|
-
|
|
35752
|
-
|
|
35753
|
-
|
|
35754
|
-
|
|
35755
|
-
|
|
35756
|
-
|
|
35757
|
-
|
|
35758
|
-
|
|
35759
|
-
|
|
36209
|
+
} else if ((!state || state === 3) && c2 === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
|
|
36210
|
+
if (isMultiline) {
|
|
36211
|
+
if (ctx.s.charCodeAt(ctx.p + 3) === first)
|
|
36212
|
+
ctx.p++;
|
|
36213
|
+
if (ctx.s.charCodeAt(ctx.p + 3) === first)
|
|
36214
|
+
ctx.p++;
|
|
36215
|
+
}
|
|
36216
|
+
if (!state)
|
|
36217
|
+
parsed += ctx.s.slice(sliceStart, ctx.p);
|
|
36218
|
+
ctx.p += isMultiline ? 3 : 1;
|
|
36219
|
+
return parsed;
|
|
36220
|
+
} else if (!state) {
|
|
36221
|
+
if (!isLiteral && c2 === 92) {
|
|
36222
|
+
parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p);
|
|
36223
|
+
state = 1;
|
|
36224
|
+
}
|
|
36225
|
+
} else if (state === 1) {
|
|
36226
|
+
if (c2 === 120 || c2 === 117 || c2 === 85) {
|
|
36227
|
+
let value = 0;
|
|
36228
|
+
let len = c2 === 120 ? 2 : c2 === 117 ? 4 : 8;
|
|
36229
|
+
for (let j3 = 0; j3 < len; j3++, ctx.p++) {
|
|
36230
|
+
let hex3 = ctx.s.charCodeAt(ctx.p + 1);
|
|
36231
|
+
let digit = (
|
|
36232
|
+
/* 0-9 */
|
|
36233
|
+
hex3 >= 48 && hex3 <= 57 ? hex3 - 48 : (
|
|
36234
|
+
/* A-F */
|
|
36235
|
+
hex3 >= 65 && hex3 <= 70 ? hex3 - 65 + 10 : (
|
|
36236
|
+
/* a-f */
|
|
36237
|
+
hex3 >= 97 && hex3 <= 102 ? hex3 - 97 + 10 : -1
|
|
36238
|
+
)
|
|
36239
|
+
)
|
|
36240
|
+
);
|
|
36241
|
+
if (digit < 0)
|
|
36242
|
+
throw new TomlError("invalid non-hex character in unicode escape", { toml: ctx.s, ptr: ctx.p + 1 });
|
|
36243
|
+
value = value << 4 | digit;
|
|
36244
|
+
}
|
|
36245
|
+
if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) {
|
|
36246
|
+
throw new TomlError("invalid unicode escape", { toml: ctx.s, ptr: ctx.p });
|
|
36247
|
+
}
|
|
36248
|
+
parsed += String.fromCodePoint(value);
|
|
36249
|
+
sliceStart = ctx.p + 1;
|
|
36250
|
+
state = 0;
|
|
36251
|
+
} else if (c2 === 32 || c2 === 9) {
|
|
36252
|
+
state = 2;
|
|
35760
36253
|
} else {
|
|
35761
|
-
|
|
35762
|
-
|
|
35763
|
-
|
|
36254
|
+
if (c2 === 98)
|
|
36255
|
+
parsed += "\b";
|
|
36256
|
+
else if (c2 === 116)
|
|
36257
|
+
parsed += " ";
|
|
36258
|
+
else if (c2 === 110)
|
|
36259
|
+
parsed += "\n";
|
|
36260
|
+
else if (c2 === 102)
|
|
36261
|
+
parsed += "\f";
|
|
36262
|
+
else if (c2 === 114)
|
|
36263
|
+
parsed += "\r";
|
|
36264
|
+
else if (c2 === 101)
|
|
36265
|
+
parsed += "\x1B";
|
|
36266
|
+
else if (c2 === 34)
|
|
36267
|
+
parsed += '"';
|
|
36268
|
+
else if (c2 === 92)
|
|
36269
|
+
parsed += "\\";
|
|
36270
|
+
else
|
|
36271
|
+
throw new TomlError("unrecognized escape sequence", { toml: ctx.s, ptr: ctx.p });
|
|
36272
|
+
sliceStart = ctx.p + 1;
|
|
36273
|
+
state = 0;
|
|
36274
|
+
}
|
|
36275
|
+
} else if (c2 !== 32 && c2 !== 9) {
|
|
36276
|
+
if (state === 2) {
|
|
36277
|
+
throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
|
|
36278
|
+
toml: ctx.s,
|
|
36279
|
+
ptr: sliceStart
|
|
35764
36280
|
});
|
|
35765
36281
|
}
|
|
35766
|
-
|
|
35767
|
-
|
|
35768
|
-
tmp = ptr - 1;
|
|
35769
|
-
isEscape = true;
|
|
35770
|
-
parsed += str.slice(sliceStart, tmp);
|
|
36282
|
+
state = !isLiteral && c2 === 92 ? 1 : 0;
|
|
36283
|
+
sliceStart = ctx.p;
|
|
35771
36284
|
}
|
|
35772
36285
|
}
|
|
35773
|
-
|
|
36286
|
+
throw new TomlError("unfinished string", { toml: ctx.s, ptr: start });
|
|
35774
36287
|
}
|
|
35775
|
-
function
|
|
35776
|
-
|
|
35777
|
-
|
|
35778
|
-
if (
|
|
35779
|
-
|
|
36288
|
+
function sliceAndTrimEndOf(ctx, start, end) {
|
|
36289
|
+
let value = ctx.s.slice(start, end);
|
|
36290
|
+
let commentIdx = value.indexOf("#");
|
|
36291
|
+
if (commentIdx > 0) {
|
|
36292
|
+
skipComment({ s: value, p: commentIdx, d: 0 });
|
|
36293
|
+
value = value.slice(0, commentIdx);
|
|
36294
|
+
}
|
|
36295
|
+
return value.trimEnd();
|
|
36296
|
+
}
|
|
36297
|
+
function parseValue(ctx, integersAsBigInt, end) {
|
|
36298
|
+
let ptr = ctx.p;
|
|
36299
|
+
let err3 = { toml: ctx.s, ptr };
|
|
36300
|
+
skipUntil(ctx, 44, end);
|
|
36301
|
+
let value = sliceAndTrimEndOf(ctx, ptr, ctx.p);
|
|
36302
|
+
if (!value)
|
|
36303
|
+
throw new TomlError("incomplete declaration: value expected", err3);
|
|
35780
36304
|
if (value === "-inf")
|
|
35781
36305
|
return -Infinity;
|
|
35782
36306
|
if (value === "inf" || value === "+inf")
|
|
@@ -35788,257 +36312,204 @@ function parseValue(value, toml, ptr, integersAsBigInt) {
|
|
|
35788
36312
|
let isInt = INT_REGEX.test(value);
|
|
35789
36313
|
if (isInt || FLOAT_REGEX.test(value)) {
|
|
35790
36314
|
if (LEADING_ZERO.test(value)) {
|
|
35791
|
-
throw new TomlError("leading zeroes are not allowed",
|
|
35792
|
-
toml,
|
|
35793
|
-
ptr
|
|
35794
|
-
});
|
|
36315
|
+
throw new TomlError("leading zeroes are not allowed", err3);
|
|
35795
36316
|
}
|
|
35796
36317
|
value = value.replace(/_/g, "");
|
|
35797
36318
|
let numeric = +value;
|
|
35798
36319
|
if (isNaN(numeric)) {
|
|
35799
|
-
throw new TomlError("invalid number",
|
|
35800
|
-
toml,
|
|
35801
|
-
ptr
|
|
35802
|
-
});
|
|
36320
|
+
throw new TomlError("invalid number", err3);
|
|
35803
36321
|
}
|
|
35804
36322
|
if (isInt) {
|
|
35805
36323
|
if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {
|
|
35806
|
-
throw new TomlError("integer value cannot be represented losslessly",
|
|
35807
|
-
toml,
|
|
35808
|
-
ptr
|
|
35809
|
-
});
|
|
36324
|
+
throw new TomlError("integer value cannot be represented losslessly", err3);
|
|
35810
36325
|
}
|
|
35811
36326
|
if (isInt || integersAsBigInt === true)
|
|
35812
|
-
numeric = BigInt(value);
|
|
35813
|
-
}
|
|
35814
|
-
return numeric;
|
|
35815
|
-
}
|
|
35816
|
-
const date5 = new TomlDate(value);
|
|
35817
|
-
if (!date5.isValid()) {
|
|
35818
|
-
throw new TomlError("invalid value", {
|
|
35819
|
-
toml,
|
|
35820
|
-
ptr
|
|
35821
|
-
});
|
|
35822
|
-
}
|
|
35823
|
-
return date5;
|
|
35824
|
-
}
|
|
35825
|
-
|
|
35826
|
-
// ../../node_modules/.pnpm/smol-toml@1.6.1/node_modules/smol-toml/dist/extract.js
|
|
35827
|
-
function sliceAndTrimEndOf(str, startPtr, endPtr) {
|
|
35828
|
-
let value = str.slice(startPtr, endPtr);
|
|
35829
|
-
let commentIdx = value.indexOf("#");
|
|
35830
|
-
if (commentIdx > -1) {
|
|
35831
|
-
skipComment(str, commentIdx);
|
|
35832
|
-
value = value.slice(0, commentIdx);
|
|
35833
|
-
}
|
|
35834
|
-
return [value.trimEnd(), commentIdx];
|
|
35835
|
-
}
|
|
35836
|
-
function extractValue(str, ptr, end, depth, integersAsBigInt) {
|
|
35837
|
-
if (depth === 0) {
|
|
35838
|
-
throw new TomlError("document contains excessively nested structures. aborting.", {
|
|
35839
|
-
toml: str,
|
|
35840
|
-
ptr
|
|
35841
|
-
});
|
|
35842
|
-
}
|
|
35843
|
-
let c2 = str[ptr];
|
|
35844
|
-
if (c2 === "[" || c2 === "{") {
|
|
35845
|
-
let [value, endPtr2] = c2 === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
|
|
35846
|
-
if (end) {
|
|
35847
|
-
endPtr2 = skipVoid(str, endPtr2);
|
|
35848
|
-
if (str[endPtr2] === ",")
|
|
35849
|
-
endPtr2++;
|
|
35850
|
-
else if (str[endPtr2] !== end) {
|
|
35851
|
-
throw new TomlError("expected comma or end of structure", {
|
|
35852
|
-
toml: str,
|
|
35853
|
-
ptr: endPtr2
|
|
35854
|
-
});
|
|
35855
|
-
}
|
|
36327
|
+
numeric = BigInt(value);
|
|
35856
36328
|
}
|
|
35857
|
-
return
|
|
36329
|
+
return numeric;
|
|
35858
36330
|
}
|
|
35859
|
-
|
|
35860
|
-
if (
|
|
35861
|
-
|
|
35862
|
-
|
|
35863
|
-
|
|
35864
|
-
|
|
35865
|
-
|
|
35866
|
-
|
|
35867
|
-
|
|
35868
|
-
|
|
35869
|
-
|
|
35870
|
-
|
|
35871
|
-
|
|
36331
|
+
const date5 = new TomlDate(value);
|
|
36332
|
+
if (!date5.isValid())
|
|
36333
|
+
throw new TomlError("invalid value", err3);
|
|
36334
|
+
return date5;
|
|
36335
|
+
}
|
|
36336
|
+
|
|
36337
|
+
// ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/extract.js
|
|
36338
|
+
function extractValue(ctx, end, integersAsBigInt) {
|
|
36339
|
+
let ptr = ctx.p;
|
|
36340
|
+
let c2 = ctx.s.charCodeAt(ptr);
|
|
36341
|
+
if (c2 === 91 || c2 === 123) {
|
|
36342
|
+
if (!ctx.d--) {
|
|
36343
|
+
throw new TomlError("document contains excessively nested structures. aborting.", {
|
|
36344
|
+
toml: ctx.s,
|
|
36345
|
+
ptr
|
|
36346
|
+
});
|
|
35872
36347
|
}
|
|
35873
|
-
|
|
36348
|
+
let value = c2 === 91 ? parseArray(ctx, integersAsBigInt) : parseInlineTable(ctx, integersAsBigInt);
|
|
36349
|
+
ctx.d++;
|
|
36350
|
+
return value;
|
|
35874
36351
|
}
|
|
35875
|
-
|
|
35876
|
-
|
|
35877
|
-
|
|
35878
|
-
|
|
35879
|
-
|
|
35880
|
-
ptr
|
|
35881
|
-
|
|
36352
|
+
if (c2 === 34 || c2 === 39) {
|
|
36353
|
+
return parseString2(ctx);
|
|
36354
|
+
}
|
|
36355
|
+
if (c2 === 116) {
|
|
36356
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101)
|
|
36357
|
+
throw new TomlError("invalid value", { toml: ctx.s, ptr });
|
|
36358
|
+
ctx.p++;
|
|
36359
|
+
return true;
|
|
35882
36360
|
}
|
|
35883
|
-
if (
|
|
35884
|
-
|
|
35885
|
-
|
|
36361
|
+
if (c2 === 102) {
|
|
36362
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101)
|
|
36363
|
+
throw new TomlError("invalid value", { toml: ctx.s, ptr });
|
|
36364
|
+
ctx.p++;
|
|
36365
|
+
return false;
|
|
35886
36366
|
}
|
|
35887
|
-
return
|
|
35888
|
-
parseValue(slice[0], str, ptr, integersAsBigInt),
|
|
35889
|
-
endPtr
|
|
35890
|
-
];
|
|
36367
|
+
return parseValue(ctx, integersAsBigInt, end);
|
|
35891
36368
|
}
|
|
35892
36369
|
|
|
35893
|
-
// ../../node_modules/.pnpm/smol-toml@1.
|
|
36370
|
+
// ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/struct.js
|
|
35894
36371
|
var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
35895
|
-
function parseKey(
|
|
35896
|
-
let
|
|
36372
|
+
function parseKey(ctx, end = "=") {
|
|
36373
|
+
let start = ctx.p;
|
|
36374
|
+
let dot = start - 1;
|
|
35897
36375
|
let parsed = [];
|
|
35898
|
-
let endPtr =
|
|
36376
|
+
let endPtr = ctx.s.indexOf(end, start);
|
|
35899
36377
|
if (endPtr < 0) {
|
|
35900
36378
|
throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
35901
|
-
toml:
|
|
35902
|
-
ptr
|
|
36379
|
+
toml: ctx.s,
|
|
36380
|
+
ptr: start
|
|
35903
36381
|
});
|
|
35904
36382
|
}
|
|
35905
36383
|
do {
|
|
35906
|
-
let c2 =
|
|
35907
|
-
if (c2 !==
|
|
35908
|
-
if (c2 ===
|
|
35909
|
-
if (c2 ===
|
|
36384
|
+
let c2 = ctx.s.charCodeAt(ctx.p = ++dot);
|
|
36385
|
+
if (c2 !== 32 && c2 !== 9) {
|
|
36386
|
+
if (c2 === 34 || c2 === 39) {
|
|
36387
|
+
if (c2 === ctx.s.charCodeAt(ctx.p + 1) && c2 === ctx.s.charCodeAt(ctx.p + 2)) {
|
|
35910
36388
|
throw new TomlError("multiline strings are not allowed in keys", {
|
|
35911
|
-
toml:
|
|
35912
|
-
ptr
|
|
36389
|
+
toml: ctx.s,
|
|
36390
|
+
ptr: ctx.p
|
|
35913
36391
|
});
|
|
35914
36392
|
}
|
|
35915
|
-
let
|
|
35916
|
-
|
|
35917
|
-
|
|
35918
|
-
toml: str,
|
|
35919
|
-
ptr
|
|
35920
|
-
});
|
|
35921
|
-
}
|
|
35922
|
-
dot = str.indexOf(".", eos);
|
|
35923
|
-
let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
36393
|
+
let part = parseString2(ctx);
|
|
36394
|
+
dot = ctx.s.indexOf(".", ctx.p);
|
|
36395
|
+
let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
35924
36396
|
let newLine = indexOfNewline(strEnd);
|
|
35925
36397
|
if (newLine > -1) {
|
|
35926
36398
|
throw new TomlError("newlines are not allowed in keys", {
|
|
35927
|
-
toml:
|
|
35928
|
-
ptr:
|
|
36399
|
+
toml: ctx.s,
|
|
36400
|
+
ptr: newLine
|
|
35929
36401
|
});
|
|
35930
36402
|
}
|
|
35931
36403
|
if (strEnd.trimStart()) {
|
|
35932
36404
|
throw new TomlError("found extra tokens after the string part", {
|
|
35933
|
-
toml:
|
|
35934
|
-
ptr:
|
|
36405
|
+
toml: ctx.s,
|
|
36406
|
+
ptr: ctx.p
|
|
35935
36407
|
});
|
|
35936
36408
|
}
|
|
35937
|
-
if (endPtr <
|
|
35938
|
-
endPtr =
|
|
36409
|
+
if (endPtr < ctx.p) {
|
|
36410
|
+
endPtr = ctx.s.indexOf(end, ctx.p);
|
|
35939
36411
|
if (endPtr < 0) {
|
|
35940
36412
|
throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
35941
|
-
toml:
|
|
35942
|
-
ptr
|
|
36413
|
+
toml: ctx.s,
|
|
36414
|
+
ptr: start
|
|
35943
36415
|
});
|
|
35944
36416
|
}
|
|
35945
36417
|
}
|
|
35946
|
-
parsed.push(
|
|
36418
|
+
parsed.push(part);
|
|
35947
36419
|
} else {
|
|
35948
|
-
dot =
|
|
35949
|
-
let part =
|
|
36420
|
+
dot = ctx.s.indexOf(".", ctx.p);
|
|
36421
|
+
let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
35950
36422
|
if (!KEY_PART_RE.test(part)) {
|
|
35951
36423
|
throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
|
|
35952
|
-
toml:
|
|
35953
|
-
ptr
|
|
36424
|
+
toml: ctx.s,
|
|
36425
|
+
ptr: ctx.p
|
|
35954
36426
|
});
|
|
35955
36427
|
}
|
|
35956
36428
|
parsed.push(part.trimEnd());
|
|
35957
36429
|
}
|
|
35958
36430
|
}
|
|
35959
36431
|
} while (dot + 1 && dot < endPtr);
|
|
35960
|
-
|
|
36432
|
+
ctx.p = endPtr + 1;
|
|
36433
|
+
skipVoid(ctx, true, true);
|
|
36434
|
+
return parsed;
|
|
35961
36435
|
}
|
|
35962
|
-
function parseInlineTable(
|
|
36436
|
+
function parseInlineTable(ctx, integersAsBigInt) {
|
|
35963
36437
|
let res = {};
|
|
35964
36438
|
let seen = /* @__PURE__ */ new Set();
|
|
35965
36439
|
let c2;
|
|
35966
|
-
|
|
35967
|
-
while (
|
|
35968
|
-
|
|
35969
|
-
|
|
35970
|
-
|
|
35971
|
-
|
|
35972
|
-
|
|
35973
|
-
|
|
35974
|
-
|
|
35975
|
-
|
|
35976
|
-
|
|
35977
|
-
|
|
35978
|
-
|
|
35979
|
-
|
|
35980
|
-
|
|
35981
|
-
|
|
35982
|
-
|
|
35983
|
-
k2 = key[i];
|
|
35984
|
-
if ((hasOwn = Object.hasOwn(t, k2)) && (typeof t[k2] !== "object" || seen.has(t[k2]))) {
|
|
35985
|
-
throw new TomlError("trying to redefine an already defined value", {
|
|
35986
|
-
toml: str,
|
|
35987
|
-
ptr
|
|
35988
|
-
});
|
|
35989
|
-
}
|
|
35990
|
-
if (!hasOwn && k2 === "__proto__") {
|
|
35991
|
-
Object.defineProperty(t, k2, { enumerable: true, configurable: true, writable: true });
|
|
35992
|
-
}
|
|
35993
|
-
}
|
|
35994
|
-
if (hasOwn) {
|
|
36440
|
+
ctx.p++;
|
|
36441
|
+
while (ctx.p < ctx.s.length) {
|
|
36442
|
+
skipVoid(ctx);
|
|
36443
|
+
if ((c2 = ctx.s.charCodeAt(ctx.p)) === 125) {
|
|
36444
|
+
ctx.p++;
|
|
36445
|
+
return res;
|
|
36446
|
+
}
|
|
36447
|
+
let k2;
|
|
36448
|
+
let t = res;
|
|
36449
|
+
let hasOwn = false;
|
|
36450
|
+
let p2 = ctx.p;
|
|
36451
|
+
let key = parseKey(ctx);
|
|
36452
|
+
for (let i = 0; i < key.length; i++) {
|
|
36453
|
+
if (i)
|
|
36454
|
+
t = hasOwn ? t[k2] : t[k2] = {};
|
|
36455
|
+
k2 = key[i];
|
|
36456
|
+
if ((hasOwn = Object.hasOwn(t, k2)) && (typeof t[k2] !== "object" || seen.has(t[k2]))) {
|
|
35995
36457
|
throw new TomlError("trying to redefine an already defined value", {
|
|
35996
|
-
toml:
|
|
35997
|
-
ptr
|
|
36458
|
+
toml: ctx.s,
|
|
36459
|
+
ptr: p2
|
|
35998
36460
|
});
|
|
35999
36461
|
}
|
|
36000
|
-
|
|
36001
|
-
|
|
36002
|
-
|
|
36003
|
-
|
|
36462
|
+
if (!hasOwn && k2 === "__proto__") {
|
|
36463
|
+
Object.defineProperty(t, k2, { enumerable: true, configurable: true, writable: true });
|
|
36464
|
+
}
|
|
36465
|
+
}
|
|
36466
|
+
if (hasOwn) {
|
|
36467
|
+
throw new TomlError("trying to redefine an already defined value", {
|
|
36468
|
+
toml: ctx.s,
|
|
36469
|
+
ptr: ctx.p
|
|
36470
|
+
});
|
|
36471
|
+
}
|
|
36472
|
+
let value = extractValue(ctx, 125, integersAsBigInt);
|
|
36473
|
+
seen.add(t[k2] = value);
|
|
36474
|
+
skipVoid(ctx);
|
|
36475
|
+
if ((c2 = ctx.s.charCodeAt(ctx.p++)) === 125) {
|
|
36476
|
+
return res;
|
|
36477
|
+
}
|
|
36478
|
+
if (c2 !== 44) {
|
|
36479
|
+
throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
|
|
36004
36480
|
}
|
|
36005
36481
|
}
|
|
36006
|
-
|
|
36007
|
-
|
|
36008
|
-
|
|
36009
|
-
|
|
36010
|
-
});
|
|
36011
|
-
}
|
|
36012
|
-
return [res, ptr];
|
|
36482
|
+
throw new TomlError("unfinished table encountered", {
|
|
36483
|
+
toml: ctx.s,
|
|
36484
|
+
ptr: ctx.p
|
|
36485
|
+
});
|
|
36013
36486
|
}
|
|
36014
|
-
function parseArray(
|
|
36487
|
+
function parseArray(ctx, integersAsBigInt) {
|
|
36015
36488
|
let res = [];
|
|
36016
36489
|
let c2;
|
|
36017
|
-
|
|
36018
|
-
while (
|
|
36019
|
-
|
|
36020
|
-
|
|
36021
|
-
|
|
36022
|
-
|
|
36023
|
-
|
|
36024
|
-
|
|
36025
|
-
|
|
36026
|
-
|
|
36027
|
-
|
|
36028
|
-
|
|
36029
|
-
|
|
36030
|
-
|
|
36031
|
-
|
|
36032
|
-
if (!c2) {
|
|
36033
|
-
throw new TomlError("unfinished array encountered", {
|
|
36034
|
-
toml: str,
|
|
36035
|
-
ptr
|
|
36036
|
-
});
|
|
36490
|
+
ctx.p++;
|
|
36491
|
+
while (ctx.p < ctx.s.length) {
|
|
36492
|
+
skipVoid(ctx);
|
|
36493
|
+
if ((c2 = ctx.s.charCodeAt(ctx.p)) === 93) {
|
|
36494
|
+
ctx.p++;
|
|
36495
|
+
return res;
|
|
36496
|
+
}
|
|
36497
|
+
res.push(extractValue(ctx, 93, integersAsBigInt));
|
|
36498
|
+
skipVoid(ctx);
|
|
36499
|
+
if ((c2 = ctx.s.charCodeAt(ctx.p++)) === 93) {
|
|
36500
|
+
return res;
|
|
36501
|
+
}
|
|
36502
|
+
if (c2 !== 44) {
|
|
36503
|
+
throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
|
|
36504
|
+
}
|
|
36037
36505
|
}
|
|
36038
|
-
|
|
36506
|
+
throw new TomlError("unfinished array encountered", {
|
|
36507
|
+
toml: ctx.s,
|
|
36508
|
+
ptr: ctx.p
|
|
36509
|
+
});
|
|
36039
36510
|
}
|
|
36040
36511
|
|
|
36041
|
-
// ../../node_modules/.pnpm/smol-toml@1.
|
|
36512
|
+
// ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/parse.js
|
|
36042
36513
|
function peekTable(key, table, meta3, type) {
|
|
36043
36514
|
let t = table;
|
|
36044
36515
|
let m = meta3;
|
|
@@ -36099,25 +36570,29 @@ function peekTable(key, table, meta3, type) {
|
|
|
36099
36570
|
return [k2, t, state.c];
|
|
36100
36571
|
}
|
|
36101
36572
|
function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
|
|
36573
|
+
let ctx = { s: toml, p: 0, d: maxDepth };
|
|
36102
36574
|
let res = {};
|
|
36103
36575
|
let meta3 = {};
|
|
36576
|
+
let tmp;
|
|
36104
36577
|
let tbl = res;
|
|
36105
36578
|
let m = meta3;
|
|
36106
|
-
|
|
36107
|
-
|
|
36108
|
-
|
|
36109
|
-
let
|
|
36579
|
+
skipVoid(ctx);
|
|
36580
|
+
while (ctx.p < toml.length) {
|
|
36581
|
+
if (toml.charCodeAt(ctx.p) === 91) {
|
|
36582
|
+
let isTableArray = toml.charCodeAt(++ctx.p) === 91;
|
|
36583
|
+
tmp = ctx.p += +isTableArray;
|
|
36584
|
+
let k2 = parseKey(ctx, "]");
|
|
36110
36585
|
if (isTableArray) {
|
|
36111
|
-
if (toml
|
|
36586
|
+
if (toml.charCodeAt(ctx.p - 1) !== 93) {
|
|
36112
36587
|
throw new TomlError("expected end of table declaration", {
|
|
36113
36588
|
toml,
|
|
36114
|
-
ptr:
|
|
36589
|
+
ptr: ctx.p - 1
|
|
36115
36590
|
});
|
|
36116
36591
|
}
|
|
36117
|
-
|
|
36592
|
+
ctx.p++;
|
|
36118
36593
|
}
|
|
36119
36594
|
let p2 = peekTable(
|
|
36120
|
-
k2
|
|
36595
|
+
k2,
|
|
36121
36596
|
res,
|
|
36122
36597
|
meta3,
|
|
36123
36598
|
isTableArray ? 2 : 1
|
|
@@ -36126,16 +36601,16 @@ function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
|
|
|
36126
36601
|
if (!p2) {
|
|
36127
36602
|
throw new TomlError("trying to redefine an already defined table or value", {
|
|
36128
36603
|
toml,
|
|
36129
|
-
ptr
|
|
36604
|
+
ptr: tmp
|
|
36130
36605
|
});
|
|
36131
36606
|
}
|
|
36132
36607
|
m = p2[2];
|
|
36133
36608
|
tbl = p2[1];
|
|
36134
|
-
ptr = k2[1];
|
|
36135
36609
|
} else {
|
|
36136
|
-
|
|
36610
|
+
tmp = ctx.p;
|
|
36611
|
+
let k2 = parseKey(ctx);
|
|
36137
36612
|
let p2 = peekTable(
|
|
36138
|
-
k2
|
|
36613
|
+
k2,
|
|
36139
36614
|
tbl,
|
|
36140
36615
|
m,
|
|
36141
36616
|
0
|
|
@@ -36144,34 +36619,36 @@ function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
|
|
|
36144
36619
|
if (!p2) {
|
|
36145
36620
|
throw new TomlError("trying to redefine an already defined table or value", {
|
|
36146
36621
|
toml,
|
|
36147
|
-
ptr
|
|
36622
|
+
ptr: tmp
|
|
36148
36623
|
});
|
|
36149
36624
|
}
|
|
36150
|
-
|
|
36151
|
-
p2[1][p2[0]] = v2[0];
|
|
36152
|
-
ptr = v2[1];
|
|
36625
|
+
p2[1][p2[0]] = extractValue(ctx, void 0, integersAsBigInt);
|
|
36153
36626
|
}
|
|
36154
|
-
|
|
36155
|
-
if (toml
|
|
36627
|
+
skipVoid(ctx, true);
|
|
36628
|
+
if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) {
|
|
36156
36629
|
throw new TomlError("each key-value declaration must be followed by an end-of-line", {
|
|
36157
36630
|
toml,
|
|
36158
|
-
ptr
|
|
36631
|
+
ptr: ctx.p
|
|
36159
36632
|
});
|
|
36160
36633
|
}
|
|
36161
|
-
|
|
36634
|
+
skipVoid(ctx);
|
|
36162
36635
|
}
|
|
36163
36636
|
return res;
|
|
36164
36637
|
}
|
|
36165
36638
|
|
|
36166
|
-
// ../../node_modules/.pnpm/smol-toml@1.
|
|
36639
|
+
// ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/stringify.js
|
|
36167
36640
|
var BARE_KEY = /^[a-z0-9-_]+$/i;
|
|
36168
36641
|
function extendedTypeOf(obj) {
|
|
36169
36642
|
let type = typeof obj;
|
|
36170
36643
|
if (type === "object") {
|
|
36171
36644
|
if (Array.isArray(obj))
|
|
36172
36645
|
return "array";
|
|
36173
|
-
if (obj instanceof Date)
|
|
36646
|
+
if (typeof obj?.getUTCDate === "function" && obj instanceof Date)
|
|
36174
36647
|
return "date";
|
|
36648
|
+
if (globalThis.Temporal && // check for the 'since' property as an early bailout that avoids running all 5 instanceof checks
|
|
36649
|
+
typeof obj?.since === "function" && (obj instanceof Temporal.Instant || obj instanceof Temporal.PlainDate || obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainTime || obj instanceof Temporal.ZonedDateTime)) {
|
|
36650
|
+
return "temporal";
|
|
36651
|
+
}
|
|
36175
36652
|
}
|
|
36176
36653
|
return type;
|
|
36177
36654
|
}
|
|
@@ -36185,38 +36662,42 @@ function isArrayOfTables(obj) {
|
|
|
36185
36662
|
function formatString(s) {
|
|
36186
36663
|
return JSON.stringify(s).replace(/\x7f/g, "\\u007f");
|
|
36187
36664
|
}
|
|
36665
|
+
function stringifyTemporal(temporal) {
|
|
36666
|
+
return temporal.toString({
|
|
36667
|
+
calendarName: "never",
|
|
36668
|
+
timeZoneName: "never"
|
|
36669
|
+
});
|
|
36670
|
+
}
|
|
36188
36671
|
function stringifyValue(val, type, depth, numberAsFloat) {
|
|
36189
36672
|
if (depth === 0) {
|
|
36190
36673
|
throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
36191
36674
|
}
|
|
36192
|
-
|
|
36193
|
-
|
|
36194
|
-
|
|
36195
|
-
|
|
36196
|
-
|
|
36197
|
-
|
|
36198
|
-
|
|
36199
|
-
|
|
36200
|
-
|
|
36201
|
-
|
|
36202
|
-
|
|
36203
|
-
|
|
36204
|
-
|
|
36205
|
-
|
|
36206
|
-
|
|
36207
|
-
|
|
36208
|
-
|
|
36209
|
-
|
|
36210
|
-
|
|
36211
|
-
|
|
36212
|
-
|
|
36213
|
-
|
|
36214
|
-
|
|
36215
|
-
|
|
36216
|
-
|
|
36217
|
-
|
|
36218
|
-
if (type === "array") {
|
|
36219
|
-
return stringifyArray(val, depth, numberAsFloat);
|
|
36675
|
+
switch (type) {
|
|
36676
|
+
// @ts-expect-error -- intentional fallthrough case
|
|
36677
|
+
case "number":
|
|
36678
|
+
if (isNaN(val))
|
|
36679
|
+
return "nan";
|
|
36680
|
+
if (val === Infinity)
|
|
36681
|
+
return "inf";
|
|
36682
|
+
if (val === -Infinity)
|
|
36683
|
+
return "-inf";
|
|
36684
|
+
if (Number.isInteger(val) && (numberAsFloat || !Number.isSafeInteger(val)))
|
|
36685
|
+
return val.toFixed(1);
|
|
36686
|
+
case "bigint":
|
|
36687
|
+
case "boolean":
|
|
36688
|
+
return val.toString();
|
|
36689
|
+
case "string":
|
|
36690
|
+
return formatString(val);
|
|
36691
|
+
case "date":
|
|
36692
|
+
if (isNaN(val.getTime()))
|
|
36693
|
+
throw new TypeError("cannot serialize invalid date");
|
|
36694
|
+
return val.toISOString();
|
|
36695
|
+
case "object":
|
|
36696
|
+
return stringifyInlineTable(val, depth, numberAsFloat);
|
|
36697
|
+
case "array":
|
|
36698
|
+
return stringifyArray(val, depth, numberAsFloat);
|
|
36699
|
+
case "temporal":
|
|
36700
|
+
return stringifyTemporal(val);
|
|
36220
36701
|
}
|
|
36221
36702
|
}
|
|
36222
36703
|
function stringifyInlineTable(obj, depth, numberAsFloat) {
|
|
@@ -40414,6 +40895,13 @@ function createRunService(deps) {
|
|
|
40414
40895
|
const parsed = platformRunResultResponseSchema.safeParse(res.result);
|
|
40415
40896
|
return parsed.success ? parsed.data : null;
|
|
40416
40897
|
}
|
|
40898
|
+
function interruptedRun(sessionId) {
|
|
40899
|
+
return err2({
|
|
40900
|
+
kind: "run-failed",
|
|
40901
|
+
reason: "the run was interrupted and will not finish \u2014 the agent went down mid-run; run it again",
|
|
40902
|
+
sessionId
|
|
40903
|
+
});
|
|
40904
|
+
}
|
|
40417
40905
|
async function reconnectAndFinish(opts) {
|
|
40418
40906
|
const { ctx, sessionId, promptId, deadlineAt } = opts;
|
|
40419
40907
|
let backoffStep = 0;
|
|
@@ -40451,6 +40939,8 @@ function createRunService(deps) {
|
|
|
40451
40939
|
const record2 = await fetchRunResult(conn, sessionId);
|
|
40452
40940
|
if (record2?.status === "done" && matchesPrompt(record2.result, promptId))
|
|
40453
40941
|
return finish(record2.result);
|
|
40942
|
+
if (record2?.status === "interrupted")
|
|
40943
|
+
return interruptedRun(sessionId);
|
|
40454
40944
|
const event2 = await waiter.next(deadlineAt, conn.closed);
|
|
40455
40945
|
if (event2 === "timed-out")
|
|
40456
40946
|
return ok2({ kind: "timed-out", sessionId });
|
|
@@ -40641,6 +41131,7 @@ function createRunService(deps) {
|
|
|
40641
41131
|
});
|
|
40642
41132
|
if (record2.status === "done")
|
|
40643
41133
|
return ok2({ kind: "done", result: record2.result });
|
|
41134
|
+
if (record2.status === "interrupted") return interruptedRun(sessionId);
|
|
40644
41135
|
if (record2.status === "none" && !input.wait)
|
|
40645
41136
|
return ok2({ kind: "none", sessionId });
|
|
40646
41137
|
if (!input.wait) return ok2({ kind: "pending", sessionId });
|
|
@@ -41485,7 +41976,7 @@ function createProcessEnvReader() {
|
|
|
41485
41976
|
|
|
41486
41977
|
// src/modules/cli/infrastructure/package-version.ts
|
|
41487
41978
|
function readPackageVersion() {
|
|
41488
|
-
return true ? "0.2.
|
|
41979
|
+
return true ? "0.2.18-rc1" : DEV_VERSION;
|
|
41489
41980
|
}
|
|
41490
41981
|
|
|
41491
41982
|
// src/modules/cli/infrastructure/version-probe.ts
|
|
@@ -42207,15 +42698,6 @@ function formatPresetNote(inputs) {
|
|
|
42207
42698
|
`;
|
|
42208
42699
|
}
|
|
42209
42700
|
|
|
42210
|
-
// src/modules/connection/domain/connection-ref.ts
|
|
42211
|
-
var CONNECTION_ID_PREFIX = "conn-";
|
|
42212
|
-
function resolveConnectionRef(connections, ref) {
|
|
42213
|
-
if (ref.startsWith(CONNECTION_ID_PREFIX)) {
|
|
42214
|
-
return connections.find((c2) => c2.id === ref) ?? null;
|
|
42215
|
-
}
|
|
42216
|
-
return connections.find((c2) => c2.name === ref) ?? null;
|
|
42217
|
-
}
|
|
42218
|
-
|
|
42219
42701
|
// src/modules/connection/commands/disconnect.ts
|
|
42220
42702
|
function buildDisconnectCommand(deps) {
|
|
42221
42703
|
return new Command("disconnect").description("Remove a team connection (deletes the stored credential)").argument(
|
|
@@ -43593,13 +44075,40 @@ function printTrpcReadError(e2, path2, host) {
|
|
|
43593
44075
|
}
|
|
43594
44076
|
|
|
43595
44077
|
// src/modules/file/commands/list.ts
|
|
44078
|
+
var entrySuffix = { file: "", dir: "/" };
|
|
44079
|
+
var MAX_DIRECTORY_BATCH_SIZE = 500;
|
|
44080
|
+
var MAX_ENCODED_DIRECTORY_INPUT_LENGTH = 7e3;
|
|
44081
|
+
var DirectoryPathTooLongError = class extends Error {
|
|
44082
|
+
};
|
|
44083
|
+
function* directoryBatches(frontier) {
|
|
44084
|
+
let paths = [];
|
|
44085
|
+
const emptyInputLength = encodeURIComponent(
|
|
44086
|
+
JSON.stringify({ 0: { paths: [] } })
|
|
44087
|
+
).length;
|
|
44088
|
+
let encodedInputLength = emptyInputLength;
|
|
44089
|
+
for (const path2 of frontier) {
|
|
44090
|
+
const pathLength = encodeURIComponent(JSON.stringify(path2)).length;
|
|
44091
|
+
if (emptyInputLength + pathLength > MAX_ENCODED_DIRECTORY_INPUT_LENGTH) {
|
|
44092
|
+
throw new DirectoryPathTooLongError(
|
|
44093
|
+
`cannot list \`${path2}\`: directory path exceeds the request URL size limit`
|
|
44094
|
+
);
|
|
44095
|
+
}
|
|
44096
|
+
const separatorLength = paths.length > 0 ? 3 : 0;
|
|
44097
|
+
if (paths.length > 0 && (paths.length === MAX_DIRECTORY_BATCH_SIZE || encodedInputLength + separatorLength + pathLength > MAX_ENCODED_DIRECTORY_INPUT_LENGTH)) {
|
|
44098
|
+
yield paths;
|
|
44099
|
+
paths = [];
|
|
44100
|
+
encodedInputLength = emptyInputLength;
|
|
44101
|
+
}
|
|
44102
|
+
encodedInputLength += (paths.length > 0 ? 3 : 0) + pathLength;
|
|
44103
|
+
paths.push(path2);
|
|
44104
|
+
}
|
|
44105
|
+
if (paths.length > 0) yield paths;
|
|
44106
|
+
}
|
|
43596
44107
|
function buildFileListCommand(deps) {
|
|
43597
|
-
return new Command("list").description(
|
|
43598
|
-
"List immediate children of a directory in an Agent's workspace"
|
|
43599
|
-
).argument("<ref>", "Agent Ref \u2014 name or 'agent-\u2026' ID").argument(
|
|
44108
|
+
return new Command("list").description("List a directory in an Agent's workspace").argument("<ref>", "Agent Ref \u2014 name or 'agent-\u2026' ID").argument(
|
|
43600
44109
|
"[remote-path]",
|
|
43601
44110
|
"directory to list (workspace-relative; defaults to root)"
|
|
43602
|
-
).option("--server <url>", "override the configured server URL").option("--
|
|
44111
|
+
).option("--server <url>", "override the configured server URL").option("-R, --recursive", "list all nested files and directories").option("--json", "emit entries as JSON").action(
|
|
43603
44112
|
async (ref, remotePath, opts) => {
|
|
43604
44113
|
const flag = opts.server ? { server: opts.server } : void 0;
|
|
43605
44114
|
const host = await resolveActiveHost(deps, {
|
|
@@ -43623,30 +44132,46 @@ function buildFileListCommand(deps) {
|
|
|
43623
44132
|
tokenProvider: deps.tokenProvider
|
|
43624
44133
|
});
|
|
43625
44134
|
const dir = (remotePath ?? "").replace(/\/+$/, "");
|
|
43626
|
-
|
|
44135
|
+
const entries = [];
|
|
43627
44136
|
try {
|
|
43628
|
-
|
|
43629
|
-
|
|
43630
|
-
|
|
43631
|
-
|
|
43632
|
-
|
|
43633
|
-
|
|
43634
|
-
|
|
43635
|
-
|
|
44137
|
+
let frontier = [dir];
|
|
44138
|
+
while (frontier.length > 0) {
|
|
44139
|
+
const nextFrontier = [];
|
|
44140
|
+
for (const paths of directoryBatches(frontier)) {
|
|
44141
|
+
const { results } = await trpc.files.listDirs.query({ paths });
|
|
44142
|
+
for (const [index, current] of paths.entries()) {
|
|
44143
|
+
const res = results[index];
|
|
44144
|
+
if (!res || !res.ok) {
|
|
44145
|
+
const reason = res?.error ?? "not-found";
|
|
44146
|
+
process.stderr.write(
|
|
44147
|
+
`error: cannot list \`${current || "/"}\`: ${reason}
|
|
43636
44148
|
`
|
|
43637
|
-
|
|
43638
|
-
|
|
44149
|
+
);
|
|
44150
|
+
process.exit(EXIT_RUNTIME_FAILURE);
|
|
44151
|
+
}
|
|
44152
|
+
for (const entry of res.entries) {
|
|
44153
|
+
const path2 = current ? `${current}/${entry.name}` : entry.name;
|
|
44154
|
+
entries.push({ path: path2, type: entry.type });
|
|
44155
|
+
if (opts.recursive && entry.type === "dir")
|
|
44156
|
+
nextFrontier.push(path2);
|
|
44157
|
+
}
|
|
44158
|
+
}
|
|
44159
|
+
}
|
|
44160
|
+
frontier = nextFrontier;
|
|
43639
44161
|
}
|
|
43640
|
-
entries = res.entries.map((e2) => ({
|
|
43641
|
-
path: dir ? `${dir}/${e2.name}` : e2.name,
|
|
43642
|
-
type: e2.type
|
|
43643
|
-
}));
|
|
43644
44162
|
} catch (e2) {
|
|
43645
|
-
|
|
44163
|
+
if (e2 instanceof DirectoryPathTooLongError) {
|
|
44164
|
+
process.stderr.write(`error: ${e2.message}
|
|
44165
|
+
`);
|
|
44166
|
+
} else {
|
|
44167
|
+
printTrpcError(e2, host);
|
|
44168
|
+
}
|
|
43646
44169
|
process.exit(EXIT_RUNTIME_FAILURE);
|
|
43647
44170
|
}
|
|
44171
|
+
if (opts.recursive)
|
|
44172
|
+
entries.sort((a, b2) => a.path.localeCompare(b2.path));
|
|
43648
44173
|
const out = opts.json ? `${JSON.stringify(entries)}
|
|
43649
|
-
` : entries.
|
|
44174
|
+
` : entries.map((e2) => `${e2.path}${entrySuffix[e2.type]}
|
|
43650
44175
|
`).join("");
|
|
43651
44176
|
return writeStdoutAndExit(out, EXIT_SUCCESS);
|
|
43652
44177
|
}
|
|
@@ -44260,6 +44785,9 @@ function buildCreateCommand3(deps) {
|
|
|
44260
44785
|
"--session-mode <mode>",
|
|
44261
44786
|
"session strategy each tick (default: fresh)"
|
|
44262
44787
|
).choices(["fresh", "continuous"])
|
|
44788
|
+
).option(
|
|
44789
|
+
"--precheck <command>",
|
|
44790
|
+
"shell command run in the workspace before each fire; exit 0 runs, exit 1 skips this occurrence, any other exit means the check broke and the task runs anyway"
|
|
44263
44791
|
).option(
|
|
44264
44792
|
"--server <url>",
|
|
44265
44793
|
"override the configured server URL for this call"
|
|
@@ -44313,7 +44841,8 @@ function buildCreateCommand3(deps) {
|
|
|
44313
44841
|
timezone,
|
|
44314
44842
|
quietHours,
|
|
44315
44843
|
task: opts.task,
|
|
44316
|
-
...opts.sessionMode ? { sessionMode: opts.sessionMode } : {}
|
|
44844
|
+
...opts.sessionMode ? { sessionMode: opts.sessionMode } : {},
|
|
44845
|
+
...opts.precheck ? { precheck: opts.precheck } : {}
|
|
44317
44846
|
});
|
|
44318
44847
|
if (!result.ok) {
|
|
44319
44848
|
if (result.error.kind === "invalid-input") {
|
|
@@ -44471,6 +45000,7 @@ function renderSchedule(view) {
|
|
|
44471
45000
|
} else {
|
|
44472
45001
|
lines.push(`Cron: ${view.cron ?? ""}`);
|
|
44473
45002
|
}
|
|
45003
|
+
if (view.precheck) lines.push(`Precheck: ${view.precheck}`);
|
|
44474
45004
|
lines.push(`Session: ${view.sessionMode ?? "fresh"}`);
|
|
44475
45005
|
lines.push(`Enabled: ${view.enabled}`);
|
|
44476
45006
|
lines.push(`Created by: ${view.createdBy}`);
|
|
@@ -44479,6 +45009,18 @@ function renderSchedule(view) {
|
|
|
44479
45009
|
if (view.status?.lastResult) {
|
|
44480
45010
|
lines.push(`Last result: ${view.status.lastResult}`);
|
|
44481
45011
|
}
|
|
45012
|
+
if (view.precheck && view.status?.declinedCount) {
|
|
45013
|
+
const when = view.status.lastDeclinedAt ? `, last ${view.status.lastDeclinedAt}` : "";
|
|
45014
|
+
lines.push(
|
|
45015
|
+
`Declined: ${view.status.declinedCount} since the last run${when}`
|
|
45016
|
+
);
|
|
45017
|
+
}
|
|
45018
|
+
if (view.precheck && view.status?.lastPrecheckError) {
|
|
45019
|
+
const inARow = (view.status.precheckFailedCount ?? 0) > 1 ? ` (${view.status.precheckFailedCount} times in a row)` : "";
|
|
45020
|
+
lines.push(
|
|
45021
|
+
`Precheck: failed${inARow} \u2014 ${view.status.lastPrecheckError}`
|
|
45022
|
+
);
|
|
45023
|
+
}
|
|
44482
45024
|
return `${lines.join("\n")}
|
|
44483
45025
|
`;
|
|
44484
45026
|
}
|
|
@@ -44668,6 +45210,9 @@ function buildUpdateCommand3(deps) {
|
|
|
44668
45210
|
["fresh", "continuous"]
|
|
44669
45211
|
)
|
|
44670
45212
|
).option(
|
|
45213
|
+
"--precheck <command>",
|
|
45214
|
+
"shell command run in the workspace before each fire; exit 0 runs, exit 1 skips this occurrence, any other exit means the check broke and the task runs anyway"
|
|
45215
|
+
).option("--precheck-none", "remove the schedule's precheck").option(
|
|
44671
45216
|
"--server <url>",
|
|
44672
45217
|
"override the configured server URL for this call"
|
|
44673
45218
|
).option("--json", "emit the updated schedule as JSON").addHelpText(
|
|
@@ -44676,10 +45221,10 @@ function buildUpdateCommand3(deps) {
|
|
|
44676
45221
|
).action(async (id, opts) => {
|
|
44677
45222
|
const recurrenceGiven = opts.daily !== void 0 || opts.every !== void 0 || opts.rrule !== void 0;
|
|
44678
45223
|
const quietGiven = opts.quietWindow.length > 0;
|
|
44679
|
-
const anyFlag = opts.name !== void 0 || opts.task !== void 0 || opts.timezone !== void 0 || opts.sessionMode !== void 0 || opts.weekdays !== void 0 || recurrenceGiven || quietGiven;
|
|
45224
|
+
const anyFlag = opts.name !== void 0 || opts.task !== void 0 || opts.timezone !== void 0 || opts.sessionMode !== void 0 || opts.weekdays !== void 0 || opts.precheck !== void 0 || opts.precheckNone === true || recurrenceGiven || quietGiven;
|
|
44680
45225
|
if (!anyFlag) {
|
|
44681
45226
|
process.stderr.write(
|
|
44682
|
-
"error: nothing to update \u2014 pass at least one of --name, --task, --daily/--every/--rrule, --weekdays, --timezone, --quiet-window, --session-mode\n"
|
|
45227
|
+
"error: nothing to update \u2014 pass at least one of --name, --task, --daily/--every/--rrule, --weekdays, --timezone, --quiet-window, --session-mode, --precheck, --precheck-none\n"
|
|
44683
45228
|
);
|
|
44684
45229
|
process.exit(EXIT_INVALID_INPUT);
|
|
44685
45230
|
}
|
|
@@ -44764,7 +45309,8 @@ function buildUpdateCommand3(deps) {
|
|
|
44764
45309
|
timezone: opts.timezone ?? view.timezone ?? detectTimezone(),
|
|
44765
45310
|
quietHours,
|
|
44766
45311
|
task: opts.task ?? view.task ?? "",
|
|
44767
|
-
...sessionMode ? { sessionMode } : {}
|
|
45312
|
+
...sessionMode ? { sessionMode } : {},
|
|
45313
|
+
precheck: opts.precheckNone ? null : opts.precheck ?? view.precheck
|
|
44768
45314
|
});
|
|
44769
45315
|
if (!result.ok) {
|
|
44770
45316
|
if (result.error.kind === "schedule-not-found") {
|
|
@@ -44895,10 +45441,13 @@ function composeScheduleModule(opts) {
|
|
|
44895
45441
|
|
|
44896
45442
|
// src/modules/skill/domain/source-ref.ts
|
|
44897
45443
|
function resolveSourceRef(sources, ref) {
|
|
44898
|
-
|
|
44899
|
-
|
|
44900
|
-
|
|
44901
|
-
|
|
45444
|
+
const byId = sources.find((s) => s.id === ref);
|
|
45445
|
+
if (byId) return byId;
|
|
45446
|
+
const normalized = normalizeGitUrl(ref);
|
|
45447
|
+
if (!normalized) return null;
|
|
45448
|
+
return sources.find(
|
|
45449
|
+
(s) => normalizeGitUrl(s.gitUrl)?.gitUrl === normalized.gitUrl
|
|
45450
|
+
) ?? null;
|
|
44902
45451
|
}
|
|
44903
45452
|
function sourceKind(s) {
|
|
44904
45453
|
if (s.system) return "Platform";
|
|
@@ -45407,13 +45956,9 @@ function trimToUndefined(v2) {
|
|
|
45407
45956
|
|
|
45408
45957
|
// src/modules/skill/domain/source-name.ts
|
|
45409
45958
|
function deriveSourceName(gitUrl) {
|
|
45410
|
-
|
|
45411
|
-
|
|
45412
|
-
|
|
45413
|
-
} catch {
|
|
45414
|
-
return "";
|
|
45415
|
-
}
|
|
45416
|
-
return pathname.replace(/^\//, "").replace(/\/$/, "").replace(/\.git$/, "");
|
|
45959
|
+
const normalized = normalizeGitUrl(gitUrl);
|
|
45960
|
+
if (!normalized) return "";
|
|
45961
|
+
return new URL(normalized.gitUrl).pathname.replace(/^\//, "");
|
|
45417
45962
|
}
|
|
45418
45963
|
|
|
45419
45964
|
// src/modules/skill/commands/source-add.ts
|
|
@@ -45426,28 +45971,41 @@ function buildSourceAddCommand(deps) {
|
|
|
45426
45971
|
"override the configured server URL for this call"
|
|
45427
45972
|
).option("--json", "emit the created SkillSource as JSON").addHelpText(
|
|
45428
45973
|
"after",
|
|
45429
|
-
"\nThe name defaults to the URL path (github.com/acme/skills \u2192 acme/skills);\npass --name to override. Adding a URL that a Platform or Agent source already\nuses shadows it \u2014 removing your source re-exposes the original.\n\nExamples:\n dam skill source add https://github.com/anthropics/skills\n dam skill source add https://github.com/acme/skills --name acme\n dam skill source add https://github.com/acme/monorepo --path .claude/skills\n"
|
|
45974
|
+
"\nThe URL may be written any usual way \u2014 with or without https://, with a\n.git suffix or a trailing slash, or copied from the address bar including\n/tree/<branch>/<dir>, whose directory becomes the source path.\n\nThe name defaults to the URL path (github.com/acme/skills \u2192 acme/skills);\npass --name to override. Adding a URL that a Platform or Agent source already\nuses shadows it \u2014 removing your source re-exposes the original.\n\nExamples:\n dam skill source add https://github.com/anthropics/skills\n dam skill source add https://github.com/acme/skills --name acme\n dam skill source add https://github.com/acme/monorepo --path .claude/skills\n"
|
|
45430
45975
|
).action(
|
|
45431
45976
|
async (gitUrl, opts) => {
|
|
45432
45977
|
const json2 = opts.json ?? false;
|
|
45433
|
-
|
|
45434
|
-
|
|
45435
|
-
|
|
45436
|
-
|
|
45437
|
-
`
|
|
45978
|
+
const normalized = normalizeGitUrl(gitUrl);
|
|
45979
|
+
if (!normalized) {
|
|
45980
|
+
process.stderr.write(
|
|
45981
|
+
`error: '${gitUrl}' is not a repository URL \u2014 expected something like https://github.com/owner/repo
|
|
45982
|
+
`
|
|
45983
|
+
);
|
|
45438
45984
|
process.exit(EXIT_INVALID_INPUT);
|
|
45439
45985
|
}
|
|
45440
|
-
|
|
45441
|
-
|
|
45986
|
+
if (!json2 && normalized.ref !== void 0) {
|
|
45987
|
+
process.stderr.write(
|
|
45988
|
+
`note: branch '${normalized.ref}' in the URL is ignored \u2014 skills are read from the repository default branch
|
|
45989
|
+
`
|
|
45990
|
+
);
|
|
45991
|
+
}
|
|
45992
|
+
if (!json2 && normalized.path !== void 0 && opts.path === void 0) {
|
|
45993
|
+
process.stderr.write(
|
|
45994
|
+
`note: scanning '${normalized.path}' from the URL; pass --path to override
|
|
45995
|
+
`
|
|
45996
|
+
);
|
|
45997
|
+
}
|
|
45998
|
+
const name = await resolveName(normalized.gitUrl, opts.name, json2);
|
|
45999
|
+
const nameCheck = skillCreateSourceFieldsSchema.shape.name.safeParse(name);
|
|
45442
46000
|
if (!nameCheck.success) {
|
|
45443
46001
|
const msg = nameCheck.error.issues[0]?.message ?? "invalid name";
|
|
45444
46002
|
process.stderr.write(`error: ${msg}
|
|
45445
46003
|
`);
|
|
45446
46004
|
process.exit(EXIT_INVALID_INPUT);
|
|
45447
46005
|
}
|
|
45448
|
-
let path2;
|
|
46006
|
+
let path2 = normalized.path;
|
|
45449
46007
|
if (opts.path !== void 0) {
|
|
45450
|
-
const pathCheck =
|
|
46008
|
+
const pathCheck = skillCreateSourceFieldsSchema.shape.path.safeParse(
|
|
45451
46009
|
opts.path
|
|
45452
46010
|
);
|
|
45453
46011
|
if (!pathCheck.success) {
|
|
@@ -45465,7 +46023,7 @@ function buildSourceAddCommand(deps) {
|
|
|
45465
46023
|
belowFloor: EXIT_BELOW_FLOOR
|
|
45466
46024
|
}
|
|
45467
46025
|
});
|
|
45468
|
-
const result = await deps.createSkillsService(host).addSource({ name, gitUrl, path: path2 });
|
|
46026
|
+
const result = await deps.createSkillsService(host).addSource({ name, gitUrl: normalized.gitUrl, path: path2 });
|
|
45469
46027
|
if (!result.ok) {
|
|
45470
46028
|
if (result.error.kind === "source-exists") {
|
|
45471
46029
|
process.stderr.write(
|
|
@@ -46549,12 +47107,12 @@ function buildMetricsCommand(deps) {
|
|
|
46549
47107
|
sessions.value.filter((s) => s.title).map((s) => [s.sessionId, s.title])
|
|
46550
47108
|
);
|
|
46551
47109
|
};
|
|
46552
|
-
const
|
|
47110
|
+
const sinceHours2 = opts.since ? Number(opts.since) : void 0;
|
|
46553
47111
|
const [result, titles] = await Promise.all([
|
|
46554
47112
|
deps.createMetricsService(host).overview({
|
|
46555
47113
|
agentId: agent.id,
|
|
46556
47114
|
sessionId: opts.session,
|
|
46557
|
-
sinceHours,
|
|
47115
|
+
sinceHours: sinceHours2,
|
|
46558
47116
|
limit: opts.limit ? Number(opts.limit) : 100
|
|
46559
47117
|
}),
|
|
46560
47118
|
fetchTitles().catch(() => /* @__PURE__ */ new Map())
|
|
@@ -46570,14 +47128,14 @@ function buildMetricsCommand(deps) {
|
|
|
46570
47128
|
}));
|
|
46571
47129
|
const windowLabel = [
|
|
46572
47130
|
opts.session && `session ${opts.session}`,
|
|
46573
|
-
|
|
47131
|
+
sinceHours2 !== void 0 && `last ${sinceHours2}h`
|
|
46574
47132
|
].filter(Boolean).join(" \xB7 ") || "all time";
|
|
46575
47133
|
if (opts.json) {
|
|
46576
47134
|
return writeStdoutAndExit(
|
|
46577
47135
|
`${JSON.stringify({
|
|
46578
47136
|
agentId: agent.id,
|
|
46579
47137
|
sessionId: opts.session,
|
|
46580
|
-
sinceHours,
|
|
47138
|
+
sinceHours: sinceHours2,
|
|
46581
47139
|
tokenSpendByModel,
|
|
46582
47140
|
runtimeBySession,
|
|
46583
47141
|
contextPerCall
|
|
@@ -46713,6 +47271,251 @@ function composeMetricsModule(opts) {
|
|
|
46713
47271
|
};
|
|
46714
47272
|
}
|
|
46715
47273
|
|
|
47274
|
+
// src/modules/telemetry/commands/telemetry.ts
|
|
47275
|
+
var DEFAULT_SINCE_HOURS = TELEMETRY_DEFAULT_SINCE_HOURS;
|
|
47276
|
+
var EXPORT_SINCE_HOURS = TELEMETRY_MAX_SINCE_HOURS;
|
|
47277
|
+
var InvalidSinceError = class extends Error {
|
|
47278
|
+
};
|
|
47279
|
+
function sinceHoursOf(raw, fallback) {
|
|
47280
|
+
if (raw === void 0) return fallback;
|
|
47281
|
+
const hours = Number(raw);
|
|
47282
|
+
if (!Number.isFinite(hours) || hours <= 0 || hours > TELEMETRY_MAX_SINCE_HOURS) {
|
|
47283
|
+
throw new InvalidSinceError(
|
|
47284
|
+
`--since must be a positive number of hours up to ${TELEMETRY_MAX_SINCE_HOURS}, got "${raw}"`
|
|
47285
|
+
);
|
|
47286
|
+
}
|
|
47287
|
+
return hours;
|
|
47288
|
+
}
|
|
47289
|
+
var secs2 = (ms) => `${(ms / 1e3).toFixed(1)}s`;
|
|
47290
|
+
var usd = (n) => n > 0 && n < 0.01 ? "<$0.01" : `$${n.toFixed(2)}`;
|
|
47291
|
+
async function hostAndAgent(deps, ref, server) {
|
|
47292
|
+
const host = await resolveActiveHost(deps, {
|
|
47293
|
+
flag: server ? { server } : void 0,
|
|
47294
|
+
exitCodes: {
|
|
47295
|
+
runtimeFailure: EXIT_RUNTIME_FAILURE,
|
|
47296
|
+
belowFloor: EXIT_BELOW_FLOOR
|
|
47297
|
+
}
|
|
47298
|
+
});
|
|
47299
|
+
const resolved = await createAgentResolver({
|
|
47300
|
+
agentService: deps.createAgentService(host)
|
|
47301
|
+
}).resolve(ref);
|
|
47302
|
+
if (!resolved.ok) {
|
|
47303
|
+
printResolveError(resolved.error, host);
|
|
47304
|
+
process.exit(exitCodeForResolveError(resolved.error));
|
|
47305
|
+
}
|
|
47306
|
+
return { host, agent: resolved.value };
|
|
47307
|
+
}
|
|
47308
|
+
function buildTelemetryCommand(deps) {
|
|
47309
|
+
const telemetry = new Command("telemetry").description(
|
|
47310
|
+
"Read an Agent's session telemetry \u2014 the turns it ran, and the records behind them"
|
|
47311
|
+
);
|
|
47312
|
+
telemetry.command("show", { isDefault: true }).description("List the turns a session ran, with their cost and shape").argument("<agent>", "Agent Ref \u2014 name or 'agent-\u2026' ID").requiredOption("--session <id>", "the session to read").option(
|
|
47313
|
+
"--since <hours>",
|
|
47314
|
+
`lookback window in hours (max ${TELEMETRY_MAX_SINCE_HOURS}; default ${DEFAULT_SINCE_HOURS})`
|
|
47315
|
+
).option(
|
|
47316
|
+
"--server <url>",
|
|
47317
|
+
"override the configured server URL for this call"
|
|
47318
|
+
).option("--json", "emit raw JSON instead of the default report").addHelpText(
|
|
47319
|
+
"after",
|
|
47320
|
+
"\nExamples:\n dam telemetry my-agent --session sess-abc123\n dam telemetry my-agent --session sess-abc123 --since 168 --json\n"
|
|
47321
|
+
).action(
|
|
47322
|
+
async (ref, opts) => {
|
|
47323
|
+
const { host, agent } = await hostAndAgent(deps, ref, opts.server);
|
|
47324
|
+
let sinceHours2;
|
|
47325
|
+
try {
|
|
47326
|
+
sinceHours2 = sinceHoursOf(opts.since, DEFAULT_SINCE_HOURS);
|
|
47327
|
+
} catch (err3) {
|
|
47328
|
+
process.stderr.write(`${err3.message}
|
|
47329
|
+
`);
|
|
47330
|
+
return process.exit(EXIT_INVALID_INPUT);
|
|
47331
|
+
}
|
|
47332
|
+
const result = await deps.createTelemetryService(host).turns({
|
|
47333
|
+
agentId: agent.id,
|
|
47334
|
+
sessionId: opts.session,
|
|
47335
|
+
sinceHours: sinceHours2,
|
|
47336
|
+
limit: 100,
|
|
47337
|
+
spanLimit: 1e3,
|
|
47338
|
+
logLimit: 1e3
|
|
47339
|
+
});
|
|
47340
|
+
if (!result.ok) {
|
|
47341
|
+
printServiceError(result.error, host);
|
|
47342
|
+
process.exit(EXIT_RUNTIME_FAILURE);
|
|
47343
|
+
}
|
|
47344
|
+
if (!result.value.available) {
|
|
47345
|
+
process.stderr.write(`${result.value.reason}
|
|
47346
|
+
`);
|
|
47347
|
+
process.exit(EXIT_RUNTIME_FAILURE);
|
|
47348
|
+
}
|
|
47349
|
+
const { turns } = result.value;
|
|
47350
|
+
if (opts.json) {
|
|
47351
|
+
return writeStdoutAndExit(
|
|
47352
|
+
`${JSON.stringify({
|
|
47353
|
+
agentId: agent.id,
|
|
47354
|
+
sessionId: opts.session,
|
|
47355
|
+
sinceHours: sinceHours2,
|
|
47356
|
+
turns
|
|
47357
|
+
})}
|
|
47358
|
+
`,
|
|
47359
|
+
EXIT_SUCCESS
|
|
47360
|
+
);
|
|
47361
|
+
}
|
|
47362
|
+
if (turns.length === 0) {
|
|
47363
|
+
process.stderr.write(
|
|
47364
|
+
`No telemetry for ${agent.name} in session ${opts.session} over the last ${sinceHours2}h.
|
|
47365
|
+
`
|
|
47366
|
+
);
|
|
47367
|
+
return process.exit(EXIT_SUCCESS);
|
|
47368
|
+
}
|
|
47369
|
+
return writeStdoutAndExit(
|
|
47370
|
+
renderTable([
|
|
47371
|
+
["started", "duration", "calls", "spans", "records", "cost"],
|
|
47372
|
+
...turns.map((t) => [
|
|
47373
|
+
t.startedAt,
|
|
47374
|
+
secs2(t.durationMs),
|
|
47375
|
+
String(t.calls),
|
|
47376
|
+
String(t.spanCount),
|
|
47377
|
+
String(t.recordCount),
|
|
47378
|
+
t.costUsd > 0 ? usd(t.costUsd) : "\u2014"
|
|
47379
|
+
])
|
|
47380
|
+
]),
|
|
47381
|
+
EXIT_SUCCESS
|
|
47382
|
+
);
|
|
47383
|
+
}
|
|
47384
|
+
);
|
|
47385
|
+
telemetry.command("export").description(
|
|
47386
|
+
"Write a session's telemetry to stdout as newline-delimited JSON"
|
|
47387
|
+
).argument("<agent>", "Agent Ref \u2014 name or 'agent-\u2026' ID").option("--session <id>", "narrow to one session").option("--signal <signal>", "'logs' or 'spans' (default: logs)", "logs").option(
|
|
47388
|
+
"--since <hours>",
|
|
47389
|
+
`lookback window in hours (max ${TELEMETRY_MAX_SINCE_HOURS}; default ${EXPORT_SINCE_HOURS})`
|
|
47390
|
+
).option(
|
|
47391
|
+
"--server <url>",
|
|
47392
|
+
"override the configured server URL for this call"
|
|
47393
|
+
).addHelpText(
|
|
47394
|
+
"after",
|
|
47395
|
+
"\nExamples:\n dam telemetry export my-agent --session sess-abc123 > telemetry.ndjson\n dam telemetry export my-agent --signal spans | jq -s 'group_by(.name)'\n"
|
|
47396
|
+
).action(
|
|
47397
|
+
async (ref, opts) => {
|
|
47398
|
+
if (opts.signal !== "logs" && opts.signal !== "spans") {
|
|
47399
|
+
process.stderr.write("--signal must be 'logs' or 'spans'\n");
|
|
47400
|
+
return process.exit(EXIT_INVALID_INPUT);
|
|
47401
|
+
}
|
|
47402
|
+
const { host, agent } = await hostAndAgent(deps, ref, opts.server);
|
|
47403
|
+
let sinceHours2;
|
|
47404
|
+
try {
|
|
47405
|
+
sinceHours2 = sinceHoursOf(opts.since, EXPORT_SINCE_HOURS);
|
|
47406
|
+
} catch (err3) {
|
|
47407
|
+
process.stderr.write(`${err3.message}
|
|
47408
|
+
`);
|
|
47409
|
+
return process.exit(EXIT_INVALID_INPUT);
|
|
47410
|
+
}
|
|
47411
|
+
const outcome = await deps.createExportClient(host).run({
|
|
47412
|
+
agentId: agent.id,
|
|
47413
|
+
...opts.session === void 0 ? {} : { sessionId: opts.session },
|
|
47414
|
+
signal: opts.signal,
|
|
47415
|
+
sinceHours: sinceHours2
|
|
47416
|
+
});
|
|
47417
|
+
if (outcome.kind === "failed") {
|
|
47418
|
+
process.stderr.write(
|
|
47419
|
+
`Export failed (${outcome.status}): ${outcome.reason}
|
|
47420
|
+
`
|
|
47421
|
+
);
|
|
47422
|
+
return process.exit(EXIT_RUNTIME_FAILURE);
|
|
47423
|
+
}
|
|
47424
|
+
if (outcome.truncated) {
|
|
47425
|
+
process.stderr.write(
|
|
47426
|
+
"Export hit the row cap \u2014 narrow --since or --session for the rest.\n"
|
|
47427
|
+
);
|
|
47428
|
+
}
|
|
47429
|
+
return writeStdoutAndExit(outcome.body, EXIT_SUCCESS);
|
|
47430
|
+
}
|
|
47431
|
+
);
|
|
47432
|
+
return telemetry;
|
|
47433
|
+
}
|
|
47434
|
+
|
|
47435
|
+
// src/modules/telemetry/infrastructure/export-client.ts
|
|
47436
|
+
function exportPath(req) {
|
|
47437
|
+
const params = new URLSearchParams({
|
|
47438
|
+
agentId: req.agentId,
|
|
47439
|
+
signal: req.signal,
|
|
47440
|
+
sinceHours: String(req.sinceHours)
|
|
47441
|
+
});
|
|
47442
|
+
if (req.sessionId !== void 0) params.set("sessionId", req.sessionId);
|
|
47443
|
+
return `/api/telemetry/export?${params.toString()}`;
|
|
47444
|
+
}
|
|
47445
|
+
function createExportClient(deps) {
|
|
47446
|
+
const doFetch = deps.fetch ?? globalThis.fetch;
|
|
47447
|
+
return {
|
|
47448
|
+
async run(req) {
|
|
47449
|
+
const token = await deps.getToken();
|
|
47450
|
+
if (token === null) {
|
|
47451
|
+
return { kind: "failed", status: 401, reason: "not logged in" };
|
|
47452
|
+
}
|
|
47453
|
+
const res = await doFetch(
|
|
47454
|
+
new URL(exportPath(req), deps.host).toString(),
|
|
47455
|
+
{
|
|
47456
|
+
headers: { authorization: `Bearer ${token}` }
|
|
47457
|
+
}
|
|
47458
|
+
);
|
|
47459
|
+
if (!res.ok) {
|
|
47460
|
+
return {
|
|
47461
|
+
kind: "failed",
|
|
47462
|
+
status: res.status,
|
|
47463
|
+
reason: await failureReason(res)
|
|
47464
|
+
};
|
|
47465
|
+
}
|
|
47466
|
+
return {
|
|
47467
|
+
kind: "ok",
|
|
47468
|
+
body: await res.text(),
|
|
47469
|
+
truncated: res.headers.get("x-platform-truncated") === "true"
|
|
47470
|
+
};
|
|
47471
|
+
}
|
|
47472
|
+
};
|
|
47473
|
+
}
|
|
47474
|
+
async function failureReason(res) {
|
|
47475
|
+
try {
|
|
47476
|
+
const body = await res.json();
|
|
47477
|
+
if (typeof body === "object" && body !== null && typeof body.error === "string") {
|
|
47478
|
+
return body.error;
|
|
47479
|
+
}
|
|
47480
|
+
} catch {
|
|
47481
|
+
return res.statusText;
|
|
47482
|
+
}
|
|
47483
|
+
return res.statusText;
|
|
47484
|
+
}
|
|
47485
|
+
|
|
47486
|
+
// src/modules/telemetry/services/telemetry-service.ts
|
|
47487
|
+
function createTelemetryService(deps) {
|
|
47488
|
+
return {
|
|
47489
|
+
async turns(query) {
|
|
47490
|
+
return trpcCall(() => deps.trpc.telemetry.turns.query(query));
|
|
47491
|
+
}
|
|
47492
|
+
};
|
|
47493
|
+
}
|
|
47494
|
+
|
|
47495
|
+
// src/modules/telemetry/compose.ts
|
|
47496
|
+
function composeTelemetryModule(opts) {
|
|
47497
|
+
return {
|
|
47498
|
+
commands: [
|
|
47499
|
+
buildTelemetryCommand({
|
|
47500
|
+
compatService: opts.compatService,
|
|
47501
|
+
configService: opts.configService,
|
|
47502
|
+
tokenProvider: opts.tokenProvider,
|
|
47503
|
+
createAgentService: opts.createAgentService,
|
|
47504
|
+
createTelemetryService: (host) => createTelemetryService({
|
|
47505
|
+
trpc: createTrpcClient({ host, tokenProvider: opts.tokenProvider })
|
|
47506
|
+
}),
|
|
47507
|
+
createExportClient: (host) => createExportClient({
|
|
47508
|
+
host,
|
|
47509
|
+
getToken: async () => {
|
|
47510
|
+
const token = await opts.tokenProvider.getValidAccessToken(host);
|
|
47511
|
+
return token.ok ? token.value : null;
|
|
47512
|
+
}
|
|
47513
|
+
})
|
|
47514
|
+
})
|
|
47515
|
+
]
|
|
47516
|
+
};
|
|
47517
|
+
}
|
|
47518
|
+
|
|
46716
47519
|
// src/modules/template/commands/list.ts
|
|
46717
47520
|
var DESCRIPTION_MAX = 60;
|
|
46718
47521
|
function buildListCommand8(deps) {
|
|
@@ -47147,6 +47950,12 @@ function compose(opts = {}) {
|
|
|
47147
47950
|
compatService: cli.services.compatService,
|
|
47148
47951
|
createAgentService: agent.exports.createService
|
|
47149
47952
|
});
|
|
47953
|
+
const telemetry = composeTelemetryModule({
|
|
47954
|
+
tokenProvider: auth.exports.tokenProvider,
|
|
47955
|
+
configService: cli.services.configService,
|
|
47956
|
+
compatService: cli.services.compatService,
|
|
47957
|
+
createAgentService: agent.exports.createService
|
|
47958
|
+
});
|
|
47150
47959
|
const terms = composeTermsModule({
|
|
47151
47960
|
tokenProvider: auth.exports.tokenProvider,
|
|
47152
47961
|
configService: cli.services.configService,
|
|
@@ -47169,6 +47978,7 @@ function compose(opts = {}) {
|
|
|
47169
47978
|
for (const command of ssh.commands) program3.addCommand(command);
|
|
47170
47979
|
for (const command of channel.commands) program3.addCommand(command);
|
|
47171
47980
|
for (const command of metrics.commands) program3.addCommand(command);
|
|
47981
|
+
for (const command of telemetry.commands) program3.addCommand(command);
|
|
47172
47982
|
for (const command of terms.commands) program3.addCommand(command);
|
|
47173
47983
|
return program3;
|
|
47174
47984
|
}
|
|
@@ -47198,9 +48008,9 @@ try {
|
|
|
47198
48008
|
@trpc/client/dist/httpBatchLink-CaWjh1oW.mjs:
|
|
47199
48009
|
(* istanbul ignore if -- @preserve *)
|
|
47200
48010
|
|
|
48011
|
+
smol-toml/dist/date.js:
|
|
47201
48012
|
smol-toml/dist/error.js:
|
|
47202
48013
|
smol-toml/dist/util.js:
|
|
47203
|
-
smol-toml/dist/date.js:
|
|
47204
48014
|
smol-toml/dist/primitive.js:
|
|
47205
48015
|
smol-toml/dist/extract.js:
|
|
47206
48016
|
smol-toml/dist/struct.js:
|