agent-transport-system 0.7.13 → 0.7.14
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/ats-dev.js +2 -2
- package/dist/ats.js +32186 -33466
- package/dist/ats.js.map +1 -1
- package/dist/{daemon-runtime-lease-BWYGVA4a.js → daemon-runtime-lease-C1cET4lj.js} +1 -1
- package/dist/{lock-BeL3w4ma.js → lock-BbSDV7cL.js} +410 -600
- package/dist/lock-BbSDV7cL.js.map +1 -0
- package/dist/{runtime-config-BmPPPJcT.js → runtime-config-CudFeMaG.js} +6 -19
- package/dist/runtime-config-CudFeMaG.js.map +1 -0
- package/package.json +2 -2
- package/skills/ats-cli/SKILL.md +36 -1
- package/skills/ats-cli/playbooks/agent-onboarding.md +1 -1
- package/skills/ats-cli/references/commands.md +10 -0
- package/dist/lock-BeL3w4ma.js.map +0 -1
- package/dist/runtime-config-BmPPPJcT.js.map +0 -1
|
@@ -4081,43 +4081,93 @@ var ZodFirstPartyTypeKind;
|
|
|
4081
4081
|
(function(ZodFirstPartyTypeKind) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
4082
4082
|
|
|
4083
4083
|
//#endregion
|
|
4084
|
-
//#region ../../packages/schemas/dist/daemon-hub-
|
|
4085
|
-
const
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4084
|
+
//#region ../../packages/schemas/dist/daemon-hub-226JT2rn.js
|
|
4085
|
+
const agentControllerConversationExternalImportCapabilitySchema = _enum(["unsupported", "by_ref_id"]);
|
|
4086
|
+
const agentControllerConversationResumeCapabilitySchema = _enum(["unsupported", "by_ref_id"]);
|
|
4087
|
+
const agentControllerConversationDiscoverCapabilitySchema = literal("unsupported");
|
|
4088
|
+
const agentControllerConversationTurnOverrideCapabilitySchema = _enum([
|
|
4089
|
+
"unsupported",
|
|
4090
|
+
"stateless",
|
|
4091
|
+
"persistent"
|
|
4089
4092
|
]);
|
|
4090
|
-
const
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
});
|
|
4096
|
-
const legacyUpstreamConversationRefSchema = strictObject({
|
|
4097
|
-
providerId: trimmedNonEmptyStringSchema$8,
|
|
4098
|
-
refKind: upstreamConversationRefKindSchema,
|
|
4099
|
-
refId: trimmedNonEmptyStringSchema$8
|
|
4100
|
-
}).transform((input) => ({
|
|
4101
|
-
providerId: input.providerId,
|
|
4102
|
-
refKind: input.refKind,
|
|
4103
|
-
conversationRefId: input.refId
|
|
4104
|
-
}));
|
|
4105
|
-
const upstreamConversationRefSchema = union([canonicalUpstreamConversationRefSchema, legacyUpstreamConversationRefSchema]);
|
|
4106
|
-
const conversationPolicySchema = strictObject({
|
|
4107
|
-
model: string().min(1).optional(),
|
|
4108
|
-
reasoningLevel: string().min(1).optional()
|
|
4093
|
+
const agentControllerConversationCapabilitySchema = strictObject({
|
|
4094
|
+
discover: agentControllerConversationDiscoverCapabilitySchema,
|
|
4095
|
+
externalImport: agentControllerConversationExternalImportCapabilitySchema,
|
|
4096
|
+
resume: agentControllerConversationResumeCapabilitySchema,
|
|
4097
|
+
turnOverride: agentControllerConversationTurnOverrideCapabilitySchema
|
|
4109
4098
|
});
|
|
4110
|
-
const
|
|
4111
|
-
codex:
|
|
4112
|
-
|
|
4113
|
-
|
|
4099
|
+
const BUILTIN_AGENT_CONTROLLER_CONVERSATION_CAPABILITY_BY_CONTROLLER_ID = {
|
|
4100
|
+
codex: {
|
|
4101
|
+
discover: "unsupported",
|
|
4102
|
+
externalImport: "by_ref_id",
|
|
4103
|
+
resume: "by_ref_id",
|
|
4104
|
+
turnOverride: "unsupported"
|
|
4105
|
+
},
|
|
4106
|
+
"claude-code": {
|
|
4107
|
+
discover: "unsupported",
|
|
4108
|
+
externalImport: "by_ref_id",
|
|
4109
|
+
resume: "by_ref_id",
|
|
4110
|
+
turnOverride: "unsupported"
|
|
4111
|
+
},
|
|
4112
|
+
openclaw: {
|
|
4113
|
+
discover: "unsupported",
|
|
4114
|
+
externalImport: "unsupported",
|
|
4115
|
+
resume: "by_ref_id",
|
|
4116
|
+
turnOverride: "unsupported"
|
|
4117
|
+
}
|
|
4114
4118
|
};
|
|
4115
|
-
const
|
|
4116
|
-
const
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4119
|
+
const resolveBuiltinAgentControllerConversationCapability = (builtinControllerId) => {
|
|
4120
|
+
const capability = BUILTIN_AGENT_CONTROLLER_CONVERSATION_CAPABILITY_BY_CONTROLLER_ID[builtinControllerId];
|
|
4121
|
+
return capability ? { ...capability } : null;
|
|
4122
|
+
};
|
|
4123
|
+
const BUILTIN_AGENT_CONTROLLER_REF_PREFIX = "builtin:";
|
|
4124
|
+
const AGENT_CONTROLLER_REF_SEPARATOR = ":";
|
|
4125
|
+
function normalizeOptionalText$1(value) {
|
|
4126
|
+
if (typeof value !== "string") return null;
|
|
4127
|
+
const normalized = value.trim();
|
|
4128
|
+
return normalized.length > 0 ? normalized : null;
|
|
4129
|
+
}
|
|
4130
|
+
function normalizeBuiltinControllerId(agentControllerRef) {
|
|
4131
|
+
const normalized = normalizeOptionalText$1(agentControllerRef);
|
|
4132
|
+
if (!normalized) return null;
|
|
4133
|
+
if (normalized.includes(":") && !normalized.startsWith(BUILTIN_AGENT_CONTROLLER_REF_PREFIX)) return null;
|
|
4134
|
+
const builtinId = normalized.startsWith(BUILTIN_AGENT_CONTROLLER_REF_PREFIX) ? normalized.slice(8) : normalized;
|
|
4135
|
+
if (builtinId.length === 0 || builtinId.includes(":")) return null;
|
|
4136
|
+
return builtinId;
|
|
4137
|
+
}
|
|
4138
|
+
function normalizeKnownBuiltinAgentControllerId(agentControllerRef) {
|
|
4139
|
+
const builtinId = normalizeBuiltinControllerId(agentControllerRef);
|
|
4140
|
+
return builtinId && resolveBuiltinAgentControllerConversationCapability(builtinId) ? builtinId : null;
|
|
4141
|
+
}
|
|
4142
|
+
function normalizeBuiltinAgentControllerId(agentControllerRef) {
|
|
4143
|
+
return normalizeBuiltinControllerId(agentControllerRef);
|
|
4144
|
+
}
|
|
4145
|
+
function parseAgentControllerRef(agentControllerRef) {
|
|
4146
|
+
const normalized = normalizeOptionalText$1(agentControllerRef);
|
|
4147
|
+
if (!normalized) return null;
|
|
4148
|
+
for (const kind of ["builtin", "custom"]) {
|
|
4149
|
+
const prefix = `${kind}${AGENT_CONTROLLER_REF_SEPARATOR}`;
|
|
4150
|
+
if (!normalized.startsWith(prefix)) continue;
|
|
4151
|
+
const id = normalized.slice(prefix.length).trim();
|
|
4152
|
+
if (id.length === 0 || id.includes(AGENT_CONTROLLER_REF_SEPARATOR)) return null;
|
|
4153
|
+
return {
|
|
4154
|
+
kind,
|
|
4155
|
+
id,
|
|
4156
|
+
ref: `${kind}${AGENT_CONTROLLER_REF_SEPARATOR}${id}`
|
|
4157
|
+
};
|
|
4158
|
+
}
|
|
4159
|
+
return null;
|
|
4160
|
+
}
|
|
4161
|
+
function canonicalizeAgentControllerRef(agentControllerRef) {
|
|
4162
|
+
return parseAgentControllerRef(agentControllerRef)?.ref ?? null;
|
|
4163
|
+
}
|
|
4164
|
+
function buildAgentControllerRoutingKey(agentControllerRef) {
|
|
4165
|
+
return canonicalizeAgentControllerRef(agentControllerRef);
|
|
4166
|
+
}
|
|
4167
|
+
function canonicalizeBuiltinAgentControllerRef(agentControllerRef) {
|
|
4168
|
+
const builtinId = normalizeBuiltinControllerId(agentControllerRef);
|
|
4169
|
+
return builtinId ? `${BUILTIN_AGENT_CONTROLLER_REF_PREFIX}${builtinId}` : null;
|
|
4170
|
+
}
|
|
4121
4171
|
const DAEMON_ROUTE_OBSERVATION_STATUS_VALUES = [
|
|
4122
4172
|
"online",
|
|
4123
4173
|
"offline",
|
|
@@ -4213,10 +4263,6 @@ const normalizeOptionalWorkingDirectory = (value) => {
|
|
|
4213
4263
|
const parsed = profileWorkingDirectorySchema.safeParse(value);
|
|
4214
4264
|
return parsed.success ? parsed.data : void 0;
|
|
4215
4265
|
};
|
|
4216
|
-
const normalizeOptionalUpstreamConversation = (value) => {
|
|
4217
|
-
const parsed = upstreamConversationRefSchema.safeParse(value);
|
|
4218
|
-
return parsed.success ? parsed.data : void 0;
|
|
4219
|
-
};
|
|
4220
4266
|
/** Unknown or invalid kinds are normalized to "agent" for wire compatibility. */
|
|
4221
4267
|
const profileKindWithFallbackSchema = preprocess((value) => {
|
|
4222
4268
|
const parsed = _enum(PROFILE_KIND_VALUES).safeParse(value);
|
|
@@ -4256,9 +4302,8 @@ const profileSchema = object({
|
|
|
4256
4302
|
profileName: unknown().optional(),
|
|
4257
4303
|
owner: unknown().optional(),
|
|
4258
4304
|
ownerName: unknown().optional(),
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
upstreamConversation: unknown().optional(),
|
|
4305
|
+
agentControllerRef: unknown().optional(),
|
|
4306
|
+
agentControllerConversationId: unknown().optional(),
|
|
4262
4307
|
workingDirectory: unknown().optional()
|
|
4263
4308
|
}).transform((value) => {
|
|
4264
4309
|
const kind = value.kind ?? "agent";
|
|
@@ -4266,9 +4311,8 @@ const profileSchema = object({
|
|
|
4266
4311
|
const profileName = normalizeOptionalProfileLabel(value.profileName);
|
|
4267
4312
|
const owner = kind === "agent" ? normalizeOptionalProfileLabel(value.owner) : void 0;
|
|
4268
4313
|
const ownerName = kind === "agent" ? normalizeOptionalProfileLabel(value.ownerName) : void 0;
|
|
4269
|
-
const
|
|
4270
|
-
const
|
|
4271
|
-
const upstreamConversation = kind === "agent" ? normalizeOptionalUpstreamConversation(value.upstreamConversation) : void 0;
|
|
4314
|
+
const agentControllerRef = kind === "agent" ? normalizeOptionalProfileLabel(value.agentControllerRef) : void 0;
|
|
4315
|
+
const agentControllerConversationId = kind === "agent" ? normalizeOptionalProfileLabel(value.agentControllerConversationId) : void 0;
|
|
4272
4316
|
const workingDirectory = kind === "agent" ? normalizeOptionalWorkingDirectory(value.workingDirectory) : void 0;
|
|
4273
4317
|
return {
|
|
4274
4318
|
kind,
|
|
@@ -4277,9 +4321,8 @@ const profileSchema = object({
|
|
|
4277
4321
|
...profileName ? { profileName } : {},
|
|
4278
4322
|
...owner ? { owner } : {},
|
|
4279
4323
|
...ownerName ? { ownerName } : {},
|
|
4280
|
-
...
|
|
4281
|
-
...
|
|
4282
|
-
...upstreamConversation ? { upstreamConversation } : {},
|
|
4324
|
+
...agentControllerRef ? { agentControllerRef } : {},
|
|
4325
|
+
...agentControllerConversationId ? { agentControllerConversationId } : {},
|
|
4283
4326
|
...workingDirectory ? { workingDirectory } : {}
|
|
4284
4327
|
};
|
|
4285
4328
|
});
|
|
@@ -4716,7 +4759,7 @@ const resultArchiveModeSchema = _enum([
|
|
|
4716
4759
|
]);
|
|
4717
4760
|
const resultArchivePolicySchema = strictObject({ mode: resultArchiveModeSchema });
|
|
4718
4761
|
const spaceNoteSchema = string().trim().min(1);
|
|
4719
|
-
const isoDateTimeSchema$
|
|
4762
|
+
const isoDateTimeSchema$3 = datetime({ offset: true });
|
|
4720
4763
|
const spaceBriefModeSchema = _enum(["default", "none"]);
|
|
4721
4764
|
const spaceContractFieldsSchema = strictObject({
|
|
4722
4765
|
dispatchPolicy: spaceDispatchPolicySchema,
|
|
@@ -4730,7 +4773,7 @@ const spaceContractFieldsSchema = strictObject({
|
|
|
4730
4773
|
});
|
|
4731
4774
|
const spaceContractSchema = strictObject({
|
|
4732
4775
|
version: number().int().finite().positive(),
|
|
4733
|
-
updatedAt: isoDateTimeSchema$
|
|
4776
|
+
updatedAt: isoDateTimeSchema$3,
|
|
4734
4777
|
updatedBy: preprocess(trimmedStringFromUnknown, string().min(1)),
|
|
4735
4778
|
dispatchPolicy: spaceDispatchPolicySchema,
|
|
4736
4779
|
publicationMode: spacePublicationModeSchema,
|
|
@@ -4772,11 +4815,41 @@ const spaceThreadEventSchema = strictObject({
|
|
|
4772
4815
|
createdAt: ISO_DATE_TIME_SCHEMA$1$1
|
|
4773
4816
|
});
|
|
4774
4817
|
const spaceThreadActionRefSchema = strictObject({ threadId: spaceThreadIdSchema });
|
|
4818
|
+
const agentControllerConversationKindSchema = _enum([
|
|
4819
|
+
"session",
|
|
4820
|
+
"thread",
|
|
4821
|
+
"context"
|
|
4822
|
+
]);
|
|
4823
|
+
const trimmedNonEmptyStringSchema$8 = string().trim().min(1);
|
|
4824
|
+
const agentControllerConversationRefSchema = strictObject({
|
|
4825
|
+
agentControllerRef: trimmedNonEmptyStringSchema$8,
|
|
4826
|
+
agentControllerConversationKind: agentControllerConversationKindSchema,
|
|
4827
|
+
agentControllerConversationId: trimmedNonEmptyStringSchema$8
|
|
4828
|
+
});
|
|
4829
|
+
const conversationPolicySchema = strictObject({
|
|
4830
|
+
model: string().min(1).optional(),
|
|
4831
|
+
reasoningLevel: string().min(1).optional()
|
|
4832
|
+
});
|
|
4833
|
+
const BUILTIN_AGENT_CONTROLLER_CONVERSATION_KIND_BY_CONTROLLER_ID = {
|
|
4834
|
+
codex: "thread",
|
|
4835
|
+
"claude-code": "session",
|
|
4836
|
+
openclaw: "session"
|
|
4837
|
+
};
|
|
4838
|
+
const resolveBuiltinAgentControllerConversationKind = (agentControllerRef) => {
|
|
4839
|
+
const canonical = canonicalizeBuiltinAgentControllerRef(agentControllerRef);
|
|
4840
|
+
if (!canonical) return null;
|
|
4841
|
+
return BUILTIN_AGENT_CONTROLLER_CONVERSATION_KIND_BY_CONTROLLER_ID[canonical.slice(8)] ?? null;
|
|
4842
|
+
};
|
|
4843
|
+
const buildAgentControllerConversationRef = (input) => ({
|
|
4844
|
+
agentControllerRef: input.agentControllerRef,
|
|
4845
|
+
agentControllerConversationKind: input.agentControllerConversationKind,
|
|
4846
|
+
agentControllerConversationId: input.agentControllerConversationId
|
|
4847
|
+
});
|
|
4775
4848
|
const LEGACY_RUNTIME_DISPATCH_POLICY = "mention_only";
|
|
4776
4849
|
const runtimeDispatchPolicySchema = _enum([LEGACY_RUNTIME_DISPATCH_POLICY, "listen_all"]);
|
|
4777
4850
|
const runtimeTransportModeSchema = _enum(["local-cli"]);
|
|
4778
4851
|
const runtimeStreamingModeSchema = _enum(["final", "stream"]);
|
|
4779
|
-
const
|
|
4852
|
+
const runtimeAgentControllerConversationIdMappingSpecSchema = strictObject({
|
|
4780
4853
|
sourceField: string().min(1),
|
|
4781
4854
|
mappingVersion: number().int().min(1)
|
|
4782
4855
|
});
|
|
@@ -4805,107 +4878,14 @@ const runtimeAgentControllerSettingsSchema = strictObject({
|
|
|
4805
4878
|
streaming_mode: runtimeStreamingModeSchema.default("final"),
|
|
4806
4879
|
timeout_ms: number().int().positive().nullable().default(null),
|
|
4807
4880
|
retry: number().int().min(0).default(0),
|
|
4808
|
-
context_id_mapping_spec:
|
|
4881
|
+
context_id_mapping_spec: runtimeAgentControllerConversationIdMappingSpecSchema
|
|
4809
4882
|
});
|
|
4810
4883
|
const agentContextResolutionSchema = strictObject({
|
|
4811
|
-
|
|
4812
|
-
|
|
4884
|
+
agentControllerConversationId: string().min(1).nullable(),
|
|
4885
|
+
agentControllerConversation: agentControllerConversationRefSchema.nullable().optional(),
|
|
4813
4886
|
sourceField: string().min(1),
|
|
4814
4887
|
mappingVersion: number().int().min(1)
|
|
4815
4888
|
});
|
|
4816
|
-
const conversationBootstrapReasonSchema = _enum([
|
|
4817
|
-
"missing_bootstrap_state",
|
|
4818
|
-
"compatibility_recreate",
|
|
4819
|
-
"template_changed",
|
|
4820
|
-
"idle_stale",
|
|
4821
|
-
"dispatch_count_stale",
|
|
4822
|
-
"context_healed",
|
|
4823
|
-
"context_replaced"
|
|
4824
|
-
]);
|
|
4825
|
-
const localRuntimeContextReasonSchema = _enum([
|
|
4826
|
-
"first_local_runtime_context",
|
|
4827
|
-
"workspace_changed",
|
|
4828
|
-
"transport_mode_changed",
|
|
4829
|
-
"policy_changed",
|
|
4830
|
-
"execution_state_missing",
|
|
4831
|
-
"controller_changed"
|
|
4832
|
-
]);
|
|
4833
|
-
const upstreamConversationResumePlanBlockedReasonSchema = _enum(["controller_changed"]);
|
|
4834
|
-
const upstreamConversationResumePlanSchema = discriminatedUnion("status", [
|
|
4835
|
-
strictObject({ status: literal("not_bound") }),
|
|
4836
|
-
strictObject({ status: literal("continue_existing") }),
|
|
4837
|
-
strictObject({
|
|
4838
|
-
status: literal("blocked"),
|
|
4839
|
-
reason: upstreamConversationResumePlanBlockedReasonSchema
|
|
4840
|
-
})
|
|
4841
|
-
]);
|
|
4842
|
-
const localRuntimeContextPlanSchema = strictObject({
|
|
4843
|
-
status: _enum(["reuse", "recreate"]),
|
|
4844
|
-
reason: union([localRuntimeContextReasonSchema, _null()])
|
|
4845
|
-
});
|
|
4846
|
-
const conversationBootstrapSchema = discriminatedUnion("status", [strictObject({
|
|
4847
|
-
reason: _null(),
|
|
4848
|
-
status: literal("applied")
|
|
4849
|
-
}), strictObject({
|
|
4850
|
-
reason: conversationBootstrapReasonSchema,
|
|
4851
|
-
status: literal("pending")
|
|
4852
|
-
})]);
|
|
4853
|
-
const nextDispatchPlanSchema = strictObject({
|
|
4854
|
-
upstreamConversationResume: upstreamConversationResumePlanSchema,
|
|
4855
|
-
localRuntimeContext: localRuntimeContextPlanSchema,
|
|
4856
|
-
bootstrap: conversationBootstrapSchema
|
|
4857
|
-
});
|
|
4858
|
-
const upstreamConversationResumeSchema = discriminatedUnion("status", [
|
|
4859
|
-
strictObject({ status: literal("not_bound") }),
|
|
4860
|
-
strictObject({ status: literal("continued") }),
|
|
4861
|
-
strictObject({ status: literal("replaced_by_provider") })
|
|
4862
|
-
]);
|
|
4863
|
-
const localRuntimeContextExecutionSchema = strictObject({
|
|
4864
|
-
status: _enum(["reused", "recreated"]),
|
|
4865
|
-
reason: union([localRuntimeContextReasonSchema, _null()])
|
|
4866
|
-
});
|
|
4867
|
-
const dispatchExecutionSchema = strictObject({
|
|
4868
|
-
upstreamConversationResume: upstreamConversationResumeSchema,
|
|
4869
|
-
localRuntimeContext: localRuntimeContextExecutionSchema,
|
|
4870
|
-
bootstrap: conversationBootstrapSchema
|
|
4871
|
-
});
|
|
4872
|
-
const ISO_DATE_TIME_SCHEMA$7 = datetime({ offset: true });
|
|
4873
|
-
const bootstrapTemplateFactsSchema = strictObject({
|
|
4874
|
-
templateVersion: string().min(1),
|
|
4875
|
-
contentFingerprint: string().min(1)
|
|
4876
|
-
});
|
|
4877
|
-
const conversationBindingObservedStateSchema = strictObject({
|
|
4878
|
-
lastObservedContextId: string().min(1),
|
|
4879
|
-
health: literal("healthy")
|
|
4880
|
-
});
|
|
4881
|
-
const conversationBindingSourceSchema = _enum(["daemon-launch", "imported"]);
|
|
4882
|
-
const conversationBindingRecordSchema = strictObject({
|
|
4883
|
-
spaceId: string().min(1),
|
|
4884
|
-
atsProfileId: string().min(1),
|
|
4885
|
-
active: boolean(),
|
|
4886
|
-
bindingSource: conversationBindingSourceSchema,
|
|
4887
|
-
controllerRef: string().min(1),
|
|
4888
|
-
transportMode: runtimeTransportModeSchema,
|
|
4889
|
-
conversationRef: upstreamConversationRefSchema,
|
|
4890
|
-
policy: conversationPolicySchema,
|
|
4891
|
-
observedState: conversationBindingObservedStateSchema.optional(),
|
|
4892
|
-
bootstrapTemplateFacts: bootstrapTemplateFactsSchema,
|
|
4893
|
-
updatedAt: ISO_DATE_TIME_SCHEMA$7
|
|
4894
|
-
});
|
|
4895
|
-
const conversationExecutionStateSchema = strictObject({
|
|
4896
|
-
agentContextLookupKey: string().min(1),
|
|
4897
|
-
activeContextId: string().min(1).nullable(),
|
|
4898
|
-
lastResolvedUpstreamConversation: upstreamConversationRefSchema.optional(),
|
|
4899
|
-
lastRuntimeWorkspacePath: profileWorkingDirectorySchema.optional(),
|
|
4900
|
-
runtimeWorkspaceFingerprint: string().min(1),
|
|
4901
|
-
bootstrapLastAppliedAt: ISO_DATE_TIME_SCHEMA$7.optional(),
|
|
4902
|
-
bootstrapLastActivatedAt: ISO_DATE_TIME_SCHEMA$7.optional(),
|
|
4903
|
-
dispatchesSinceBootstrapApplied: number().int().min(0),
|
|
4904
|
-
lastAppliedTemplateVersion: string().min(1).optional(),
|
|
4905
|
-
lastAppliedContentFingerprint: string().min(1).optional(),
|
|
4906
|
-
pendingBootstrapReason: conversationBootstrapReasonSchema.optional(),
|
|
4907
|
-
updatedAt: ISO_DATE_TIME_SCHEMA$7
|
|
4908
|
-
});
|
|
4909
4889
|
const CORE_READINESS_FACTS_CHANGED_MARKER_KIND = "core_readiness_facts_changed";
|
|
4910
4890
|
const coreReadinessFactsChangedSchema = strictObject({
|
|
4911
4891
|
agentProfileId: agentProfileIdSchema,
|
|
@@ -5133,8 +5113,7 @@ const atsdDispatchRulesSnapshotSchema = strictObject({
|
|
|
5133
5113
|
const atsdDispatchControllerSnapshotSchema = strictObject({
|
|
5134
5114
|
targetBindingState: _enum(["bound", "missing"]).describe("Compatibility seed evidence captured at Space handoff time. RuntimeCoordinator head lifecycle and Core Binding lookup remain the Wake outcome authorities."),
|
|
5135
5115
|
targetBindingEnabled: boolean().describe("Compatibility seed evidence captured at Space handoff time. RuntimeCoordinator head lifecycle and Core Binding lookup remain the Wake outcome authorities."),
|
|
5136
|
-
|
|
5137
|
-
controllerRef: string().min(1).nullable()
|
|
5116
|
+
agentControllerRef: string().min(1).nullable()
|
|
5138
5117
|
});
|
|
5139
5118
|
const atsdDispatchSnapshotSchema = strictObject({
|
|
5140
5119
|
dispatchPolicy: runtimeDispatchPolicySchema,
|
|
@@ -5194,7 +5173,7 @@ const atsdDispatchQueueMessageSchema = strictObject({
|
|
|
5194
5173
|
transportMode: runtimeTransportModeSchema.nullable(),
|
|
5195
5174
|
spacePassword: spacePasswordSchema.optional(),
|
|
5196
5175
|
controllerSnapshot: atsdDispatchControllerSnapshotSchema,
|
|
5197
|
-
contextIdMappingSpec:
|
|
5176
|
+
contextIdMappingSpec: runtimeAgentControllerConversationIdMappingSpecSchema.nullable(),
|
|
5198
5177
|
dispatchRulesSnapshot: atsdDispatchRulesSnapshotSchema,
|
|
5199
5178
|
dispatchSnapshot: atsdDispatchSnapshotSchema,
|
|
5200
5179
|
spaceContractSnapshot: spaceContractSchema.optional(),
|
|
@@ -5244,7 +5223,7 @@ const atsdDispatchQueueMessageSchema = strictObject({
|
|
|
5244
5223
|
const atsdDispatchQueueIngressSchema = discriminatedUnion("v", [atsdDispatchQueueLegacyMessageSchemaV1, atsdDispatchQueueMessageSchema]);
|
|
5245
5224
|
const RUNTIME_EXECUTION_IDENTITY_MODEL_VERSION = "ats.runtime.execution_identity.v1";
|
|
5246
5225
|
const boundedIdentifierSchema$2$1 = string().trim().min(1).max(512);
|
|
5247
|
-
const
|
|
5226
|
+
const runtimeExecutionAuthorityAtsServiceRuntimeIdSchema = strictObject({
|
|
5248
5227
|
source: literal("runtime_registry_authority"),
|
|
5249
5228
|
value: boundedIdentifierSchema$2$1
|
|
5250
5229
|
});
|
|
@@ -5253,9 +5232,9 @@ const runtimeExecutionIdentityCoreSchema = strictObject({
|
|
|
5253
5232
|
spaceId: boundedIdentifierSchema$2$1,
|
|
5254
5233
|
dispatchId: boundedIdentifierSchema$2$1,
|
|
5255
5234
|
targetProfileId: boundedIdentifierSchema$2$1,
|
|
5256
|
-
|
|
5235
|
+
atsServiceRuntimeId: runtimeExecutionAuthorityAtsServiceRuntimeIdSchema,
|
|
5257
5236
|
bindingId: boundedIdentifierSchema$2$1,
|
|
5258
|
-
|
|
5237
|
+
agentControllerRef: boundedIdentifierSchema$2$1
|
|
5259
5238
|
});
|
|
5260
5239
|
const daemonHubDeliveryExecutionIdentitySchema = strictObject({
|
|
5261
5240
|
authority: literal("core_runtime_registry_binding_route"),
|
|
@@ -5365,8 +5344,8 @@ const runtimeCoordinatorTokenExecutionScopeSchema = strictObject({
|
|
|
5365
5344
|
});
|
|
5366
5345
|
const runtimeCoordinatorTokenAuthorityScopeSchema = strictObject({
|
|
5367
5346
|
bindingId: boundedIdentifierSchema$1$1,
|
|
5368
|
-
|
|
5369
|
-
|
|
5347
|
+
agentControllerRef: boundedIdentifierSchema$1$1,
|
|
5348
|
+
atsServiceRuntimeId: boundedIdentifierSchema$1$1
|
|
5370
5349
|
});
|
|
5371
5350
|
const runtimeCoordinatorTokenDeliveryProvenanceSchema = strictObject({
|
|
5372
5351
|
connectionGeneration: nullablePositiveIntegerSchema$1,
|
|
@@ -5683,9 +5662,9 @@ const runtimeCoordinatorExecutionRecordSchema = strictObject({
|
|
|
5683
5662
|
dispatchId: boundedIdentifierSchema$6,
|
|
5684
5663
|
targetProfileId: boundedIdentifierSchema$6,
|
|
5685
5664
|
sourceClientMessageId: nullableSourceClientMessageIdSchema,
|
|
5686
|
-
|
|
5665
|
+
atsServiceRuntimeId: runtimeExecutionAuthorityAtsServiceRuntimeIdSchema,
|
|
5687
5666
|
bindingId: boundedIdentifierSchema$6,
|
|
5688
|
-
|
|
5667
|
+
agentControllerRef: boundedIdentifierSchema$6,
|
|
5689
5668
|
status: runtimeCoordinatorExecutionStatusSchema,
|
|
5690
5669
|
terminalOutcome: runtimeCoordinatorTerminalOutcomeSchema.nullable(),
|
|
5691
5670
|
createdAtMs: number().int().nonnegative(),
|
|
@@ -5793,6 +5772,81 @@ const atsSpaceEgressActionSchema = union([
|
|
|
5793
5772
|
atsSpacePostStatusActionSchema,
|
|
5794
5773
|
atsSpaceStaySilentActionSchema
|
|
5795
5774
|
]);
|
|
5775
|
+
const conversationBootstrapReasonSchema = _enum([
|
|
5776
|
+
"missing_bootstrap_state",
|
|
5777
|
+
"compatibility_recreate",
|
|
5778
|
+
"template_changed",
|
|
5779
|
+
"idle_stale",
|
|
5780
|
+
"dispatch_count_stale",
|
|
5781
|
+
"context_healed",
|
|
5782
|
+
"context_replaced"
|
|
5783
|
+
]);
|
|
5784
|
+
const localRuntimeContextReasonSchema = _enum([
|
|
5785
|
+
"first_local_runtime_context",
|
|
5786
|
+
"workspace_changed",
|
|
5787
|
+
"transport_mode_changed",
|
|
5788
|
+
"policy_changed",
|
|
5789
|
+
"execution_state_missing",
|
|
5790
|
+
"controller_changed"
|
|
5791
|
+
]);
|
|
5792
|
+
const agentControllerConversationResumePlanBlockedReasonSchema = _enum(["controller_changed"]);
|
|
5793
|
+
const agentControllerConversationResumePlanSchema = discriminatedUnion("status", [
|
|
5794
|
+
strictObject({ status: literal("not_bound") }),
|
|
5795
|
+
strictObject({ status: literal("continue_existing") }),
|
|
5796
|
+
strictObject({
|
|
5797
|
+
status: literal("blocked"),
|
|
5798
|
+
reason: agentControllerConversationResumePlanBlockedReasonSchema
|
|
5799
|
+
})
|
|
5800
|
+
]);
|
|
5801
|
+
const localRuntimeContextPlanSchema = strictObject({
|
|
5802
|
+
status: _enum(["reuse", "recreate"]),
|
|
5803
|
+
reason: union([localRuntimeContextReasonSchema, _null()])
|
|
5804
|
+
});
|
|
5805
|
+
const conversationBootstrapSchema = discriminatedUnion("status", [strictObject({
|
|
5806
|
+
reason: _null(),
|
|
5807
|
+
status: literal("applied")
|
|
5808
|
+
}), strictObject({
|
|
5809
|
+
reason: conversationBootstrapReasonSchema,
|
|
5810
|
+
status: literal("pending")
|
|
5811
|
+
})]);
|
|
5812
|
+
const nextDispatchPlanSchema = strictObject({
|
|
5813
|
+
agentControllerConversationResume: agentControllerConversationResumePlanSchema,
|
|
5814
|
+
localRuntimeContext: localRuntimeContextPlanSchema,
|
|
5815
|
+
bootstrap: conversationBootstrapSchema
|
|
5816
|
+
});
|
|
5817
|
+
const agentControllerConversationResumeSchema = discriminatedUnion("status", [
|
|
5818
|
+
strictObject({ status: literal("not_bound") }),
|
|
5819
|
+
strictObject({ status: literal("continued") }),
|
|
5820
|
+
strictObject({ status: literal("replaced_by_provider") })
|
|
5821
|
+
]);
|
|
5822
|
+
const localRuntimeContextExecutionSchema = strictObject({
|
|
5823
|
+
status: _enum(["reused", "recreated"]),
|
|
5824
|
+
reason: union([localRuntimeContextReasonSchema, _null()])
|
|
5825
|
+
});
|
|
5826
|
+
const dispatchExecutionSchema = strictObject({
|
|
5827
|
+
agentControllerConversationResume: agentControllerConversationResumeSchema,
|
|
5828
|
+
localRuntimeContext: localRuntimeContextExecutionSchema,
|
|
5829
|
+
bootstrap: conversationBootstrapSchema
|
|
5830
|
+
});
|
|
5831
|
+
const ISO_DATE_TIME_SCHEMA$7 = datetime({ offset: true });
|
|
5832
|
+
const bootstrapTemplateFactsSchema = strictObject({
|
|
5833
|
+
templateVersion: string().min(1),
|
|
5834
|
+
contentFingerprint: string().min(1)
|
|
5835
|
+
});
|
|
5836
|
+
const conversationExecutionStateSchema = strictObject({
|
|
5837
|
+
agentContextLookupKey: string().min(1),
|
|
5838
|
+
activeContextId: string().min(1).nullable(),
|
|
5839
|
+
lastResolvedAgentControllerConversation: agentControllerConversationRefSchema.optional(),
|
|
5840
|
+
lastRuntimeWorkspacePath: profileWorkingDirectorySchema.optional(),
|
|
5841
|
+
runtimeWorkspaceFingerprint: string().min(1),
|
|
5842
|
+
bootstrapLastAppliedAt: ISO_DATE_TIME_SCHEMA$7.optional(),
|
|
5843
|
+
bootstrapLastActivatedAt: ISO_DATE_TIME_SCHEMA$7.optional(),
|
|
5844
|
+
dispatchesSinceBootstrapApplied: number().int().min(0),
|
|
5845
|
+
lastAppliedTemplateVersion: string().min(1).optional(),
|
|
5846
|
+
lastAppliedContentFingerprint: string().min(1).optional(),
|
|
5847
|
+
pendingBootstrapReason: conversationBootstrapReasonSchema.optional(),
|
|
5848
|
+
updatedAt: ISO_DATE_TIME_SCHEMA$7
|
|
5849
|
+
});
|
|
5796
5850
|
const ATSD_TASK_RESULT_SCHEMA_VERSION = 4;
|
|
5797
5851
|
const ATSD_TASK_RESULT_SCHEMA_VERSION_PREVIOUS = 3;
|
|
5798
5852
|
const ATSD_TASK_RESULT_SCHEMA_VERSION_LEGACY = 2;
|
|
@@ -5909,13 +5963,13 @@ const atsdTaskResultCommonSchemaV1 = strictObject({
|
|
|
5909
5963
|
sourceEventId: string().min(1),
|
|
5910
5964
|
agentId: string().min(1),
|
|
5911
5965
|
deduped: boolean(),
|
|
5912
|
-
|
|
5913
|
-
|
|
5966
|
+
agentControllerRef: string().min(1).optional(),
|
|
5967
|
+
agentControllerConversationId: string().min(1).optional()
|
|
5914
5968
|
});
|
|
5915
5969
|
const atsdTaskResultCommonSchema = atsdTaskResultCommonSchemaV1.extend({
|
|
5916
5970
|
attemptId: string().min(1),
|
|
5917
5971
|
telemetry: atsdTaskResultTelemetrySchema.optional(),
|
|
5918
|
-
|
|
5972
|
+
agentControllerConversation: agentControllerConversationRefSchema.optional(),
|
|
5919
5973
|
effectiveRuntimeWorkingDirectory: profileWorkingDirectorySchema.optional(),
|
|
5920
5974
|
runtimeWorkspaceFingerprint: string().min(1).optional(),
|
|
5921
5975
|
promptTrace: atsdTaskResultPromptTraceSchema.optional(),
|
|
@@ -5933,7 +5987,7 @@ const atsdTaskResultCommonSchema = atsdTaskResultCommonSchemaV1.extend({
|
|
|
5933
5987
|
const atsdTaskResultCommonSchemaV3 = atsdTaskResultCommonSchemaV1.extend({
|
|
5934
5988
|
attemptId: string().min(1),
|
|
5935
5989
|
telemetry: atsdTaskResultTelemetrySchema.optional(),
|
|
5936
|
-
|
|
5990
|
+
agentControllerConversation: agentControllerConversationRefSchema.optional(),
|
|
5937
5991
|
effectiveRuntimeWorkingDirectory: profileWorkingDirectorySchema.optional(),
|
|
5938
5992
|
runtimeWorkspaceFingerprint: string().min(1).optional(),
|
|
5939
5993
|
bootstrapTemplateFacts: bootstrapTemplateFactsSchema.optional(),
|
|
@@ -6203,7 +6257,7 @@ const daemonHubDeliverDispatchPayloadSchema = strictObject({
|
|
|
6203
6257
|
dispatchContractVersion: number().int().positive(),
|
|
6204
6258
|
dispatchPolicy: runtimeDispatchPolicySchema,
|
|
6205
6259
|
controllerSnapshot: atsdDispatchControllerSnapshotSchema,
|
|
6206
|
-
contextIdMappingSpec:
|
|
6260
|
+
contextIdMappingSpec: runtimeAgentControllerConversationIdMappingSpecSchema.nullable(),
|
|
6207
6261
|
dispatchRulesSnapshot: atsdDispatchRulesSnapshotSchema,
|
|
6208
6262
|
spaceContractSnapshot: spaceContractSchema.optional(),
|
|
6209
6263
|
continuitySnapshot: atsdDispatchContinuitySnapshotSchema.optional(),
|
|
@@ -6212,7 +6266,7 @@ const daemonHubDeliverDispatchPayloadSchema = strictObject({
|
|
|
6212
6266
|
spacePassword: spacePasswordSchema.optional(),
|
|
6213
6267
|
targetProfileName: string().min(1).max(MAX_PROFILE_NAME_LENGTH).optional(),
|
|
6214
6268
|
targetProfileMentionLabel: spaceMentionLabelSchema.optional(),
|
|
6215
|
-
|
|
6269
|
+
agentControllerConversationId: string().trim().min(1).optional(),
|
|
6216
6270
|
deliveryRecoveryReason: atsdDispatchDeliveryRecoveryReasonSchema.optional(),
|
|
6217
6271
|
dispatchChainId: string().min(1).optional(),
|
|
6218
6272
|
autoRelayDepth: number().int().nonnegative().optional(),
|
|
@@ -6635,11 +6689,11 @@ const daemonHubDispatchLifecyclePhaseSchema = _enum([
|
|
|
6635
6689
|
]);
|
|
6636
6690
|
const daemonHubDispatchLocalQueueWaitReasonSchema = _enum([
|
|
6637
6691
|
"global_concurrency",
|
|
6638
|
-
"
|
|
6639
|
-
"
|
|
6692
|
+
"local_execution_lane_concurrency",
|
|
6693
|
+
"none"
|
|
6640
6694
|
]);
|
|
6641
6695
|
const daemonHubDispatchLocalQueueDiagnosticsSchema = strictObject({
|
|
6642
|
-
|
|
6696
|
+
activeForLane: number().int().nonnegative(),
|
|
6643
6697
|
activeGlobal: number().int().nonnegative(),
|
|
6644
6698
|
globalConcurrency: number().int().positive(),
|
|
6645
6699
|
queueDepth: number().int().nonnegative(),
|
|
@@ -6797,85 +6851,7 @@ const daemonStreamErrorFrameSchema = strictObject({
|
|
|
6797
6851
|
});
|
|
6798
6852
|
|
|
6799
6853
|
//#endregion
|
|
6800
|
-
//#region ../../packages/schemas/dist/entry-brief-
|
|
6801
|
-
const providerConversationExternalImportCapabilitySchema = _enum(["unsupported", "by_ref_id"]);
|
|
6802
|
-
const providerConversationResumeCapabilitySchema = _enum(["unsupported", "by_ref_id"]);
|
|
6803
|
-
const providerConversationDiscoverCapabilitySchema = literal("unsupported");
|
|
6804
|
-
const providerConversationTurnOverrideCapabilitySchema = _enum([
|
|
6805
|
-
"unsupported",
|
|
6806
|
-
"stateless",
|
|
6807
|
-
"persistent"
|
|
6808
|
-
]);
|
|
6809
|
-
const providerConversationCapabilitySchema = strictObject({
|
|
6810
|
-
discover: providerConversationDiscoverCapabilitySchema,
|
|
6811
|
-
externalImport: providerConversationExternalImportCapabilitySchema,
|
|
6812
|
-
resume: providerConversationResumeCapabilitySchema,
|
|
6813
|
-
turnOverride: providerConversationTurnOverrideCapabilitySchema
|
|
6814
|
-
});
|
|
6815
|
-
const BUILTIN_PROVIDER_CONVERSATION_CAPABILITY_BY_PROVIDER = {
|
|
6816
|
-
codex: {
|
|
6817
|
-
discover: "unsupported",
|
|
6818
|
-
externalImport: "by_ref_id",
|
|
6819
|
-
resume: "by_ref_id",
|
|
6820
|
-
turnOverride: "unsupported"
|
|
6821
|
-
},
|
|
6822
|
-
"claude-code": {
|
|
6823
|
-
discover: "unsupported",
|
|
6824
|
-
externalImport: "by_ref_id",
|
|
6825
|
-
resume: "by_ref_id",
|
|
6826
|
-
turnOverride: "unsupported"
|
|
6827
|
-
},
|
|
6828
|
-
openclaw: {
|
|
6829
|
-
discover: "unsupported",
|
|
6830
|
-
externalImport: "unsupported",
|
|
6831
|
-
resume: "by_ref_id",
|
|
6832
|
-
turnOverride: "unsupported"
|
|
6833
|
-
}
|
|
6834
|
-
};
|
|
6835
|
-
const resolveBuiltinProviderConversationCapability = (providerId) => {
|
|
6836
|
-
const capability = BUILTIN_PROVIDER_CONVERSATION_CAPABILITY_BY_PROVIDER[providerId];
|
|
6837
|
-
return capability ? { ...capability } : null;
|
|
6838
|
-
};
|
|
6839
|
-
const BUILTIN_CONTROLLER_REF_PREFIX = "builtin:";
|
|
6840
|
-
function normalizeOptionalText$1(value) {
|
|
6841
|
-
if (typeof value !== "string") return null;
|
|
6842
|
-
const normalized = value.trim();
|
|
6843
|
-
return normalized.length > 0 ? normalized : null;
|
|
6844
|
-
}
|
|
6845
|
-
function normalizeBuiltinControllerId(controllerRef) {
|
|
6846
|
-
const normalized = normalizeOptionalText$1(controllerRef);
|
|
6847
|
-
if (!normalized) return null;
|
|
6848
|
-
if (normalized.includes(":") && !normalized.startsWith(BUILTIN_CONTROLLER_REF_PREFIX)) return null;
|
|
6849
|
-
const builtinId = normalized.startsWith(BUILTIN_CONTROLLER_REF_PREFIX) ? normalized.slice(8) : normalized;
|
|
6850
|
-
if (builtinId.length === 0 || builtinId.includes(":")) return null;
|
|
6851
|
-
return builtinId;
|
|
6852
|
-
}
|
|
6853
|
-
function normalizeBuiltinControllerProviderId(controllerRef) {
|
|
6854
|
-
const builtinId = normalizeBuiltinControllerId(controllerRef);
|
|
6855
|
-
return builtinId && resolveBuiltinProviderConversationCapability(builtinId) ? builtinId : null;
|
|
6856
|
-
}
|
|
6857
|
-
function normalizeBuiltinControllerAgentId(controllerRef) {
|
|
6858
|
-
return normalizeBuiltinControllerId(controllerRef);
|
|
6859
|
-
}
|
|
6860
|
-
function isExplicitBuiltinControllerRef(controllerRef) {
|
|
6861
|
-
const normalized = normalizeOptionalText$1(controllerRef);
|
|
6862
|
-
return normalized?.startsWith(BUILTIN_CONTROLLER_REF_PREFIX) === true && normalizeBuiltinControllerProviderId(normalized) !== null;
|
|
6863
|
-
}
|
|
6864
|
-
function canonicalizeControllerRefForKind(input) {
|
|
6865
|
-
const normalized = normalizeOptionalText$1(input.controllerRef);
|
|
6866
|
-
if (!normalized) return null;
|
|
6867
|
-
if (input.controllerKind === "builtin") return canonicalizeBuiltinControllerRef(normalized);
|
|
6868
|
-
return normalized;
|
|
6869
|
-
}
|
|
6870
|
-
function buildControllerRoutingKeyForKind(input) {
|
|
6871
|
-
const canonicalControllerRef = canonicalizeControllerRefForKind(input);
|
|
6872
|
-
if (!canonicalControllerRef) return null;
|
|
6873
|
-
return input.controllerKind === "builtin" ? canonicalControllerRef : `${input.controllerKind}:${canonicalControllerRef}`;
|
|
6874
|
-
}
|
|
6875
|
-
function canonicalizeBuiltinControllerRef(controllerRef) {
|
|
6876
|
-
const builtinId = normalizeBuiltinControllerId(controllerRef);
|
|
6877
|
-
return builtinId ? `${BUILTIN_CONTROLLER_REF_PREFIX}${builtinId}` : null;
|
|
6878
|
-
}
|
|
6854
|
+
//#region ../../packages/schemas/dist/entry-brief-XbqkD9Xw.js
|
|
6879
6855
|
const AGENT_EXECUTION_READINESS_IMPACT_FRESH_TTL_MS = 1800 * 1e3;
|
|
6880
6856
|
const AGENT_EXECUTION_READINESS_IMPACT_REASON_CODES = [
|
|
6881
6857
|
"controller.launch.choice_required",
|
|
@@ -6889,7 +6865,7 @@ const AGENT_EXECUTION_READINESS_IMPACT_REASON_CODES = [
|
|
|
6889
6865
|
const AGENT_EXECUTION_READINESS_IMPACT_KINDS = ["local_execution"];
|
|
6890
6866
|
const AGENT_EXECUTION_READINESS_IMPACT_SOURCES = ["wake_failure"];
|
|
6891
6867
|
const AGENT_EXECUTION_READINESS_IMPACT_EFFECTS = ["current_readiness_blocker"];
|
|
6892
|
-
const AGENT_EXECUTION_READINESS_IMPACT_SCOPES = ["
|
|
6868
|
+
const AGENT_EXECUTION_READINESS_IMPACT_SCOPES = ["agent_profile_binding_agent_controller_report"];
|
|
6893
6869
|
const AGENT_EXECUTION_READINESS_IMPACT_CLEARING_TRIGGERS = ["fresh_ttl_expires", "matching_execution_success"];
|
|
6894
6870
|
const agentExecutionReadinessImpactReasonCodeSchema = _enum(AGENT_EXECUTION_READINESS_IMPACT_REASON_CODES);
|
|
6895
6871
|
const agentExecutionReadinessImpactKindSchema = _enum(AGENT_EXECUTION_READINESS_IMPACT_KINDS);
|
|
@@ -6901,9 +6877,9 @@ const boundedIdentifierSchema$5 = string().trim().min(1).max(256);
|
|
|
6901
6877
|
const reasonCodeSchema$3 = string().trim().min(1).max(256);
|
|
6902
6878
|
const prepareReadinessRouteParamsSchema = strictObject({ deviceId: boundedIdentifierSchema$5 });
|
|
6903
6879
|
const getPrepareReadinessQuerySchema = strictObject({
|
|
6904
|
-
|
|
6880
|
+
agentControllerRefs: array(string().trim().min(1).max(256)).optional(),
|
|
6905
6881
|
lane: boundedIdentifierSchema$5,
|
|
6906
|
-
|
|
6882
|
+
atsServiceRuntimeId: string().trim().min(1).max(512).optional()
|
|
6907
6883
|
});
|
|
6908
6884
|
const prepareReadinessRuntimeIdSchema = strictObject({
|
|
6909
6885
|
source: literal("runtime_registry_authority"),
|
|
@@ -6919,14 +6895,14 @@ const prepareReadinessDisplayStateSchema = _enum([
|
|
|
6919
6895
|
"unknown"
|
|
6920
6896
|
]);
|
|
6921
6897
|
const prepareReadinessRunnableCapabilitySchema = strictObject({
|
|
6922
|
-
|
|
6898
|
+
agentControllerRef: string().trim().min(1).max(256),
|
|
6923
6899
|
expiresAtMs: int().nonnegative(),
|
|
6924
6900
|
observedAtMs: int().nonnegative(),
|
|
6925
6901
|
reasonCodes: array(reasonCodeSchema$3),
|
|
6926
6902
|
status: literal("ready")
|
|
6927
6903
|
});
|
|
6928
6904
|
const prepareReadinessNonRunnableCapabilitySchema = strictObject({
|
|
6929
|
-
|
|
6905
|
+
agentControllerRef: string().trim().min(1).max(256),
|
|
6930
6906
|
expiresAtMs: int().nonnegative().optional(),
|
|
6931
6907
|
observedAtMs: int().nonnegative().optional(),
|
|
6932
6908
|
reasonCodes: array(reasonCodeSchema$3),
|
|
@@ -6964,37 +6940,36 @@ const prepareReadinessSummarySchema = strictObject({
|
|
|
6964
6940
|
reasonCodes: array(reasonCodeSchema$3)
|
|
6965
6941
|
});
|
|
6966
6942
|
const getPrepareReadinessResponseSchema = strictObject({
|
|
6967
|
-
|
|
6943
|
+
agentControllerReportsRead: boolean(),
|
|
6968
6944
|
nonRunnableCapabilities: array(prepareReadinessNonRunnableCapabilitySchema),
|
|
6969
6945
|
projection: prepareReadinessProjectionSchema,
|
|
6970
6946
|
reason: _enum([
|
|
6971
|
-
"
|
|
6972
|
-
"
|
|
6973
|
-
"
|
|
6947
|
+
"ats_service_runtime_identity_invalid",
|
|
6948
|
+
"ats_service_runtime_id_invalid",
|
|
6949
|
+
"ats_service_runtime_id_mismatch",
|
|
6974
6950
|
"runtime_lookup_conflict",
|
|
6975
6951
|
"runtime_missing",
|
|
6976
6952
|
"runtime_not_ready"
|
|
6977
6953
|
]).optional(),
|
|
6978
6954
|
runnableCapabilities: array(prepareReadinessRunnableCapabilitySchema),
|
|
6979
|
-
|
|
6955
|
+
atsServiceRuntimeId: prepareReadinessRuntimeIdSchema.optional(),
|
|
6980
6956
|
status: _enum(["not_ready", "ready"]),
|
|
6981
6957
|
summary: prepareReadinessSummarySchema
|
|
6982
6958
|
}).superRefine((value, context) => {
|
|
6983
|
-
if (value.status === "ready" && !value.
|
|
6959
|
+
if (value.status === "ready" && !value.atsServiceRuntimeId) context.addIssue({
|
|
6984
6960
|
code: "custom",
|
|
6985
|
-
message: "ready prepare readiness response requires authority
|
|
6986
|
-
path: ["
|
|
6961
|
+
message: "ready prepare readiness response requires authority atsServiceRuntimeId evidence",
|
|
6962
|
+
path: ["atsServiceRuntimeId"]
|
|
6987
6963
|
});
|
|
6988
6964
|
});
|
|
6989
6965
|
const ISO_DATE_TIME_SCHEMA$6 = datetime({ offset: true });
|
|
6990
6966
|
const trimmedNonEmptyStringSchema$7 = string().trim().min(1);
|
|
6991
6967
|
const nullableTrimmedStringSchema$6 = union([trimmedNonEmptyStringSchema$7, _null()]);
|
|
6992
6968
|
const nullableIsoDateTimeSchema$4 = union([ISO_DATE_TIME_SCHEMA$6, _null()]);
|
|
6993
|
-
const nullableControllerKindSchema$1 = union([_enum(["builtin", "custom"]), _null()]);
|
|
6994
6969
|
const agentExecutionReadinessRouteParamsSchema = strictObject({ agentProfileId: agentProfileIdSchema });
|
|
6995
6970
|
const agentExecutionReadinessTargetRuntimeSchema = discriminatedUnion("kind", [strictObject({ kind: literal("current_local_runtime") }), strictObject({
|
|
6996
|
-
kind: literal("
|
|
6997
|
-
|
|
6971
|
+
kind: literal("ats_service_runtime_id"),
|
|
6972
|
+
atsServiceRuntimeId: prepareReadinessRuntimeIdSchema
|
|
6998
6973
|
})]);
|
|
6999
6974
|
const getAgentExecutionReadinessBatchBodySchema = strictObject({
|
|
7000
6975
|
agentProfileIds: array(agentProfileIdSchema).min(1).max(100),
|
|
@@ -7021,8 +6996,7 @@ const agentExecutionReadinessPrimaryActionPlanSchema = discriminatedUnion("actio
|
|
|
7021
6996
|
strictObject({
|
|
7022
6997
|
action: literal("reconnect_binding"),
|
|
7023
6998
|
target: union([strictObject({ kind: literal("choose_local_agent") }), strictObject({
|
|
7024
|
-
|
|
7025
|
-
controllerRef: trimmedNonEmptyStringSchema$7,
|
|
6999
|
+
agentControllerRef: trimmedNonEmptyStringSchema$7,
|
|
7026
7000
|
kind: literal("local_agent_connection")
|
|
7027
7001
|
})])
|
|
7028
7002
|
}),
|
|
@@ -7138,8 +7112,7 @@ const agentExecutionReadinessSchema = strictObject({
|
|
|
7138
7112
|
const getAgentExecutionReadinessResponseSchema = strictObject({
|
|
7139
7113
|
agentExecutionReadiness: agentExecutionReadinessSchema,
|
|
7140
7114
|
agentProfileId: agentProfileIdSchema,
|
|
7141
|
-
|
|
7142
|
-
controllerRef: nullableTrimmedStringSchema$6,
|
|
7115
|
+
agentControllerRef: nullableTrimmedStringSchema$6,
|
|
7143
7116
|
daemonRouteObservation: daemonRouteObservationSummarySchema,
|
|
7144
7117
|
generatedAt: ISO_DATE_TIME_SCHEMA$6,
|
|
7145
7118
|
ownerUserId: nullableTrimmedStringSchema$6,
|
|
@@ -7155,10 +7128,8 @@ const MAX_SPACE_MEMBERS_BATCH_SIZE = 100;
|
|
|
7155
7128
|
const trimmedNonEmptyStringSchema$6 = string().trim().min(1);
|
|
7156
7129
|
const profileIdSchema = atsRuntimeProfileIdSchema;
|
|
7157
7130
|
const nullableTrimmedStringSchema$5 = union([trimmedNonEmptyStringSchema$6, _null()]);
|
|
7158
|
-
const nullableUpstreamConversationRefSchema = union([upstreamConversationRefSchema, _null()]);
|
|
7159
7131
|
const nullableRuntimeProfileIdSchema = union([profileIdSchema, _null()]);
|
|
7160
7132
|
const nullableIsoDateTimeSchema$3 = union([ISO_DATE_TIME_SCHEMA$5, _null()]);
|
|
7161
|
-
const nullableControllerKindSchema = union([_enum(["builtin", "custom"]), _null()]);
|
|
7162
7133
|
function validateRuntimeProfileIdForMemberKind(input) {
|
|
7163
7134
|
if ((input.profileKind === "human" ? uuidProfileIdSchema : agentProfileIdSchema).safeParse(input.profileId).success) return;
|
|
7164
7135
|
input.ctx.addIssue({
|
|
@@ -7176,16 +7147,20 @@ const spaceMemberSourceSchema = _enum([
|
|
|
7176
7147
|
"backfilled"
|
|
7177
7148
|
]);
|
|
7178
7149
|
const spaceMemberAgentExecutionReadinessSchema = agentExecutionReadinessSchema;
|
|
7179
|
-
const
|
|
7150
|
+
const spaceMemberAgentPublicPresenceSchema = strictObject({
|
|
7180
7151
|
label: nullableTrimmedStringSchema$5.optional(),
|
|
7181
7152
|
status: _enum([
|
|
7182
|
-
"
|
|
7183
|
-
"
|
|
7184
|
-
"
|
|
7185
|
-
"unknown"
|
|
7153
|
+
"available_for_wake",
|
|
7154
|
+
"checking_availability",
|
|
7155
|
+
"unavailable_for_wake"
|
|
7186
7156
|
])
|
|
7187
7157
|
});
|
|
7188
|
-
const
|
|
7158
|
+
const spaceMemberAgentViewerLocalRecoverySchema = strictObject({
|
|
7159
|
+
state: _enum([
|
|
7160
|
+
"none",
|
|
7161
|
+
"checking_local_connection",
|
|
7162
|
+
"action_required"
|
|
7163
|
+
]),
|
|
7189
7164
|
agentExecutionReadiness: spaceMemberAgentExecutionReadinessSchema,
|
|
7190
7165
|
daemonRouteObservation: daemonRouteObservationSummarySchema
|
|
7191
7166
|
});
|
|
@@ -7230,16 +7205,12 @@ const spaceMemberAgentSnapshotSchema = baseSpaceMemberSnapshotSchema.extend({
|
|
|
7230
7205
|
mentionAlias: nullableTrimmedStringSchema$5,
|
|
7231
7206
|
ownerUserId: nullableTrimmedStringSchema$5,
|
|
7232
7207
|
ownerName: nullableTrimmedStringSchema$5,
|
|
7233
|
-
|
|
7234
|
-
controllerRef: nullableTrimmedStringSchema$5,
|
|
7208
|
+
agentControllerRef: nullableTrimmedStringSchema$5,
|
|
7235
7209
|
runtimeDeviceDisplayName: nullableTrimmedStringSchema$5.optional(),
|
|
7236
|
-
|
|
7237
|
-
upstreamConversation: nullableUpstreamConversationRefSchema.optional(),
|
|
7210
|
+
agentControllerConversationId: nullableTrimmedStringSchema$5,
|
|
7238
7211
|
workingDirectory: profileWorkingDirectorySchema.nullable().optional(),
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
agentExecutionReadiness: spaceMemberAgentExecutionReadinessSchema.optional(),
|
|
7242
|
-
daemonRouteObservation: daemonRouteObservationSummarySchema.optional()
|
|
7212
|
+
publicPresence: spaceMemberAgentPublicPresenceSchema.optional(),
|
|
7213
|
+
viewerLocalRecovery: union([spaceMemberAgentViewerLocalRecoverySchema, _null()]).optional()
|
|
7243
7214
|
}).superRefine((value, ctx) => {
|
|
7244
7215
|
validateRuntimeProfileIdForMemberKind({
|
|
7245
7216
|
profileId: value.profileId,
|
|
@@ -7247,13 +7218,6 @@ const spaceMemberAgentSnapshotSchema = baseSpaceMemberSnapshotSchema.extend({
|
|
|
7247
7218
|
ctx,
|
|
7248
7219
|
path: ["profileId"]
|
|
7249
7220
|
});
|
|
7250
|
-
const hasViewerLocalControl = value.viewerLocalControl !== void 0 && value.viewerLocalControl !== null;
|
|
7251
|
-
const hasLegacyLocalControlFacts = value.agentExecutionReadiness !== void 0 || value.daemonRouteObservation !== void 0;
|
|
7252
|
-
if (!(hasViewerLocalControl || !hasLegacyLocalControlFacts)) ctx.addIssue({
|
|
7253
|
-
code: "custom",
|
|
7254
|
-
message: "agent local control facts require viewerLocalControl for owner-scoped member projections",
|
|
7255
|
-
path: ["viewerLocalControl"]
|
|
7256
|
-
});
|
|
7257
7221
|
});
|
|
7258
7222
|
const spaceMembersSummarySchema = strictObject({
|
|
7259
7223
|
totalCount: number().int().min(0),
|
|
@@ -7318,7 +7282,7 @@ const spaceMembersSnapshotSchema = strictObject({
|
|
|
7318
7282
|
});
|
|
7319
7283
|
});
|
|
7320
7284
|
function isWakeableAgent(item) {
|
|
7321
|
-
return item.
|
|
7285
|
+
return item.publicPresence?.status === "available_for_wake";
|
|
7322
7286
|
}
|
|
7323
7287
|
const spaceViewerMembershipProfileSchema = strictObject({
|
|
7324
7288
|
profileId: profileIdSchema,
|
|
@@ -7339,8 +7303,7 @@ const resolvedSpaceMemberProfileSchema = strictObject({
|
|
|
7339
7303
|
profileKind: spaceMemberKindSchema,
|
|
7340
7304
|
ownerUserId: nullableTrimmedStringSchema$5,
|
|
7341
7305
|
ownerName: nullableTrimmedStringSchema$5,
|
|
7342
|
-
|
|
7343
|
-
controllerRef: nullableTrimmedStringSchema$5
|
|
7306
|
+
agentControllerRef: nullableTrimmedStringSchema$5
|
|
7344
7307
|
}).superRefine((value, ctx) => {
|
|
7345
7308
|
validateRuntimeProfileIdForMemberKind({
|
|
7346
7309
|
profileId: value.profileId,
|
|
@@ -7421,120 +7384,6 @@ const errorResponseSchema = strictObject({
|
|
|
7421
7384
|
error: commonErrorSchema,
|
|
7422
7385
|
requestId: string().min(1).optional()
|
|
7423
7386
|
});
|
|
7424
|
-
const spaceRouteParamsSchema = strictObject({ spaceId: nonEmptyTrimmedStringFromUnknown });
|
|
7425
|
-
const isoDateTimeSchema$3 = datetime({ offset: true });
|
|
7426
|
-
const nullableNonEmptyStringSchema$2 = union([string().min(1), _null()]);
|
|
7427
|
-
const spaceConversationUpstreamConversationBindingMissingSchema = strictObject({
|
|
7428
|
-
status: literal("missing"),
|
|
7429
|
-
bindingSource: _null(),
|
|
7430
|
-
conversationRef: _null(),
|
|
7431
|
-
controllerRef: _null(),
|
|
7432
|
-
transportMode: _null()
|
|
7433
|
-
});
|
|
7434
|
-
const spaceConversationUpstreamConversationBindingPresentSchema = strictObject({
|
|
7435
|
-
status: literal("present"),
|
|
7436
|
-
bindingSource: conversationBindingSourceSchema,
|
|
7437
|
-
conversationRef: upstreamConversationRefSchema,
|
|
7438
|
-
controllerRef: string().min(1),
|
|
7439
|
-
transportMode: runtimeTransportModeSchema
|
|
7440
|
-
});
|
|
7441
|
-
const spaceConversationUpstreamConversationBindingSchema = discriminatedUnion("status", [spaceConversationUpstreamConversationBindingMissingSchema, spaceConversationUpstreamConversationBindingPresentSchema]);
|
|
7442
|
-
const spaceConversationLocalRuntimeContextStatusSchema = _enum([
|
|
7443
|
-
"missing",
|
|
7444
|
-
"mismatch",
|
|
7445
|
-
"ready"
|
|
7446
|
-
]);
|
|
7447
|
-
const spaceConversationLocalRuntimeContextSchema = strictObject({
|
|
7448
|
-
agentContextLookupKey: string().min(1),
|
|
7449
|
-
runtimeWorkspaceFingerprint: nullableNonEmptyStringSchema$2,
|
|
7450
|
-
status: spaceConversationLocalRuntimeContextStatusSchema
|
|
7451
|
-
});
|
|
7452
|
-
const spaceConversationLiveResumeCheckStatusSchema = _enum([
|
|
7453
|
-
"failed",
|
|
7454
|
-
"not_run",
|
|
7455
|
-
"passed",
|
|
7456
|
-
"skipped"
|
|
7457
|
-
]);
|
|
7458
|
-
const spaceConversationLiveResumeCheckSchema = strictObject({
|
|
7459
|
-
checkedAt: union([isoDateTimeSchema$3, _null()]),
|
|
7460
|
-
errorCode: nullableNonEmptyStringSchema$2,
|
|
7461
|
-
errorMessage: nullableNonEmptyStringSchema$2,
|
|
7462
|
-
errorType: nullableNonEmptyStringSchema$2,
|
|
7463
|
-
message: string().min(1),
|
|
7464
|
-
status: spaceConversationLiveResumeCheckStatusSchema
|
|
7465
|
-
});
|
|
7466
|
-
const spaceConversationRuntimeWorkspaceSchema = strictObject({
|
|
7467
|
-
configPath: string().min(1),
|
|
7468
|
-
configuredWorkspacePath: nullableNonEmptyStringSchema$2,
|
|
7469
|
-
fingerprint: nullableNonEmptyStringSchema$2,
|
|
7470
|
-
path: nullableNonEmptyStringSchema$2,
|
|
7471
|
-
reasonCode: nullableNonEmptyStringSchema$2,
|
|
7472
|
-
reasonText: nullableNonEmptyStringSchema$2,
|
|
7473
|
-
status: _enum([
|
|
7474
|
-
"ready",
|
|
7475
|
-
"missing",
|
|
7476
|
-
"invalid"
|
|
7477
|
-
]),
|
|
7478
|
-
workspaceMode: union([profileWorkspaceModeSchema, _null()])
|
|
7479
|
-
});
|
|
7480
|
-
const spaceConversationLatestRemoteObservationMissingSchema = strictObject({
|
|
7481
|
-
agentContextId: _null(),
|
|
7482
|
-
bootstrap: _null(),
|
|
7483
|
-
dispatchId: _null(),
|
|
7484
|
-
lastDispatchExecution: _null(),
|
|
7485
|
-
lastRuntimeWorkspaceFingerprint: _null(),
|
|
7486
|
-
lastRuntimeWorkspacePath: _null(),
|
|
7487
|
-
observedAt: _null(),
|
|
7488
|
-
status: literal("missing"),
|
|
7489
|
-
upstreamConversation: _null()
|
|
7490
|
-
});
|
|
7491
|
-
const spaceConversationLatestRemoteObservationObservedSchema = strictObject({
|
|
7492
|
-
agentContextId: nullableNonEmptyStringSchema$2,
|
|
7493
|
-
bootstrap: union([strictObject({
|
|
7494
|
-
reason: _null(),
|
|
7495
|
-
status: literal("applied")
|
|
7496
|
-
}), strictObject({
|
|
7497
|
-
reason: string().min(1),
|
|
7498
|
-
status: literal("pending")
|
|
7499
|
-
})]),
|
|
7500
|
-
dispatchId: string().min(1),
|
|
7501
|
-
lastDispatchExecution: dispatchExecutionSchema,
|
|
7502
|
-
lastRuntimeWorkspaceFingerprint: nullableNonEmptyStringSchema$2,
|
|
7503
|
-
lastRuntimeWorkspacePath: nullableNonEmptyStringSchema$2,
|
|
7504
|
-
observedAt: isoDateTimeSchema$3,
|
|
7505
|
-
status: literal("observed"),
|
|
7506
|
-
upstreamConversation: union([upstreamConversationRefSchema, _null()])
|
|
7507
|
-
});
|
|
7508
|
-
const spaceConversationLatestRemoteObservationSchema = discriminatedUnion("status", [spaceConversationLatestRemoteObservationMissingSchema, spaceConversationLatestRemoteObservationObservedSchema]);
|
|
7509
|
-
const spaceConversationWakeReadinessSchema = _enum([
|
|
7510
|
-
"blocked",
|
|
7511
|
-
"needs_validate",
|
|
7512
|
-
"ready"
|
|
7513
|
-
]);
|
|
7514
|
-
const getSpaceConversationStatusInputSchema = spaceRouteParamsSchema.extend({
|
|
7515
|
-
agentProfileId: agentProfileIdSchema,
|
|
7516
|
-
validate: boolean().optional()
|
|
7517
|
-
});
|
|
7518
|
-
const getSpaceConversationRemoteStatusInputSchema = spaceRouteParamsSchema.extend({ agentProfileId: agentProfileIdSchema });
|
|
7519
|
-
const getSpaceConversationStatusResponseSchema = strictObject({
|
|
7520
|
-
latestRemoteObservation: spaceConversationLatestRemoteObservationSchema,
|
|
7521
|
-
localRuntimeContext: spaceConversationLocalRuntimeContextSchema,
|
|
7522
|
-
liveResumeCheck: spaceConversationLiveResumeCheckSchema,
|
|
7523
|
-
nextDispatchPlan: nextDispatchPlanSchema.nullable(),
|
|
7524
|
-
profileId: agentProfileIdSchema,
|
|
7525
|
-
profileName: profileLabelSchema,
|
|
7526
|
-
runtimeWorkspace: spaceConversationRuntimeWorkspaceSchema,
|
|
7527
|
-
spaceId: nonEmptyTrimmedStringFromUnknown,
|
|
7528
|
-
upstreamConversationBinding: spaceConversationUpstreamConversationBindingSchema,
|
|
7529
|
-
validate: boolean(),
|
|
7530
|
-
wakeReadiness: spaceConversationWakeReadinessSchema
|
|
7531
|
-
});
|
|
7532
|
-
const getSpaceConversationRemoteStatusResponseSchema = strictObject({
|
|
7533
|
-
currentUpstreamConversationBinding: union([conversationBindingRecordSchema, _null()]),
|
|
7534
|
-
latestRemoteObservation: spaceConversationLatestRemoteObservationSchema,
|
|
7535
|
-
profileId: agentProfileIdSchema,
|
|
7536
|
-
spaceId: nonEmptyTrimmedStringFromUnknown
|
|
7537
|
-
});
|
|
7538
7387
|
const providerDispatchRuntimeContextSchema = strictObject({ providerRuntimeWorkingDirectory: string().trim().min(1).max(MAX_PROFILE_WORKING_DIRECTORY_LENGTH).refine((value) => !value.includes("\0"), { message: "providerRuntimeWorkingDirectory must not contain NUL bytes" }) });
|
|
7539
7388
|
const ATSD_CONTROL_PLANE_SCHEMA_VERSION = 1;
|
|
7540
7389
|
const atsdControlPlaneCommandSchema = _enum([
|
|
@@ -7543,8 +7392,6 @@ const atsdControlPlaneCommandSchema = _enum([
|
|
|
7543
7392
|
"history",
|
|
7544
7393
|
"interrupt",
|
|
7545
7394
|
"cancel",
|
|
7546
|
-
"bind_imported_upstream_conversation",
|
|
7547
|
-
"clear_imported_upstream_conversation_local_state",
|
|
7548
7395
|
"conversation_execution_status",
|
|
7549
7396
|
"sync_route_catalog",
|
|
7550
7397
|
"shutdown"
|
|
@@ -7579,40 +7426,23 @@ const atsdShutdownRequestPayloadSchema = strictObject({
|
|
|
7579
7426
|
mode: _enum(["graceful", "force"]).default("graceful"),
|
|
7580
7427
|
gracePeriodMs: number().int().nonnegative().default(5e3)
|
|
7581
7428
|
});
|
|
7582
|
-
const atsdConversationExecutionControllerKindSchema = _enum(["builtin", "custom"]);
|
|
7583
7429
|
const atsdConversationExecutionControllerLaunchStatusSchema = _enum([
|
|
7584
7430
|
"missing",
|
|
7585
7431
|
"disabled",
|
|
7586
7432
|
"repair_required",
|
|
7587
7433
|
"ready"
|
|
7588
7434
|
]);
|
|
7589
|
-
const
|
|
7435
|
+
const nullableAgentControllerRefSchema = union([string().min(1), _null()]);
|
|
7590
7436
|
const nullableNonEmptyStringSchema$1 = union([string().min(1), _null()]);
|
|
7591
7437
|
const atsdConversationExecutionStatusRequestPayloadSchema = strictObject({
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
controllerRef: string().min(1),
|
|
7438
|
+
boundAgentControllerRef: nullableAgentControllerRefSchema,
|
|
7439
|
+
agentControllerConversationId: nullableNonEmptyStringSchema$1,
|
|
7440
|
+
agentControllerRef: string().min(1),
|
|
7596
7441
|
spaceId: nonEmptyTrimmedStringFromUnknown,
|
|
7597
7442
|
targetProfileId: agentProfileIdSchema,
|
|
7598
7443
|
transportMode: runtimeTransportModeSchema,
|
|
7599
7444
|
validate: boolean()
|
|
7600
7445
|
});
|
|
7601
|
-
const atsdBindImportedUpstreamConversationRequestPayloadSchema = strictObject({
|
|
7602
|
-
controllerKind: atsdConversationExecutionControllerKindSchema,
|
|
7603
|
-
controllerRef: string().min(1),
|
|
7604
|
-
upstreamConversationRef: upstreamConversationRefSchema,
|
|
7605
|
-
spaceId: nonEmptyTrimmedStringFromUnknown,
|
|
7606
|
-
targetProfileId: agentProfileIdSchema,
|
|
7607
|
-
transportMode: runtimeTransportModeSchema
|
|
7608
|
-
});
|
|
7609
|
-
const atsdClearImportedUpstreamConversationLocalStateRequestPayloadSchema = strictObject({
|
|
7610
|
-
controllerKind: atsdConversationExecutionControllerKindSchema,
|
|
7611
|
-
controllerRef: string().min(1),
|
|
7612
|
-
spaceId: nonEmptyTrimmedStringFromUnknown,
|
|
7613
|
-
targetProfileId: agentProfileIdSchema,
|
|
7614
|
-
transportMode: runtimeTransportModeSchema
|
|
7615
|
-
});
|
|
7616
7446
|
const atsdSyncRouteCatalogRequestPayloadSchema = strictObject({ reason: string().min(1) });
|
|
7617
7447
|
const atsdConversationExecutionRuntimeWorkspaceReadySchema = strictObject({
|
|
7618
7448
|
configPath: string().min(1),
|
|
@@ -7652,6 +7482,25 @@ const atsdConversationExecutionRuntimeWorkspaceSchema = discriminatedUnion("stat
|
|
|
7652
7482
|
atsdConversationExecutionRuntimeWorkspaceMissingSchema,
|
|
7653
7483
|
atsdConversationExecutionRuntimeWorkspaceInvalidSchema
|
|
7654
7484
|
]);
|
|
7485
|
+
const atsdConversationExecutionLocalRuntimeContextStatusSchema = _enum([
|
|
7486
|
+
"missing",
|
|
7487
|
+
"mismatch",
|
|
7488
|
+
"ready"
|
|
7489
|
+
]);
|
|
7490
|
+
const atsdConversationExecutionLiveResumeCheckStatusSchema = _enum([
|
|
7491
|
+
"failed",
|
|
7492
|
+
"not_run",
|
|
7493
|
+
"passed",
|
|
7494
|
+
"skipped"
|
|
7495
|
+
]);
|
|
7496
|
+
const atsdConversationExecutionLiveResumeCheckSchema = strictObject({
|
|
7497
|
+
checkedAt: union([datetime({ offset: true }), _null()]),
|
|
7498
|
+
errorCode: nullableNonEmptyStringSchema$1,
|
|
7499
|
+
errorMessage: nullableNonEmptyStringSchema$1,
|
|
7500
|
+
errorType: nullableNonEmptyStringSchema$1,
|
|
7501
|
+
message: string().min(1),
|
|
7502
|
+
status: atsdConversationExecutionLiveResumeCheckStatusSchema
|
|
7503
|
+
});
|
|
7655
7504
|
const atsdConversationExecutionStatusPayloadSchema = strictObject({
|
|
7656
7505
|
agentContextLookupKey: string().min(1),
|
|
7657
7506
|
controllerLaunchStatus: atsdConversationExecutionControllerLaunchStatusSchema,
|
|
@@ -7659,16 +7508,11 @@ const atsdConversationExecutionStatusPayloadSchema = strictObject({
|
|
|
7659
7508
|
localRuntimeContext: strictObject({
|
|
7660
7509
|
agentContextLookupKey: string().min(1),
|
|
7661
7510
|
runtimeWorkspaceFingerprint: nullableNonEmptyStringSchema$1,
|
|
7662
|
-
status:
|
|
7511
|
+
status: atsdConversationExecutionLocalRuntimeContextStatusSchema
|
|
7663
7512
|
}),
|
|
7664
|
-
liveResumeCheck:
|
|
7513
|
+
liveResumeCheck: atsdConversationExecutionLiveResumeCheckSchema,
|
|
7665
7514
|
runtimeWorkspace: atsdConversationExecutionRuntimeWorkspaceSchema
|
|
7666
7515
|
});
|
|
7667
|
-
const atsdBindImportedUpstreamConversationPayloadSchema = strictObject({
|
|
7668
|
-
agentContextId: string().min(1),
|
|
7669
|
-
agentContextLookupKey: string().min(1)
|
|
7670
|
-
});
|
|
7671
|
-
const atsdClearImportedUpstreamConversationLocalStatePayloadSchema = strictObject({ removedLocalRuntimeContextsCount: number().int().min(0) });
|
|
7672
7516
|
const atsdSyncRouteCatalogStatusSchema = _enum([
|
|
7673
7517
|
"changed",
|
|
7674
7518
|
"registered",
|
|
@@ -7722,14 +7566,6 @@ const atsdControlPlaneRequestSchema = discriminatedUnion("command", [
|
|
|
7722
7566
|
command: literal("cancel"),
|
|
7723
7567
|
payload: atsdCancelRequestPayloadSchema
|
|
7724
7568
|
}),
|
|
7725
|
-
atsdControlPlaneRequestBaseSchema.extend({
|
|
7726
|
-
command: literal("bind_imported_upstream_conversation"),
|
|
7727
|
-
payload: atsdBindImportedUpstreamConversationRequestPayloadSchema
|
|
7728
|
-
}),
|
|
7729
|
-
atsdControlPlaneRequestBaseSchema.extend({
|
|
7730
|
-
command: literal("clear_imported_upstream_conversation_local_state"),
|
|
7731
|
-
payload: atsdClearImportedUpstreamConversationLocalStateRequestPayloadSchema
|
|
7732
|
-
}),
|
|
7733
7569
|
atsdControlPlaneRequestBaseSchema.extend({
|
|
7734
7570
|
command: literal("conversation_execution_status"),
|
|
7735
7571
|
payload: atsdConversationExecutionStatusRequestPayloadSchema
|
|
@@ -7818,14 +7654,6 @@ const atsdConversationExecutionStatusResponseSchema = atsdControlPlaneResponseBa
|
|
|
7818
7654
|
code: literal("service.conversation_execution_status"),
|
|
7819
7655
|
payload: atsdConversationExecutionStatusPayloadSchema
|
|
7820
7656
|
});
|
|
7821
|
-
const atsdBindImportedUpstreamConversationResponseSchema = atsdControlPlaneResponseBaseSchema.extend({
|
|
7822
|
-
code: literal("service.bind_imported_upstream_conversation"),
|
|
7823
|
-
payload: atsdBindImportedUpstreamConversationPayloadSchema
|
|
7824
|
-
});
|
|
7825
|
-
const atsdClearImportedUpstreamConversationLocalStateResponseSchema = atsdControlPlaneResponseBaseSchema.extend({
|
|
7826
|
-
code: literal("service.clear_imported_upstream_conversation_local_state"),
|
|
7827
|
-
payload: atsdClearImportedUpstreamConversationLocalStatePayloadSchema
|
|
7828
|
-
});
|
|
7829
7657
|
const atsdSyncRouteCatalogResponseSchema = atsdControlPlaneResponseBaseSchema.extend({
|
|
7830
7658
|
code: literal("service.sync_route_catalog"),
|
|
7831
7659
|
payload: atsdSyncRouteCatalogPayloadSchema
|
|
@@ -7844,8 +7672,6 @@ const atsdControlPlaneResponseSchema = discriminatedUnion("code", [
|
|
|
7844
7672
|
atsdHistoryResponseSchema,
|
|
7845
7673
|
atsdInterruptResponseSchema,
|
|
7846
7674
|
atsdCancelResponseSchema,
|
|
7847
|
-
atsdBindImportedUpstreamConversationResponseSchema,
|
|
7848
|
-
atsdClearImportedUpstreamConversationLocalStateResponseSchema,
|
|
7849
7675
|
atsdConversationExecutionStatusResponseSchema,
|
|
7850
7676
|
atsdSyncRouteCatalogResponseSchema,
|
|
7851
7677
|
atsdShutdownResponseSchema,
|
|
@@ -7869,7 +7695,7 @@ const resolvedAtsProfileSchema = strictObject({
|
|
|
7869
7695
|
ownerUserId: nonEmptyTextSchema,
|
|
7870
7696
|
profileHandle: profileHandleSchema.optional(),
|
|
7871
7697
|
ownerName: profileLabelSchema.optional(),
|
|
7872
|
-
|
|
7698
|
+
agentControllerRef: nonEmptyTextSchema.optional()
|
|
7873
7699
|
});
|
|
7874
7700
|
const atsActorContextSchema = strictObject({
|
|
7875
7701
|
requestId: nonEmptyTextSchema,
|
|
@@ -7880,7 +7706,7 @@ const atsActorContextSchema = strictObject({
|
|
|
7880
7706
|
profileName: profileLabelSchema.optional(),
|
|
7881
7707
|
ownerUserId: nonEmptyTextSchema.optional(),
|
|
7882
7708
|
ownerName: profileLabelSchema.optional(),
|
|
7883
|
-
|
|
7709
|
+
agentControllerRef: nonEmptyTextSchema.optional(),
|
|
7884
7710
|
dispatchChainId: nonEmptyTextSchema.optional(),
|
|
7885
7711
|
autoRelayDepth: number().int().nonnegative().optional(),
|
|
7886
7712
|
visitedProfileIds: visitedProfileIdsSchema.optional(),
|
|
@@ -7902,7 +7728,7 @@ const atsActorContextSchema = strictObject({
|
|
|
7902
7728
|
});
|
|
7903
7729
|
const atsRequestContextSchema = strictObject({
|
|
7904
7730
|
actorContext: atsActorContextSchema,
|
|
7905
|
-
|
|
7731
|
+
agentControllerConversationId: nonEmptyTextSchema.optional()
|
|
7906
7732
|
});
|
|
7907
7733
|
const REPLY_READINESS_LEVEL_VALUES = [
|
|
7908
7734
|
"blocked",
|
|
@@ -8208,10 +8034,11 @@ const agentProfileBindingRuntimeIdSchema = strictObject({
|
|
|
8208
8034
|
});
|
|
8209
8035
|
const agentProfileBindingWriteModeSchema = _enum(["ensure", "reconnect"]);
|
|
8210
8036
|
const ensureAgentProfilePrimaryBindingBodySchema = strictObject({
|
|
8211
|
-
|
|
8037
|
+
agentControllerRef: boundedIdentifierSchema$2,
|
|
8038
|
+
agentControllerConversationId: boundedIdentifierSchema$2.optional(),
|
|
8212
8039
|
deviceId: boundedIdentifierSchema$2,
|
|
8213
8040
|
lane: boundedIdentifierSchema$2,
|
|
8214
|
-
|
|
8041
|
+
atsServiceRuntimeId: agentProfileBindingRuntimeIdSchema,
|
|
8215
8042
|
writeMode: agentProfileBindingWriteModeSchema.optional()
|
|
8216
8043
|
});
|
|
8217
8044
|
const notifyAgentProfileRouteCatalogChangedBodySchema = strictObject({ reason: string().trim().min(1).max(100).optional() });
|
|
@@ -8236,9 +8063,10 @@ const agentProfileBindingAuthoritySourceSchema = _enum([
|
|
|
8236
8063
|
"none",
|
|
8237
8064
|
"blocked"
|
|
8238
8065
|
]);
|
|
8239
|
-
const
|
|
8240
|
-
|
|
8241
|
-
|
|
8066
|
+
const agentProfileBindingAgentControllerReportSchema = strictObject({
|
|
8067
|
+
agentControllerRef: boundedIdentifierSchema$2,
|
|
8068
|
+
agentControllerConversationId: boundedIdentifierSchema$2.optional(),
|
|
8069
|
+
atsServiceRuntimeId: agentProfileBindingRuntimeIdSchema
|
|
8242
8070
|
});
|
|
8243
8071
|
const agentProfileBindingDispatchEligibilitySchema = strictObject({
|
|
8244
8072
|
reasonCodes: array(reasonCodeSchema$2),
|
|
@@ -8255,7 +8083,7 @@ const agentProfileBindingProjectionSchema = strictObject({
|
|
|
8255
8083
|
reasonCodes: array(reasonCodeSchema$2),
|
|
8256
8084
|
resolutionSource: agentProfileBindingResolutionSourceSchema,
|
|
8257
8085
|
routable: boolean(),
|
|
8258
|
-
|
|
8086
|
+
executionTarget: agentProfileBindingAgentControllerReportSchema.nullable()
|
|
8259
8087
|
}).superRefine(validateAgentProfileBindingProjection);
|
|
8260
8088
|
const getAgentProfilePrimaryBindingResponseSchema = strictObject({
|
|
8261
8089
|
binding: agentProfileBindingProjectionSchema,
|
|
@@ -8394,10 +8222,10 @@ function rejectMissingProjectionEvidence(value, context) {
|
|
|
8394
8222
|
message: "missing Binding projection cannot include bindingId",
|
|
8395
8223
|
path: ["bindingId"]
|
|
8396
8224
|
});
|
|
8397
|
-
if (value.
|
|
8225
|
+
if (value.executionTarget) context.addIssue({
|
|
8398
8226
|
code: "custom",
|
|
8399
|
-
message: "missing Binding projection cannot include
|
|
8400
|
-
path: ["
|
|
8227
|
+
message: "missing Binding projection cannot include Agent Controller availability",
|
|
8228
|
+
path: ["executionTarget"]
|
|
8401
8229
|
});
|
|
8402
8230
|
if (value.routable) context.addIssue({
|
|
8403
8231
|
code: "custom",
|
|
@@ -8450,10 +8278,10 @@ function requireBindingTruthProjection(value, context) {
|
|
|
8450
8278
|
message: "Binding truth projection requires bindingId",
|
|
8451
8279
|
path: ["bindingId"]
|
|
8452
8280
|
});
|
|
8453
|
-
if (!value.
|
|
8281
|
+
if (!value.executionTarget) context.addIssue({
|
|
8454
8282
|
code: "custom",
|
|
8455
|
-
message: "Binding truth projection requires
|
|
8456
|
-
path: ["
|
|
8283
|
+
message: "Binding truth projection requires Agent Controller availability",
|
|
8284
|
+
path: ["executionTarget"]
|
|
8457
8285
|
});
|
|
8458
8286
|
}
|
|
8459
8287
|
function requireAcceptedBindingCommandProjection(binding, context) {
|
|
@@ -8477,10 +8305,10 @@ function requireAcceptedBindingCommandProjection(binding, context) {
|
|
|
8477
8305
|
message: "accepted Binding command response requires bindingId",
|
|
8478
8306
|
path: ["binding", "bindingId"]
|
|
8479
8307
|
});
|
|
8480
|
-
if (!binding.
|
|
8308
|
+
if (!binding.executionTarget) context.addIssue({
|
|
8481
8309
|
code: "custom",
|
|
8482
|
-
message: "accepted Binding command response requires
|
|
8483
|
-
path: ["binding", "
|
|
8310
|
+
message: "accepted Binding command response requires Agent Controller availability",
|
|
8311
|
+
path: ["binding", "executionTarget"]
|
|
8484
8312
|
});
|
|
8485
8313
|
if (!(binding.routable && binding.dispatchEligibility.routable)) context.addIssue({
|
|
8486
8314
|
code: "custom",
|
|
@@ -8556,8 +8384,8 @@ const claimExecutionDiagnosticsClaimLeaseSchema = strictObject({
|
|
|
8556
8384
|
sourceClientMessageId: nullableBoundedIdentifierSchema,
|
|
8557
8385
|
targetProfileId: boundedIdentifierSchema$1,
|
|
8558
8386
|
bindingId: boundedIdentifierSchema$1,
|
|
8559
|
-
|
|
8560
|
-
|
|
8387
|
+
atsServiceRuntimeId: boundedIdentifierSchema$1,
|
|
8388
|
+
agentControllerRef: boundedIdentifierSchema$1,
|
|
8561
8389
|
claimTraceReason: nullableBoundedIdentifierSchema,
|
|
8562
8390
|
status: literal("found")
|
|
8563
8391
|
});
|
|
@@ -8956,7 +8784,7 @@ const localRuntimeDeviceTypeSchema = _enum([
|
|
|
8956
8784
|
"unknown"
|
|
8957
8785
|
]);
|
|
8958
8786
|
const localRuntimeExecutionTargetCapabilitySchema = strictObject({
|
|
8959
|
-
|
|
8787
|
+
agentControllerRef: string().trim().min(1).max(256),
|
|
8960
8788
|
reasonCodes: array(reasonCodeSchema$1),
|
|
8961
8789
|
status: _enum([
|
|
8962
8790
|
"ready",
|
|
@@ -8980,7 +8808,7 @@ const localRuntimeExecutionTargetSchema = strictObject({
|
|
|
8980
8808
|
"ats-dev",
|
|
8981
8809
|
"ats-canary"
|
|
8982
8810
|
]),
|
|
8983
|
-
|
|
8811
|
+
atsServiceRuntimeId: prepareReadinessRuntimeIdSchema.nullable(),
|
|
8984
8812
|
status: localRuntimeExecutionTargetStatusSchema,
|
|
8985
8813
|
capabilities: array(localRuntimeExecutionTargetCapabilitySchema),
|
|
8986
8814
|
localAgentCatalog: localAgentCatalogSchema,
|
|
@@ -9035,9 +8863,9 @@ const localRuntimeReplyReadinessStatusSchema = _enum([
|
|
|
9035
8863
|
const localRuntimeReplyReadinessPrimaryBlockerSchema = _enum([
|
|
9036
8864
|
"none",
|
|
9037
8865
|
"current_runtime_missing",
|
|
9038
|
-
"
|
|
9039
|
-
"
|
|
9040
|
-
"
|
|
8866
|
+
"agent_controller_report_not_ready",
|
|
8867
|
+
"agent_controller_report_stale",
|
|
8868
|
+
"agent_controller_report_unknown",
|
|
9041
8869
|
"service_not_connected",
|
|
9042
8870
|
"service_update_required",
|
|
9043
8871
|
"service_unavailable"
|
|
@@ -9068,7 +8896,7 @@ const currentLocalRuntimeReplyReadinessResponseSchema = strictObject({
|
|
|
9068
8896
|
executionTargetStatus: localRuntimeExecutionTargetStatusSchema.nullable(),
|
|
9069
8897
|
lastObservedAtMs: number().int().nonnegative().nullable(),
|
|
9070
8898
|
reasonCodes: array(reasonCodeSchema$1),
|
|
9071
|
-
|
|
8899
|
+
atsServiceRuntimeId: prepareReadinessRuntimeIdSchema.nullable(),
|
|
9072
8900
|
runtimeLane: daemonServiceLaneSchema.nullable()
|
|
9073
8901
|
}),
|
|
9074
8902
|
service: strictObject({
|
|
@@ -9389,8 +9217,8 @@ const observabilityWakeCorrelationSchema = strictObject({
|
|
|
9389
9217
|
latestAttemptId: nullableObservabilityIdentifierSchema$1,
|
|
9390
9218
|
claimLeaseId: nullableObservabilityIdentifierSchema$1,
|
|
9391
9219
|
bindingId: nullableObservabilityIdentifierSchema$1,
|
|
9392
|
-
|
|
9393
|
-
|
|
9220
|
+
atsServiceRuntimeId: nullableObservabilityIdentifierSchema$1,
|
|
9221
|
+
agentControllerRef: nullableObservabilityIdentifierSchema$1,
|
|
9394
9222
|
resultRef: nullableObservabilityIdentifierSchema$1,
|
|
9395
9223
|
publishedSignalId: nullableObservabilityIdentifierSchema$1,
|
|
9396
9224
|
replySignalId: nullableObservabilityIdentifierSchema$1,
|
|
@@ -9437,8 +9265,8 @@ function buildObservabilityWakeCorrelation(input) {
|
|
|
9437
9265
|
latestAttemptId: normalizeOptionalObservabilityId$1(input.latestAttemptId),
|
|
9438
9266
|
claimLeaseId: normalizeOptionalObservabilityId$1(input.claimLeaseId),
|
|
9439
9267
|
bindingId: normalizeOptionalObservabilityId$1(input.bindingId),
|
|
9440
|
-
|
|
9441
|
-
|
|
9268
|
+
atsServiceRuntimeId: normalizeOptionalObservabilityId$1(input.atsServiceRuntimeId),
|
|
9269
|
+
agentControllerRef: normalizeOptionalObservabilityId$1(input.agentControllerRef),
|
|
9442
9270
|
resultRef: normalizeOptionalObservabilityId$1(input.resultRef),
|
|
9443
9271
|
publishedSignalId: normalizeOptionalObservabilityId$1(input.publishedSignalId),
|
|
9444
9272
|
replySignalId: normalizeOptionalObservabilityId$1(input.replySignalId),
|
|
@@ -9471,8 +9299,8 @@ function projectObservabilityWakeCorrelation(input) {
|
|
|
9471
9299
|
runtimeCoordinatorExecutionId: consistentObservabilityId(coordinatorExecution?.runtimeCoordinatorExecutionId, input.runtimeCoordinatorExecutionId),
|
|
9472
9300
|
claimLeaseId: consistentObservabilityId(claimLease?.claimLeaseId, input.claimLeaseId, getSelectorClaimLeaseId(selector)),
|
|
9473
9301
|
bindingId: consistentObservabilityId(coordinatorExecution?.bindingId, claimLease?.bindingId, input.bindingId),
|
|
9474
|
-
|
|
9475
|
-
|
|
9302
|
+
atsServiceRuntimeId: consistentObservabilityId(coordinatorExecution?.atsServiceRuntimeId, claimLease?.atsServiceRuntimeId, input.atsServiceRuntimeId),
|
|
9303
|
+
agentControllerRef: consistentObservabilityId(coordinatorExecution?.agentControllerRef, claimLease?.agentControllerRef, input.agentControllerRef),
|
|
9476
9304
|
resultRef: consistentObservabilityId(result?.resultRef, input.resultRef),
|
|
9477
9305
|
publishedSignalId: consistentObservabilityId(result?.publishedSignalId, input.publishedSignalId),
|
|
9478
9306
|
replySignalId: consistentObservabilityId(replySignal?.signalId, input.replySignalId),
|
|
@@ -9584,8 +9412,8 @@ const OBSERVABILITY_CLOUDFLARE_ANALYTICS_BLOBS = [
|
|
|
9584
9412
|
"latestAttemptId",
|
|
9585
9413
|
"claimLeaseId",
|
|
9586
9414
|
"bindingId",
|
|
9587
|
-
"
|
|
9588
|
-
"
|
|
9415
|
+
"atsServiceRuntimeId",
|
|
9416
|
+
"agentControllerRef",
|
|
9589
9417
|
"resultRef",
|
|
9590
9418
|
"publishedSignalId",
|
|
9591
9419
|
"replySignalId",
|
|
@@ -9650,8 +9478,8 @@ const observabilityCloudflareRuntimeEventSchema = strictObject({
|
|
|
9650
9478
|
latestAttemptId: nullableObservabilityIdentifierSchema,
|
|
9651
9479
|
claimLeaseId: nullableObservabilityIdentifierSchema,
|
|
9652
9480
|
bindingId: nullableObservabilityIdentifierSchema,
|
|
9653
|
-
|
|
9654
|
-
|
|
9481
|
+
atsServiceRuntimeId: nullableObservabilityIdentifierSchema,
|
|
9482
|
+
agentControllerRef: nullableObservabilityIdentifierSchema,
|
|
9655
9483
|
resultRef: nullableObservabilityIdentifierSchema,
|
|
9656
9484
|
publishedSignalId: nullableObservabilityIdentifierSchema,
|
|
9657
9485
|
replySignalId: nullableObservabilityIdentifierSchema
|
|
@@ -9850,25 +9678,25 @@ const runtimeRegistrationRejectedReasonSchema = _enum([
|
|
|
9850
9678
|
"owner_authorization_unknown",
|
|
9851
9679
|
"owner_authorization_unavailable",
|
|
9852
9680
|
"owner_kind_unsupported",
|
|
9853
|
-
"
|
|
9854
|
-
"
|
|
9855
|
-
"
|
|
9681
|
+
"ats_service_runtime_id_collision",
|
|
9682
|
+
"ats_service_runtime_id_invalid",
|
|
9683
|
+
"ats_service_runtime_id_not_opaque",
|
|
9856
9684
|
"runtime_record_missing_after_conflict",
|
|
9857
9685
|
"unknown"
|
|
9858
9686
|
]);
|
|
9859
9687
|
const submitRuntimeRegistrationResponseSchema = strictObject({
|
|
9860
9688
|
reason: runtimeRegistrationRejectedReasonSchema.optional(),
|
|
9861
|
-
|
|
9689
|
+
atsServiceRuntimeId: runtimeReportingRuntimeIdSchema.optional(),
|
|
9862
9690
|
status: _enum([
|
|
9863
9691
|
"created",
|
|
9864
9692
|
"reused",
|
|
9865
9693
|
"rejected"
|
|
9866
9694
|
])
|
|
9867
9695
|
}).superRefine((value, context) => {
|
|
9868
|
-
if (value.status !== "rejected" && !value.
|
|
9696
|
+
if (value.status !== "rejected" && !value.atsServiceRuntimeId) context.addIssue({
|
|
9869
9697
|
code: "custom",
|
|
9870
|
-
message: "registered Runtime response requires authority
|
|
9871
|
-
path: ["
|
|
9698
|
+
message: "registered Runtime response requires authority atsServiceRuntimeId",
|
|
9699
|
+
path: ["atsServiceRuntimeId"]
|
|
9872
9700
|
});
|
|
9873
9701
|
if (value.status === "rejected" && !value.reason) context.addIssue({
|
|
9874
9702
|
code: "custom",
|
|
@@ -9876,71 +9704,71 @@ const submitRuntimeRegistrationResponseSchema = strictObject({
|
|
|
9876
9704
|
path: ["reason"]
|
|
9877
9705
|
});
|
|
9878
9706
|
});
|
|
9879
|
-
const
|
|
9707
|
+
const runtimeAgentControllerReportStatusSchema = _enum([
|
|
9880
9708
|
"ready",
|
|
9881
9709
|
"disabled",
|
|
9882
9710
|
"unavailable",
|
|
9883
9711
|
"unknown"
|
|
9884
9712
|
]);
|
|
9885
|
-
const
|
|
9886
|
-
|
|
9713
|
+
const submitRuntimeAgentControllerReportItemSchema = strictObject({
|
|
9714
|
+
agentControllerRef: boundedIdentifierSchema,
|
|
9887
9715
|
expiresAtMs: int().positive(),
|
|
9888
9716
|
observedAtMs: int().positive(),
|
|
9889
9717
|
reasonCodes: array(reasonCodeSchema).optional(),
|
|
9890
|
-
status:
|
|
9718
|
+
status: runtimeAgentControllerReportStatusSchema
|
|
9891
9719
|
});
|
|
9892
|
-
const
|
|
9720
|
+
const submitRuntimeAgentControllerReportsBodySchema = strictObject({
|
|
9893
9721
|
lane: boundedIdentifierSchema,
|
|
9894
|
-
reports: array(
|
|
9895
|
-
|
|
9722
|
+
reports: array(submitRuntimeAgentControllerReportItemSchema).min(1).max(64),
|
|
9723
|
+
atsServiceRuntimeId: runtimeReportingRuntimeIdSchema
|
|
9896
9724
|
});
|
|
9897
|
-
const
|
|
9898
|
-
"
|
|
9725
|
+
const runtimeAgentControllerReportRejectedReasonSchema = _enum([
|
|
9726
|
+
"agent_controller_ref_invalid",
|
|
9899
9727
|
"conflict",
|
|
9900
9728
|
"out_of_order",
|
|
9901
9729
|
"report_status_invalid",
|
|
9902
9730
|
"report_time_invalid",
|
|
9903
|
-
"
|
|
9904
|
-
"
|
|
9905
|
-
"
|
|
9731
|
+
"ats_service_runtime_id_invalid",
|
|
9732
|
+
"ats_service_runtime_id_mismatch",
|
|
9733
|
+
"ats_service_runtime_identity_invalid",
|
|
9906
9734
|
"runtime_lookup_conflict",
|
|
9907
9735
|
"runtime_missing",
|
|
9908
9736
|
"stale"
|
|
9909
9737
|
]);
|
|
9910
|
-
const
|
|
9911
|
-
|
|
9738
|
+
const submitRuntimeAgentControllerReportResultSchema = strictObject({
|
|
9739
|
+
agentControllerRef: boundedIdentifierSchema,
|
|
9912
9740
|
outcome: _enum([
|
|
9913
9741
|
"created",
|
|
9914
9742
|
"updated",
|
|
9915
9743
|
"reused"
|
|
9916
9744
|
]).optional(),
|
|
9917
|
-
reason:
|
|
9745
|
+
reason: runtimeAgentControllerReportRejectedReasonSchema.optional(),
|
|
9918
9746
|
status: _enum(["accepted", "rejected"])
|
|
9919
9747
|
}).superRefine((value, context) => {
|
|
9920
9748
|
if (value.status === "accepted" && !value.outcome) context.addIssue({
|
|
9921
9749
|
code: "custom",
|
|
9922
|
-
message: "accepted Runtime
|
|
9750
|
+
message: "accepted Runtime Agent Controller Report requires an outcome",
|
|
9923
9751
|
path: ["outcome"]
|
|
9924
9752
|
});
|
|
9925
9753
|
if (value.status === "rejected" && !value.reason) context.addIssue({
|
|
9926
9754
|
code: "custom",
|
|
9927
|
-
message: "rejected Runtime
|
|
9755
|
+
message: "rejected Runtime Agent Controller Report requires a reason",
|
|
9928
9756
|
path: ["reason"]
|
|
9929
9757
|
});
|
|
9930
9758
|
});
|
|
9931
|
-
const
|
|
9932
|
-
reports: array(
|
|
9933
|
-
|
|
9759
|
+
const submitRuntimeAgentControllerReportsResponseSchema = strictObject({
|
|
9760
|
+
reports: array(submitRuntimeAgentControllerReportResultSchema),
|
|
9761
|
+
atsServiceRuntimeId: runtimeReportingRuntimeIdSchema.optional(),
|
|
9934
9762
|
status: _enum([
|
|
9935
9763
|
"accepted",
|
|
9936
9764
|
"partial",
|
|
9937
9765
|
"rejected"
|
|
9938
9766
|
])
|
|
9939
9767
|
}).superRefine((value, context) => {
|
|
9940
|
-
if (value.status !== "rejected" && !value.
|
|
9768
|
+
if (value.status !== "rejected" && !value.atsServiceRuntimeId) context.addIssue({
|
|
9941
9769
|
code: "custom",
|
|
9942
|
-
message: "accepted Runtime
|
|
9943
|
-
path: ["
|
|
9770
|
+
message: "accepted Runtime Agent Controller Report response requires authority atsServiceRuntimeId",
|
|
9771
|
+
path: ["atsServiceRuntimeId"]
|
|
9944
9772
|
});
|
|
9945
9773
|
});
|
|
9946
9774
|
const patchSpaceContractBodySchema = spaceContractFieldsSchema.pick({
|
|
@@ -9959,25 +9787,6 @@ const patchSpaceContractBodySchema = spaceContractFieldsSchema.pick({
|
|
|
9959
9787
|
});
|
|
9960
9788
|
const getSpaceContractResponseSchema = spaceContractSchema;
|
|
9961
9789
|
const patchSpaceContractResponseSchema = spaceContractSchema;
|
|
9962
|
-
const spaceConversationBindingResponseSchema = strictObject({ binding: conversationBindingRecordSchema.nullable() });
|
|
9963
|
-
const spaceConversationBindingImportBodySchema = strictObject({
|
|
9964
|
-
bootstrapTemplateFacts: bootstrapTemplateFactsSchema,
|
|
9965
|
-
controllerRef: string().min(1),
|
|
9966
|
-
conversationRef: upstreamConversationRefSchema,
|
|
9967
|
-
force: boolean().optional(),
|
|
9968
|
-
policy: conversationPolicySchema,
|
|
9969
|
-
transportMode: runtimeTransportModeSchema
|
|
9970
|
-
});
|
|
9971
|
-
const spaceConversationBindingImportResponseSchema = strictObject({
|
|
9972
|
-
binding: conversationBindingRecordSchema,
|
|
9973
|
-
replacedExisting: boolean()
|
|
9974
|
-
});
|
|
9975
|
-
const spaceConversationBindingConflictResponseSchema = strictObject({
|
|
9976
|
-
currentBinding: conversationBindingRecordSchema.nullable(),
|
|
9977
|
-
error: commonErrorSchema
|
|
9978
|
-
});
|
|
9979
|
-
const spaceConversationBindingUpsertResponseSchema = strictObject({ binding: conversationBindingRecordSchema });
|
|
9980
|
-
const spaceConversationBindingDeleteResponseSchema = strictObject({ removed: boolean() });
|
|
9981
9790
|
const createSpaceBodySchema = strictObject({
|
|
9982
9791
|
name: unknown().optional(),
|
|
9983
9792
|
purpose: unknown().optional(),
|
|
@@ -10496,8 +10305,8 @@ const spaceDispatchTraceClaimLeaseSchema = strictObject({
|
|
|
10496
10305
|
sourceClientMessageId: nullableTrimmedStringSchema$1,
|
|
10497
10306
|
targetProfileId: trimmedNonEmptyStringSchema,
|
|
10498
10307
|
bindingId: trimmedNonEmptyStringSchema,
|
|
10499
|
-
|
|
10500
|
-
|
|
10308
|
+
atsServiceRuntimeId: trimmedNonEmptyStringSchema,
|
|
10309
|
+
agentControllerRef: trimmedNonEmptyStringSchema,
|
|
10501
10310
|
leaseState: _enum([
|
|
10502
10311
|
"active",
|
|
10503
10312
|
"cancelled",
|
|
@@ -10582,10 +10391,10 @@ const spaceDispatchTraceExecutionSchema = strictObject({
|
|
|
10582
10391
|
})
|
|
10583
10392
|
});
|
|
10584
10393
|
const spaceDispatchTraceOriginSchema = strictObject({
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10394
|
+
agentControllerConversationId: nullableTrimmedStringSchema$1,
|
|
10395
|
+
agentControllerRef: nullableTrimmedStringSchema$1,
|
|
10396
|
+
agentControllerConversationKind: nullableTrimmedStringSchema$1,
|
|
10397
|
+
resolvedAgentControllerConversationId: nullableTrimmedStringSchema$1,
|
|
10589
10398
|
effectiveRuntimeWorkingDirectory: nullableTrimmedStringSchema$1,
|
|
10590
10399
|
runtimeWorkspaceFingerprint: nullableTrimmedStringSchema$1
|
|
10591
10400
|
});
|
|
@@ -10776,8 +10585,8 @@ const spaceDispatchTraceResponseSchema = strictObject({
|
|
|
10776
10585
|
expectNullTraceEvidence(context, value.correlation.runtimeCoordinatorExecutionId, ["correlation", "runtimeCoordinatorExecutionId"]);
|
|
10777
10586
|
expectNullTraceEvidence(context, value.correlation.claimLeaseId, ["correlation", "claimLeaseId"]);
|
|
10778
10587
|
expectNullTraceEvidence(context, value.correlation.bindingId, ["correlation", "bindingId"]);
|
|
10779
|
-
expectNullTraceEvidence(context, value.correlation.
|
|
10780
|
-
expectNullTraceEvidence(context, value.correlation.
|
|
10588
|
+
expectNullTraceEvidence(context, value.correlation.atsServiceRuntimeId, ["correlation", "atsServiceRuntimeId"]);
|
|
10589
|
+
expectNullTraceEvidence(context, value.correlation.agentControllerRef, ["correlation", "agentControllerRef"]);
|
|
10781
10590
|
expectNullTraceEvidence(context, value.correlation.resultRef, ["correlation", "resultRef"]);
|
|
10782
10591
|
expectNullTraceEvidence(context, value.correlation.publishedSignalId, ["correlation", "publishedSignalId"]);
|
|
10783
10592
|
expectNullTraceEvidence(context, value.correlation.replySignalId, ["correlation", "replySignalId"]);
|
|
@@ -10795,8 +10604,8 @@ const spaceDispatchTraceResponseSchema = strictObject({
|
|
|
10795
10604
|
expectTraceEvidence(context, value.correlation.runtimeCoordinatorExecutionId, value.trace.runtimeCoordinatorExecution?.runtimeCoordinatorExecutionId ?? null, ["correlation", "runtimeCoordinatorExecutionId"], "correlation.runtimeCoordinatorExecutionId must match trace.runtimeCoordinatorExecution.runtimeCoordinatorExecutionId");
|
|
10796
10605
|
expectTraceEvidence(context, value.correlation.claimLeaseId, value.trace.claimLease?.claimLeaseId ?? null, ["correlation", "claimLeaseId"], "correlation.claimLeaseId must match trace.claimLease.claimLeaseId");
|
|
10797
10606
|
expectTraceEvidence(context, value.correlation.bindingId, value.trace.runtimeCoordinatorExecution?.bindingId ?? value.trace.executionIdentity?.core.bindingId ?? value.trace.claimLease?.bindingId ?? null, ["correlation", "bindingId"], "correlation.bindingId must match trace execution identity evidence");
|
|
10798
|
-
expectTraceEvidence(context, value.correlation.
|
|
10799
|
-
expectTraceEvidence(context, value.correlation.
|
|
10607
|
+
expectTraceEvidence(context, value.correlation.atsServiceRuntimeId, value.trace.runtimeCoordinatorExecution?.atsServiceRuntimeId.value ?? value.trace.executionIdentity?.core.atsServiceRuntimeId.value ?? value.trace.claimLease?.atsServiceRuntimeId ?? null, ["correlation", "atsServiceRuntimeId"], "correlation.atsServiceRuntimeId must match trace execution identity evidence");
|
|
10608
|
+
expectTraceEvidence(context, value.correlation.agentControllerRef, value.trace.runtimeCoordinatorExecution?.agentControllerRef ?? value.trace.executionIdentity?.core.agentControllerRef ?? value.trace.claimLease?.agentControllerRef ?? null, ["correlation", "agentControllerRef"], "correlation.agentControllerRef must match trace execution identity evidence");
|
|
10800
10609
|
expectTraceEvidence(context, value.correlation.resultRef, value.trace.result?.resultRef ?? null, ["correlation", "resultRef"], "correlation.resultRef must match trace.result.resultRef");
|
|
10801
10610
|
expectTraceEvidence(context, value.correlation.publishedSignalId, value.trace.result?.publishedSignalId ?? null, ["correlation", "publishedSignalId"], "correlation.publishedSignalId must match trace.result.publishedSignalId");
|
|
10802
10611
|
expectTraceEvidence(context, value.correlation.replySignalId, value.trace.replySignal?.signalId ?? null, ["correlation", "replySignalId"], "correlation.replySignalId must match trace.replySignal.signalId");
|
|
@@ -11461,7 +11270,7 @@ const dispatchResultSchema = strictObject({
|
|
|
11461
11270
|
statusType: spaceStatusSchema.optional(),
|
|
11462
11271
|
previewText: preprocess(trimmedStringFromUnknown, string().min(1)).optional(),
|
|
11463
11272
|
publicOutcome: dispatchResultPublicOutcomeSchema,
|
|
11464
|
-
|
|
11273
|
+
agentControllerConversation: agentControllerConversationRefSchema.optional(),
|
|
11465
11274
|
runtimeWorkspace: dispatchResultRuntimeWorkspaceSchema.optional(),
|
|
11466
11275
|
dispatchExecution: dispatchExecutionSchema.optional(),
|
|
11467
11276
|
publishedSignalId: preprocess(trimmedStringFromUnknown, string().min(1)).optional(),
|
|
@@ -11509,6 +11318,7 @@ const getSpaceDispatchResultInputSchema = strictObject({
|
|
|
11509
11318
|
});
|
|
11510
11319
|
});
|
|
11511
11320
|
const getSpaceDispatchResultResponseSchema = dispatchResultSchema;
|
|
11321
|
+
const spaceRouteParamsSchema = strictObject({ spaceId: nonEmptyTrimmedStringFromUnknown });
|
|
11512
11322
|
const helloSchema = object({
|
|
11513
11323
|
type: literal("hello"),
|
|
11514
11324
|
profile: profileSchema
|
|
@@ -11791,8 +11601,8 @@ const wakeTraceWaterfallStepIdsSchema = strictObject({
|
|
|
11791
11601
|
attemptId: nullableTrimmedIdentifierSchema,
|
|
11792
11602
|
claimLeaseId: nullableTrimmedIdentifierSchema,
|
|
11793
11603
|
bindingId: nullableTrimmedIdentifierSchema,
|
|
11794
|
-
|
|
11795
|
-
|
|
11604
|
+
atsServiceRuntimeId: nullableTrimmedIdentifierSchema,
|
|
11605
|
+
agentControllerRef: nullableTrimmedIdentifierSchema,
|
|
11796
11606
|
resultKey: nullableTrimmedIdentifierSchema,
|
|
11797
11607
|
resultRef: nullableTrimmedIdentifierSchema,
|
|
11798
11608
|
publishedSignalId: nullableTrimmedIdentifierSchema,
|
|
@@ -12845,9 +12655,9 @@ const BUILTIN_AGENT_CONTROLLER_BRANDS = {
|
|
|
12845
12655
|
function isBuiltinAgentControllerBrandId(value) {
|
|
12846
12656
|
return value in BUILTIN_AGENT_CONTROLLER_BRANDS;
|
|
12847
12657
|
}
|
|
12848
|
-
function resolveBuiltinAgentControllerBrand(
|
|
12849
|
-
if (!
|
|
12850
|
-
const controllerId =
|
|
12658
|
+
function resolveBuiltinAgentControllerBrand(agentControllerRef) {
|
|
12659
|
+
if (!agentControllerRef) return null;
|
|
12660
|
+
const controllerId = normalizeKnownBuiltinAgentControllerId(agentControllerRef);
|
|
12851
12661
|
if (!(controllerId && isBuiltinAgentControllerBrandId(controllerId))) return null;
|
|
12852
12662
|
return BUILTIN_AGENT_CONTROLLER_BRANDS[controllerId];
|
|
12853
12663
|
}
|
|
@@ -12921,17 +12731,17 @@ const PUBLIC_FAILURE_RECOVERY_BY_CODE = [
|
|
|
12921
12731
|
kind: "local_agent_prepare",
|
|
12922
12732
|
patterns: [
|
|
12923
12733
|
"claim_eligibility.binding_runtime_mismatch",
|
|
12924
|
-
"claim_eligibility.
|
|
12925
|
-
"claim_eligibility.
|
|
12926
|
-
"claim_eligibility.
|
|
12927
|
-
"claim_eligibility.
|
|
12734
|
+
"claim_eligibility.ats_service_runtime_id_missing",
|
|
12735
|
+
"claim_eligibility.ats_service_runtime_id_mismatch",
|
|
12736
|
+
"claim_eligibility.ats_service_runtime_id_not_opaque",
|
|
12737
|
+
"claim_eligibility.ats_service_runtime_identity_invalid",
|
|
12928
12738
|
"claim_eligibility.runtime_missing",
|
|
12929
12739
|
"claim_eligibility.runtime_unavailable",
|
|
12930
|
-
"claim_eligibility.
|
|
12931
|
-
"claim_eligibility.
|
|
12932
|
-
"claim_eligibility.
|
|
12933
|
-
"claim_eligibility.
|
|
12934
|
-
"claim_eligibility.
|
|
12740
|
+
"claim_eligibility.agent_controller_report_unknown",
|
|
12741
|
+
"claim_eligibility.agent_controller_report_missing",
|
|
12742
|
+
"claim_eligibility.agent_controller_report_stale",
|
|
12743
|
+
"claim_eligibility.agent_controller_report_disabled",
|
|
12744
|
+
"claim_eligibility.agent_controller_report_unavailable"
|
|
12935
12745
|
],
|
|
12936
12746
|
primaryActionId: "connect_local_agent",
|
|
12937
12747
|
recoveryTarget: "prepare_setup"
|
|
@@ -13083,8 +12893,8 @@ const PUBLIC_FAILURE_RECOVERY_BY_CODE = [
|
|
|
13083
12893
|
patterns: [
|
|
13084
12894
|
"ats.space_action.repair_failed",
|
|
13085
12895
|
"runtime.reply.empty_output",
|
|
13086
|
-
"runtime.reply.metadata_missing.
|
|
13087
|
-
"runtime.reply.metadata_missing.
|
|
12896
|
+
"runtime.reply.metadata_missing.agent_controller_conversation_id",
|
|
12897
|
+
"runtime.reply.metadata_missing.agent_controller_ref"
|
|
13088
12898
|
],
|
|
13089
12899
|
primaryActionId: "connect_local_agent",
|
|
13090
12900
|
recoveryTarget: "prepare_setup"
|
|
@@ -13204,77 +13014,77 @@ function resolvePublicAgentFailureBody(body, targetName) {
|
|
|
13204
13014
|
|
|
13205
13015
|
//#endregion
|
|
13206
13016
|
//#region src/config/session-profile.ts
|
|
13207
|
-
const
|
|
13208
|
-
const
|
|
13209
|
-
const
|
|
13017
|
+
const ATS_CLI_CONTEXT_ENV_KEY = "ATS_CLI_CONTEXT_ID";
|
|
13018
|
+
const LEGACY_ATS_CLI_CONTEXT_ENV_KEY = "ATS_AGENT_SESSION_ID";
|
|
13019
|
+
const CLI_CONTEXT_ENV_KEYS = [ATS_CLI_CONTEXT_ENV_KEY, LEGACY_ATS_CLI_CONTEXT_ENV_KEY];
|
|
13210
13020
|
const SESSION_FILE_MAX_LENGTH = 128;
|
|
13211
13021
|
const SESSION_FILE_HASH_LENGTH = 8;
|
|
13212
|
-
function
|
|
13022
|
+
function resolveCliContext(profileIdInput) {
|
|
13213
13023
|
const explicit = normalizeSessionId(profileIdInput);
|
|
13214
13024
|
if (explicit) return {
|
|
13215
|
-
|
|
13025
|
+
cliContextId: explicit,
|
|
13216
13026
|
source: "manual"
|
|
13217
13027
|
};
|
|
13218
|
-
for (const key of
|
|
13028
|
+
for (const key of CLI_CONTEXT_ENV_KEYS) {
|
|
13219
13029
|
const sessionId = normalizeSessionId(process.env[key]);
|
|
13220
13030
|
if (sessionId) return {
|
|
13221
|
-
|
|
13031
|
+
cliContextId: sessionId,
|
|
13222
13032
|
source: `environment:${key}`
|
|
13223
13033
|
};
|
|
13224
13034
|
}
|
|
13225
13035
|
return resolveTerminalSessionId();
|
|
13226
13036
|
}
|
|
13227
|
-
function
|
|
13228
|
-
return
|
|
13037
|
+
function resolveCliContextId(profileIdInput) {
|
|
13038
|
+
return resolveCliContext(profileIdInput)?.cliContextId ?? null;
|
|
13229
13039
|
}
|
|
13230
13040
|
function normalizeSessionSource(raw) {
|
|
13231
13041
|
const value = String(raw ?? "").trim();
|
|
13232
13042
|
if (!value) return null;
|
|
13233
13043
|
return value;
|
|
13234
13044
|
}
|
|
13235
|
-
async function
|
|
13236
|
-
const
|
|
13237
|
-
if (!
|
|
13238
|
-
const raw = await readFile(
|
|
13045
|
+
async function readCliContextState(input) {
|
|
13046
|
+
const cliContextId = resolveSessionStateId(input?.sessionId);
|
|
13047
|
+
if (!cliContextId) return null;
|
|
13048
|
+
const raw = await readFile(cliContextStatePath(cliContextId), "utf8").catch(() => null);
|
|
13239
13049
|
if (!raw) return null;
|
|
13240
|
-
return
|
|
13050
|
+
return parseCliContextState(raw);
|
|
13241
13051
|
}
|
|
13242
|
-
async function
|
|
13052
|
+
async function listCliContextStates() {
|
|
13243
13053
|
const entryNames = await readdir(sessionsDir()).catch(() => []);
|
|
13244
13054
|
const states = [];
|
|
13245
13055
|
for (const entryName of entryNames) {
|
|
13246
13056
|
if (!entryName.endsWith(".json")) continue;
|
|
13247
13057
|
const raw = await readFile(join(sessionsDir(), entryName), "utf8").catch(() => null);
|
|
13248
13058
|
if (!raw) continue;
|
|
13249
|
-
const parsed =
|
|
13059
|
+
const parsed = parseCliContextState(raw);
|
|
13250
13060
|
if (!parsed) continue;
|
|
13251
13061
|
states.push(parsed);
|
|
13252
13062
|
}
|
|
13253
13063
|
return states.sort((left, right) => left.sessionId.localeCompare(right.sessionId));
|
|
13254
13064
|
}
|
|
13255
|
-
async function
|
|
13256
|
-
const
|
|
13257
|
-
if (!
|
|
13065
|
+
async function writeCliContextState(input) {
|
|
13066
|
+
const cliContext = resolveCliContextStateInput(input) ?? resolveCliContext();
|
|
13067
|
+
if (!cliContext) return false;
|
|
13258
13068
|
await mkdir(sessionsDir(), { recursive: true });
|
|
13259
|
-
const existing = await
|
|
13069
|
+
const existing = await readCliContextState({ sessionId: cliContext.cliContextId });
|
|
13260
13070
|
const nextAtsProfileId = resolveNextSessionAtsProfileId(existing, input);
|
|
13261
13071
|
const nextSelectedAtsProfileId = resolveNextSelectedAtsProfileId(existing, input);
|
|
13262
|
-
const outputPath =
|
|
13072
|
+
const outputPath = cliContextStatePath(cliContext.cliContextId);
|
|
13263
13073
|
if (!(nextAtsProfileId || nextSelectedAtsProfileId)) {
|
|
13264
13074
|
await rm(outputPath, { force: true });
|
|
13265
13075
|
return true;
|
|
13266
13076
|
}
|
|
13267
|
-
await
|
|
13077
|
+
await writeCliContextStateFile(outputPath, {
|
|
13268
13078
|
v: 1,
|
|
13269
|
-
sessionId:
|
|
13270
|
-
|
|
13079
|
+
sessionId: cliContext.cliContextId,
|
|
13080
|
+
cliContextSource: cliContext.source ?? existing?.cliContextSource ?? "manual",
|
|
13271
13081
|
...nextAtsProfileId ? { atsProfileId: nextAtsProfileId } : {},
|
|
13272
13082
|
...nextSelectedAtsProfileId ? { selectedAtsProfileId: nextSelectedAtsProfileId } : {},
|
|
13273
13083
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
13274
13084
|
});
|
|
13275
13085
|
return true;
|
|
13276
13086
|
}
|
|
13277
|
-
function
|
|
13087
|
+
function cliContextStatePath(sessionId) {
|
|
13278
13088
|
return join(sessionsDir(), `${toSafeSessionFile(sessionId)}.json`);
|
|
13279
13089
|
}
|
|
13280
13090
|
function toSafeSessionFile(value) {
|
|
@@ -13284,20 +13094,20 @@ function toSafeSessionFile(value) {
|
|
|
13284
13094
|
const maxBaseLength = Math.max(1, SESSION_FILE_MAX_LENGTH - SESSION_FILE_HASH_LENGTH - 1);
|
|
13285
13095
|
return `${safeBase.slice(0, maxBaseLength)}-${hash}`;
|
|
13286
13096
|
}
|
|
13287
|
-
function
|
|
13097
|
+
function resolveCliContextStateInput(input) {
|
|
13288
13098
|
const sessionId = normalizeSessionId(input.sessionId);
|
|
13289
13099
|
if (!sessionId) return null;
|
|
13290
13100
|
return {
|
|
13291
|
-
|
|
13101
|
+
cliContextId: sessionId,
|
|
13292
13102
|
source: normalizeSessionSource(input.sessionSource) ?? "manual"
|
|
13293
13103
|
};
|
|
13294
13104
|
}
|
|
13295
13105
|
function resolveSessionStateId(sessionId) {
|
|
13296
13106
|
const explicit = normalizeSessionId(sessionId);
|
|
13297
13107
|
if (explicit) return explicit;
|
|
13298
|
-
return
|
|
13108
|
+
return resolveCliContext()?.cliContextId ?? null;
|
|
13299
13109
|
}
|
|
13300
|
-
function
|
|
13110
|
+
function parseCliContextState(raw) {
|
|
13301
13111
|
let parsed;
|
|
13302
13112
|
try {
|
|
13303
13113
|
parsed = JSON.parse(raw);
|
|
@@ -13310,11 +13120,11 @@ function parseRuntimeSessionState(raw) {
|
|
|
13310
13120
|
const atsProfileId = resolveStoredSessionAtsProfileId(parsed);
|
|
13311
13121
|
const selectedAtsProfileId = resolveStoredSelectedAtsProfileId(parsed);
|
|
13312
13122
|
if (!(atsProfileId || selectedAtsProfileId)) return null;
|
|
13313
|
-
const
|
|
13123
|
+
const cliContextSource = normalizeSessionSource(parsed.cliContextSource);
|
|
13314
13124
|
return {
|
|
13315
13125
|
v: 1,
|
|
13316
13126
|
sessionId,
|
|
13317
|
-
...
|
|
13127
|
+
...cliContextSource ? { cliContextSource } : {},
|
|
13318
13128
|
...atsProfileId ? { atsProfileId } : {},
|
|
13319
13129
|
...selectedAtsProfileId ? { selectedAtsProfileId } : {},
|
|
13320
13130
|
updatedAt: typeof parsed.updatedAt === "string" && parsed.updatedAt.trim().length > 0 ? parsed.updatedAt : (/* @__PURE__ */ new Date(0)).toISOString()
|
|
@@ -13328,7 +13138,7 @@ function resolveNextSelectedAtsProfileId(existing, input) {
|
|
|
13328
13138
|
if (!("selectedAtsProfileId" in input)) return existing?.selectedAtsProfileId;
|
|
13329
13139
|
return normalizeOptionalAtsProfileId(input.selectedAtsProfileId) ?? void 0;
|
|
13330
13140
|
}
|
|
13331
|
-
async function
|
|
13141
|
+
async function writeCliContextStateFile(outputPath, payload) {
|
|
13332
13142
|
const tempPath = `${outputPath}.tmp-${process.pid}-${Date.now()}`;
|
|
13333
13143
|
const file = await open(tempPath, "w");
|
|
13334
13144
|
let writeFailure = null;
|
|
@@ -13364,7 +13174,7 @@ function resolveTerminalSessionId() {
|
|
|
13364
13174
|
const parentPid = Number(process.ppid);
|
|
13365
13175
|
if (!Number.isInteger(parentPid) || parentPid <= 1) return null;
|
|
13366
13176
|
return {
|
|
13367
|
-
|
|
13177
|
+
cliContextId: `terminal-ppid-${parentPid}`,
|
|
13368
13178
|
source: `terminal:ppid-${parentPid}`
|
|
13369
13179
|
};
|
|
13370
13180
|
}
|
|
@@ -13409,7 +13219,7 @@ function isAtsLockError(error) {
|
|
|
13409
13219
|
}
|
|
13410
13220
|
async function acquireLock(input) {
|
|
13411
13221
|
const atsProfileId = normalizeAtsProfileId(input.atsProfileId);
|
|
13412
|
-
const sessionId =
|
|
13222
|
+
const sessionId = resolveCliContextId();
|
|
13413
13223
|
await mkdir(locksDir(atsProfileId), { recursive: true });
|
|
13414
13224
|
const path = resolveLockPath({
|
|
13415
13225
|
atsProfileId,
|
|
@@ -13578,5 +13388,5 @@ function toErrorMessage(error) {
|
|
|
13578
13388
|
}
|
|
13579
13389
|
|
|
13580
13390
|
//#endregion
|
|
13581
|
-
export {
|
|
13582
|
-
//# sourceMappingURL=lock-
|
|
13391
|
+
export { gatewayErrorEnvelopeSchema as $, daemonHubDeliverDispatchRequestSchema as $n, spaceDispatchTraceResponseSchema as $t, createSpaceBodySchema as A, DISPATCH_ACTIVITY_FAILED_PURPOSE as An, sanitizeSignalTextPreview as Ar, patchSpaceContractResponseSchema as At, daemonRuntimeLeaseSchema as B, SPACE_UPDATES_MAX_LIMIT as Bn, projectObservabilityWakeCorrelation as Bt, atsRequestContextSchema as C, AGENT_REPLY_PREVIEW_END_PURPOSE as Cn, resolveBuiltinAgentControllerConversationKind as Cr, normalizeListSignalsReadQuerySemantics as Ct, claimExecutionDiagnosticsQuerySchema as D, CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH as Dn, runtimeAgentControllerLaunchContractSchema as Dr, observabilityWakeTraceSelectorSchema as Dt, catchupResponseSchema as E, CONVERSATION_CONTINUITY_WARNING_PURPOSE as En, resolveSpaceMentionLabels as Er, notifyAgentProfileRouteCatalogChangedResponseSchema as Et, createSpaceThreadResponseSchema as F, MESSAGE_MENTION_TYPE_VALUES as Fn, postSpaceMembersResponseSchema as Ft, entryBriefSchema as G, atsdTaskResultPayloadSchema as Gn, resolveSpaceDispatchTraceRootCause as Gt, dispatchBriefSchema as H, atsSpaceEgressActionSchema as Hn, providerDispatchRuntimeContextSchema as Ht, createStartSessionBodySchema as I, SPACE_MEMBER_JOIN_NOTICE_PURPOSE as In, postSpaceThreadSignalBodySchema as It, formatLocalComponentsSummaryDescription as J, canonicalizeAgentControllerRef as Jn, serverErrorFrameSchema as Jt, forgetComputerResponseSchema as K, buildAgentControllerConversationRef as Kn, resolveStartHandoffBodySchema as Kt, currentDeviceTargetResponseSchema as L, SPACE_MEMBER_REMOVE_NOTICE_PURPOSE as Ln, postSpaceThreadSignalResponseSchema as Lt, createSpaceDiagnosticReportResponseSchema as M, LEGACY_RUNTIME_DISPATCH_POLICY as Mn, postNormalMessageBodySchema as Mt, createSpaceResponseSchema as N, MAX_PROFILE_WORKING_DIRECTORY_LENGTH as Nn, postNormalMessageResponseSchema as Nt, claimExecutionDiagnosticsResponseSchema as O, DAEMON_HUB_SCHEMA_VERSION as On, runtimeAgentControllerSettingsSchema as Or, patchProfileSpaceHistoryStatusResponseSchema as Ot, createSpaceThreadBodySchema as P, MAX_SIGNAL_REPLY_TO_PREVIEW_LENGTH as Pn, postSpaceMembersBodySchema as Pt, gatewayErrorCodeSchema as Q, createDaemonRouteObservationSummary as Qn, spaceCreatorSchema as Qt, currentLocalRuntimeReplyReadinessResponseSchema as R, SPACE_MENTION_REJECT_NOTICE_PURPOSE as Rn, prepareSessionResponseSchema as Rt, atsProfileIdSchema as S, AGENT_REPLYING_PURPOSE as Sn, profileWorkspaceModeSchema as Sr, localRuntimesResponseSchema as St, atsdControlPlaneResponseSchema as T, ATSD_TASK_RESULT_SCHEMA_VERSION as Tn, resolveSingleSpaceMentionLabels as Tr, notifyAgentProfileRouteCatalogChangedBodySchema as Tt, ensureAgentProfilePrimaryBindingBodySchema as U, atsdTaskResultEnvelopeWriteSchema as Un, querySpaceDeletionTombstonesResponseSchema as Ut, deleteSpaceResponseSchema as V, atsRuntimeProfileIdSchema as Vn, projectSpaceDispatchTraceFinalVisibleOutcome as Vt, ensureAgentProfilePrimaryBindingResponseSchema as W, atsdTaskResultOpenClawGatewayVisibilityStatusSchema as Wn, removeSpaceMembersResponseSchema as Wt, formatLocalSetupActionDescription as X, collectCanonicalMentionTextFragments as Xn, setLocalRuntimeDisplayNameBodySchema as Xt, formatLocalComponentsSummaryLabel as Y, canonicalizeBuiltinAgentControllerRef as Yn, setCurrentDeviceTargetBodySchema as Yt, formatLocalSetupActionLabel as Z, conversationExecutionStateSchema as Zn, signalEnvelopeSchema as Zt, ATSD_CONTROL_PLANE_SCHEMA_VERSION as _, writeCurrentDeviceObservedMetadataBodySchema as _n, normalizeMessageEnvelope as _r, listProfileSpaceHistoryResponseSchema as _t, runWithHeldLock as a, startSessionProgressSchema as an, daemonHubHeartbeatRequestSchema as ar, getPrepareReadinessResponseSchema as at, agentExecutionReadinessRouteParamsSchema as b, writeSetupTokenLocalRuntimeObservedMetadataResponseSchema as bn, parseAgentControllerRef as br, listSpaceThreadsResponseSchema as bt, LEGACY_ATS_CLI_CONTEXT_ENV_KEY as c, startSessionSpaceChoiceResponseSchema as cn, daemonHubRegisterSessionResponseSchema as cr, getSpaceDispatchResultResponseSchema as ct, resolveCliContext as d, submitRuntimeAgentControllerReportsBodySchema as dn, daemonServiceContractSchema as dr, getSpaceUpdatesResponseSchema as dt, spaceMembersSnapshotSchema as en, daemonHubDeliveryExecutionIdentitySchema as er, getAgentExecutionReadinessBatchBodySchema as et, resolveCliContextId as f, submitRuntimeAgentControllerReportsResponseSchema as fn, daemonStreamFrameSchema as fr, getSpaceWakeProgressResponseSchema as ft, resolveMappedPublicAgentFailureReason as g, upsertSpaceDeletionTombstoneResponseSchema as gn, normalizeKnownBuiltinAgentControllerId as gr, leaveSpaceResponseSchema as gt, resolveBuiltinAgentControllerBrand as h, upsertProfileSpaceHistoryResponseSchema as hn, normalizeBuiltinAgentControllerId as hr, installedLocalComponentsSnapshotSchema as ht, releaseLock as i, startProfileReadinessSummarySchema as in, daemonHubDispatchRuntimeEvidenceRequestSchema as ir, getPrepareReadinessQuerySchema as it, createSpaceDiagnosticReportBodySchema as j, DISPATCH_ACTIVITY_RETRYING_PURPOSE as jn, patchStartSessionBodySchema as jt, continuitySchema as k, DISPATCH_ACTIVITY_DISPATCHING_PURPOSE as kn, runtimeCoordinatorExecutionTokenEnvelopeSchema as kr, patchSpaceContractBodySchema as kt, listCliContextStates as l, startSessionWithTokenResponseSchema as ln, daemonHubRouteCatalogChangedFramePayloadSchema as lr, getSpaceStatusResponseSchema as lt, CODEX_UPGRADE_REQUIRED_REASON as m, submitRuntimeRegistrationResponseSchema as mn, getSpaceMessageAddressingRelationSupportForTargetKind as mr, incomingServerMessageSchema as mt, isAtsLockError as n, spaceViewerMembershipResponseSchema as nn, daemonHubDispatchPreviewEndRequestSchema as nr, getAgentExecutionReadinessResponseSchema as nt, tryCleanupStaleLock as o, startSessionResponseSchema as on, daemonHubHeartbeatResponseSchema as or, getSpaceContractResponseSchema as ot, writeCliContextState as p, submitRuntimeRegistrationBodySchema as pn, formatCanonicalMentionLiteral as pr, getSpaceWakeTraceWaterfallResponseSchema as pt, forgetCurrentComputerResponseSchema as q, buildAgentControllerRoutingKey as qn, resolveStartHandoffResponseSchema as qt, readLockMeta as r, startDeviceProjectionSchema as rn, daemonHubDispatchPreviewRequestSchema as rr, getAgentProfilePrimaryBindingResponseSchema as rt, ATS_CLI_CONTEXT_ENV_KEY as s, startSessionSpaceChoiceBodySchema as sn, daemonHubRegisterSessionRequestSchema as sr, getSpaceDispatchLookupResponseSchema as st, acquireLock as t, spaceMetaSchema as tn, daemonHubDispatchLifecycleRequestSchema as tr, getAgentExecutionReadinessBatchResponseSchema as tt, readCliContextState as u, structuredGuidePayloadFromInputSchema as un, daemonHubSubmitTaskResultRequestSchema as ur, getSpaceThreadResponseSchema as ut, LOCAL_COMPONENTS_SCHEMA_VERSION as v, writeCurrentDeviceObservedMetadataResponseSchema as vn, normalizeOptionalWorkingDirectory as vr, listSpaceThreadEventsResponseSchema as vt, atsdControlPlaneRequestSchema as w, AGENT_REPLY_PREVIEW_PURPOSE as wn, resolveMessageEnvelopeTargetField as wr, normalizeSpaceCursorPatch as wt, agentProfileBindingRouteParamsSchema as x, AGENT_REPLYING_END_PURPOSE as xn, parseOptionalClientMessageId as xr, localRuntimesQuerySchema as xt, SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS as y, writeSetupTokenLocalRuntimeObservedMetadataBodySchema as yn, normalizeSpacePasswordText as yr, listSpaceThreadSignalsResponseSchema as yt, daemonRouteObservationResponseSchema as z, SPACE_PASSWORD_MIN_LENGTH as zn, prepareSessionStreamServerFrameSchema as zt };
|
|
13392
|
+
//# sourceMappingURL=lock-BbSDV7cL.js.map
|