openmeld 0.3.233 → 0.3.235
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/{add-me-membership-_O3IzRLn.js → add-me-membership-BVt0EFQ2.js} +2 -2
- package/dist/{add-me-membership-_O3IzRLn.js.map → add-me-membership-BVt0EFQ2.js.map} +1 -1
- package/dist/{agents-B5E7c7sQ.js → agents-Bl_W0SLT.js} +9 -9
- package/dist/{agents-B5E7c7sQ.js.map → agents-Bl_W0SLT.js.map} +1 -1
- package/dist/{api-client-foundation-1p1VVFJ_.js → api-client-foundation-BHjffwwr.js} +1 -1
- package/dist/{api-client-foundation-C-RPnq_p.js → api-client-foundation-D6zHrrGV.js} +3 -3
- package/dist/{api-client-foundation-C-RPnq_p.js.map → api-client-foundation-D6zHrrGV.js.map} +1 -1
- package/dist/auth-session-CCLabxRT.js +4 -0
- package/dist/{auth-session-iXCJO5oB.js → auth-session-CjxqNKvh.js} +2 -2
- package/dist/{auth-session-iXCJO5oB.js.map → auth-session-CjxqNKvh.js.map} +1 -1
- package/dist/{channel-BciBrA3Y.js → channel-BW2_rI6u.js} +3 -3
- package/dist/{channel-BciBrA3Y.js.map → channel-BW2_rI6u.js.map} +1 -1
- package/dist/{command-D0pcAIoE.js → command-vUyYaeck.js} +16 -16
- package/dist/{command-D0pcAIoE.js.map → command-vUyYaeck.js.map} +1 -1
- package/dist/{computer-connection-CHP1-0rK.js → computer-connection-LX1R7jD0.js} +2 -2
- package/dist/{computer-connection-CHP1-0rK.js.map → computer-connection-LX1R7jD0.js.map} +1 -1
- package/dist/{computer-connection-review-dHotFqmD.js → computer-connection-review-Bbp4nzXl.js} +5 -5
- package/dist/{computer-connection-review-dHotFqmD.js.map → computer-connection-review-Bbp4nzXl.js.map} +1 -1
- package/dist/{computer-disconnect-B2DLDxWx.js → computer-disconnect-fbLphD7-.js} +7 -7
- package/dist/{computer-disconnect-B2DLDxWx.js.map → computer-disconnect-fbLphD7-.js.map} +1 -1
- package/dist/{computer-setup-continuation-Cv_c1B-7.js → computer-setup-continuation-CcfcMexz.js} +3 -3
- package/dist/{computer-setup-continuation-Cv_c1B-7.js.map → computer-setup-continuation-CcfcMexz.js.map} +1 -1
- package/dist/{context-BnhlFS8m.js → context-D3GnSqg8.js} +3 -3
- package/dist/{context-BnhlFS8m.js.map → context-D3GnSqg8.js.map} +1 -1
- package/dist/control-plane-QqGL-jtT.js.map +1 -1
- package/dist/{daemon-device-id-DbSIqHoZ.js → daemon-device-id-OMqh2F9_.js} +5 -5
- package/dist/{daemon-device-id-DbSIqHoZ.js.map → daemon-device-id-OMqh2F9_.js.map} +1 -1
- package/dist/{daemon-lifecycle-journal-DsVVvKJe.js → daemon-lifecycle-journal-DEQHGloF.js} +4 -4
- package/dist/{daemon-lifecycle-journal-DsVVvKJe.js.map → daemon-lifecycle-journal-DEQHGloF.js.map} +1 -1
- package/dist/{daemon-service-runtime-DZI6Ke3_.js → daemon-service-runtime-BDlPNE7y.js} +2 -2
- package/dist/{daemon-service-runtime-DZI6Ke3_.js.map → daemon-service-runtime-BDlPNE7y.js.map} +1 -1
- package/dist/{daemon-service-update-coordinator-BgVBlJ4d.js → daemon-service-update-coordinator-D-yjJ2PV.js} +18 -16
- package/dist/{daemon-service-update-coordinator-BgVBlJ4d.js.map → daemon-service-update-coordinator-D-yjJ2PV.js.map} +1 -1
- package/dist/{dispatch-owned-runtime-BeIQetEt.js → dispatch-owned-runtime-FNjbFwSu.js} +50 -617
- package/dist/dispatch-owned-runtime-FNjbFwSu.js.map +1 -0
- package/dist/{dist-BgYBvEBB.js → dist-CJL7LE-y.js} +193 -358
- package/dist/dist-CJL7LE-y.js.map +1 -0
- package/dist/{dist-DQS0XYkb.js → dist-Ccpvj1tf.js} +2 -2
- package/dist/{dist-DQS0XYkb.js.map → dist-Ccpvj1tf.js.map} +1 -1
- package/dist/{dist-z72xYz5Z.js → dist-MpN-h8da.js} +1 -1
- package/dist/{elapsed-time-C7S-6bWV.js → elapsed-time-1d08oEQ3.js} +5 -5
- package/dist/{elapsed-time-C7S-6bWV.js.map → elapsed-time-1d08oEQ3.js.map} +1 -1
- package/dist/{entry-CX24qHnm.js → entry-G1LraPT2.js} +7 -7
- package/dist/{entry-CX24qHnm.js.map → entry-G1LraPT2.js.map} +1 -1
- package/dist/{installation-inventory-B3mwQFEA.js → installation-inventory-BsOTGp_X.js} +3 -3
- package/dist/{installation-inventory-B3mwQFEA.js.map → installation-inventory-BsOTGp_X.js.map} +1 -1
- package/dist/{installer-DnIJ4y3l.js → installer-JpCPmqGj.js} +2 -2
- package/dist/{installer-DnIJ4y3l.js.map → installer-JpCPmqGj.js.map} +1 -1
- package/dist/{meta-api-DgHkiIdr.js → meta-api-ClHCkzZB.js} +4 -4
- package/dist/{meta-api-DgHkiIdr.js.map → meta-api-ClHCkzZB.js.map} +1 -1
- package/dist/{openmeld-kYp99hOl.js → openmeld-BrAKrRtb.js} +32 -32
- package/dist/{openmeld-kYp99hOl.js.map → openmeld-BrAKrRtb.js.map} +1 -1
- package/dist/openmeld-dev-environment-DwdvL7jg.js +24 -0
- package/dist/openmeld-dev-environment-DwdvL7jg.js.map +1 -0
- package/dist/openmeld-dev.js +1 -19
- package/dist/openmeld-dev.js.map +1 -1
- package/dist/{openmeld-maintenance-worker-BqU1Asrm.js → openmeld-maintenance-worker-BuLMqEuI.js} +9 -9
- package/dist/{openmeld-maintenance-worker-BqU1Asrm.js.map → openmeld-maintenance-worker-BuLMqEuI.js.map} +1 -1
- package/dist/{openmeld-tools-update-join-BKJnGR5h.js → openmeld-tools-update-join-3RJrWvrr.js} +4 -4
- package/dist/{openmeld-tools-update-join-BKJnGR5h.js.map → openmeld-tools-update-join-3RJrWvrr.js.map} +1 -1
- package/dist/openmeld.js +4 -4
- package/dist/{prepare-provider-runtime-CD6XRt7X.js → prepare-provider-runtime-Y2WOwFlV.js} +174 -49
- package/dist/prepare-provider-runtime-Y2WOwFlV.js.map +1 -0
- package/dist/{prepare-session-executor-DY2s4FuY.js → prepare-session-executor-B61bBZz0.js} +18 -18
- package/dist/{prepare-session-executor-DY2s4FuY.js.map → prepare-session-executor-B61bBZz0.js.map} +1 -1
- package/dist/{process-channel-CzgOWiuh.js → process-channel-CTPL81j6.js} +2 -2
- package/dist/{process-channel-CzgOWiuh.js.map → process-channel-CTPL81j6.js.map} +1 -1
- package/dist/{runtime-Br4Ga0rJ.js → runtime-CW2rk7-K.js} +7860 -7249
- package/dist/runtime-CW2rk7-K.js.map +1 -0
- package/dist/{runtime-agent-controller-reporting-submission-CQjbBiHh.js → runtime-agent-controller-reporting-submission-DtXqZxol.js} +16 -46
- package/dist/{runtime-agent-controller-reporting-submission-CQjbBiHh.js.map → runtime-agent-controller-reporting-submission-DtXqZxol.js.map} +1 -1
- package/dist/{runtime-transport-D4CVffnp.js → runtime-transport-DyBmX7ds.js} +569 -30
- package/dist/runtime-transport-DyBmX7ds.js.map +1 -0
- package/dist/{service-D9QVc4_y.js → service-BIO-ixp9.js} +68 -38
- package/dist/service-BIO-ixp9.js.map +1 -0
- package/dist/{service-account-authorization-DLhUgGDb.js → service-account-authorization-CdyvPbvg.js} +2 -2
- package/dist/{service-account-authorization-DLhUgGDb.js.map → service-account-authorization-CdyvPbvg.js.map} +1 -1
- package/dist/{service-account-control-DIdQILmo.js → service-account-control-Ddl1E6YF.js} +9 -9
- package/dist/{service-account-control-DIdQILmo.js.map → service-account-control-Ddl1E6YF.js.map} +1 -1
- package/dist/{service-control-capabilities-BvHU_NcX.js → service-control-capabilities-BYmPglLN.js} +1 -1
- package/dist/{service-control-capabilities-CGv5Cuxo.js → service-control-capabilities-CTsm5txF.js} +3 -3
- package/dist/{service-control-capabilities-CGv5Cuxo.js.map → service-control-capabilities-CTsm5txF.js.map} +1 -1
- package/dist/{state-AWe5DSV8.js → state-SRzkI4G2.js} +2 -2
- package/dist/{state-AWe5DSV8.js.map → state-SRzkI4G2.js.map} +1 -1
- package/dist/{runtime-reporting-health-state-a1FUE1S-.js → updates-api-B0f4KyCg.js} +374 -206
- package/dist/updates-api-B0f4KyCg.js.map +1 -0
- package/dist/{upgrade-CcnlL7FH.js → upgrade-BG_Irs5Q.js} +7 -7
- package/dist/{upgrade-CcnlL7FH.js.map → upgrade-BG_Irs5Q.js.map} +1 -1
- package/dist/upgrade-CLdAVKIb.js +4 -0
- package/package.json +11 -11
- package/dist/auth-session-CmjjkLiB.js +0 -4
- package/dist/dispatch-owned-runtime-BeIQetEt.js.map +0 -1
- package/dist/dist-BgYBvEBB.js.map +0 -1
- package/dist/prepare-provider-runtime-CD6XRt7X.js.map +0 -1
- package/dist/runtime-Br4Ga0rJ.js.map +0 -1
- package/dist/runtime-reporting-health-state-a1FUE1S-.js.map +0 -1
- package/dist/runtime-transport-D4CVffnp.js.map +0 -1
- package/dist/service-D9QVc4_y.js.map +0 -1
- package/dist/upgrade-CLnZ4WBF.js +0 -4
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { F as resolveOpenMeldRootDir, P as resolveOpenMeldEnvPreset, b as normalizeOpenMeldProfileId, g as legacyAccountProfileSpacesDir, r as accountProfileSpaceCacheDir, w as openMeldManagedBinaryPath } from "./paths-De9xdA2h.js";
|
|
4
|
-
import { $r as spaceMemberDirectoryAllowedRelationsSchema, Bi as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { $r as spaceMemberDirectoryAllowedRelationsSchema, Bi as listProjectsResponseSchema, Br as getOrganizationSkillResponseSchema, Ci as updateCenterAgentRoutineResponseSchema, Di as agentActivityEventSchema, Dr as submitFeedbackIssueResponseSchema, Ei as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Er as submitFeedbackIssueRequestSchema, Fi as localProjectControlConnectionSchema, Gr as organizationSkillReleaseSummarySchema, Hi as updateProjectResponseSchema, Ji as computerFileAccessPolicySchema, Kr as organizationSkillSummarySchema, Qr as spaceMemberAgentWakeAvailabilitySchema, Ri as archiveProjectResponseSchema, Si as resumeCenterAgentRoutineResponseSchema, Tr as organizationDirectoryResponseSchema, Vi as projectSchema, Vr as listOrganizationSkillsResponseSchema, Wr as organizationSkillGitHubRepositoryPreviewSchema, _i as createCenterAgentRoutineResponseSchema, bi as listCenterAgentRoutinesResponseSchema, di as agentActivitySessionInventoryResponseSchema, ei as spaceMemberDirectoryEntrySchema, hi as spaceCreatorSchema, ji as agentActivitySnapshotResponseSchema, ni as spaceMemberKindSchema, qi as computerFileAccessPolicyInputSchema, si as organizationComputersResponseSchema, sr as spaceEntryTargetSchema, ti as spaceMemberDirectorySchema, vi as deleteCenterAgentRoutineResponseSchema, wr as organizationSpaceDirectoryWithMemberCountsResponseSchema, xi as pauseCenterAgentRoutineResponseSchema, yi as listCenterAgentRoutineRunsResponseSchema, zi as createProjectResponseSchema } from "./dist-CJL7LE-y.js";
|
|
5
|
+
import { $ as openMeldSpaceEgressActionSchema, L as runtimeTransportRegisterSessionResponseSchema, Ri as openMeldRequestContextSchema, Vt as sanitizeSignalTextPreview, Xr as resolveSpaceMentionLabels, Yr as resolveSingleSpaceMentionLabels, a as daemonStreamFrameSchema, br as executionContextAssignmentSchema, cr as collectCanonicalMentionTextFragments, fr as normalizeMessageEnvelope, pr as resolveMessageEnvelopeTargetField, qr as normalizeSpacePasswordText, rt as centerAgentToolSpeakerSchema, sr as MESSAGE_MENTION_TYPE_VALUES, ur as getSpaceMessageAddressingRelationSupportForTargetKind, w as runtimeTransportHeartbeatResponseSchema } from "./runtime-transport-DyBmX7ds.js";
|
|
6
|
+
import { O as openMeldRuntimeProfileIdSchema } from "./control-plane-QqGL-jtT.js";
|
|
7
|
+
import { Ct as resolveLocalProjectConnectionForPath, Kt as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Mn as DaemonServiceRunError, Sr as renderWorkingLanguagePrompt, Tt as withAgentActivityLocalStateLock, Xt as buildDispatchReplyContextSummary, ar as areAgentControllerInterfaceAccountsSame, cr as buildWorkingLanguagePromptPlan, dt as isProjectBound, ft as listProjectBindings, mr as isAgentControllerUsageAccountUnavailable, sr as buildInformationProtectionPromptPlan, vr as parseAgentControllerRef, xr as renderInformationProtectionPrompt } from "./prepare-provider-runtime-Y2WOwFlV.js";
|
|
7
8
|
import { A as boolean, G as strictObject, I as iso, K as string, M as discriminatedUnion, P as enumFactory, R as literal, Z as url, p as localServiceComponentUpdateProjectionSchema, s as localCliComponentUpdateProjectionSchema } from "./local-components-DJiMS67S.js";
|
|
8
|
-
import { D as normalizeOptionalWorkingDirectory, O as openMeldRuntimeProfileIdSchema } from "./control-plane-QqGL-jtT.js";
|
|
9
9
|
import { i as serviceControlCapabilitiesSchema } from "./service-account-admission-BfdJ-kKR.js";
|
|
10
|
-
import {
|
|
10
|
+
import { a as asRecord, d as normalizeText, ht as resolveCurrentOpenMeldAccountContext, l as normalizeNonNegativeInteger$1, s as emitRunLine, u as normalizeOptionalText$8 } from "./daemon-device-id-OMqh2F9_.js";
|
|
11
11
|
import { v as resolveCliContextId } from "./lock-BMI00i2F.js";
|
|
12
|
-
import { a as buildAgentFacingMentalModelLines, c as buildCompactDispatchActionGuidanceLines, d as buildSpaceWakeParticipantLines, g as renderSpaceEntryBrief, h as isSelfWakeSpaceAction, l as buildSpaceAgentIdentityLine, m as deriveContinuity, n as SPACE_COLLABORATION_CONTEXT_RULE, p as composeDispatchBrief, s as buildCenterAgentRoleTemplateText, u as buildSpaceEntryBriefNeedMoreLine, v as resolveSpacePublicationRequirement } from "./dist-
|
|
12
|
+
import { a as buildAgentFacingMentalModelLines, c as buildCompactDispatchActionGuidanceLines, d as buildSpaceWakeParticipantLines, g as renderSpaceEntryBrief, h as isSelfWakeSpaceAction, l as buildSpaceAgentIdentityLine, m as deriveContinuity, n as SPACE_COLLABORATION_CONTEXT_RULE, p as composeDispatchBrief, s as buildCenterAgentRoleTemplateText, u as buildSpaceEntryBriefNeedMoreLine, v as resolveSpacePublicationRequirement } from "./dist-Ccpvj1tf.js";
|
|
13
13
|
import { d as createDefaultRuntimeAgentControllerSettings } from "./base-url-0AoeTi3w.js";
|
|
14
14
|
import { n as resolveOpenMeldDistribution } from "./distribution-BDQT2ilb.js";
|
|
15
15
|
import { a as DAEMON_SERVICE_RUNTIME_MODE_ENV, d as daemonDispatchJournalPath, h as daemonRuntimeRootPath, i as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, n as DAEMON_SERVICE_RUNTIME_AUTO_START_ENV, r as DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV, s as DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV } from "./daemon-state-Dte9re5V.js";
|
|
@@ -4267,608 +4267,6 @@ function toJournalErrorMessage(error) {
|
|
|
4267
4267
|
return error instanceof Error ? error.message : String(error);
|
|
4268
4268
|
}
|
|
4269
4269
|
//#endregion
|
|
4270
|
-
//#region src/local-service/dispatch/send-dispatch-result.ts
|
|
4271
|
-
function sendDispatchResultEnvelopeFrame(input) {
|
|
4272
|
-
const resultRequest = runtimeTransportSubmitTaskResultRequestSchema.safeParse({
|
|
4273
|
-
v: 1,
|
|
4274
|
-
...input.runtimeCoordinatorExecutionId ? { runtimeCoordinatorExecutionId: input.runtimeCoordinatorExecutionId } : {},
|
|
4275
|
-
...input.executionTokenEcho ? { executionTokenEcho: input.executionTokenEcho } : {},
|
|
4276
|
-
dispatchId: input.dispatchId,
|
|
4277
|
-
attemptId: input.attemptId,
|
|
4278
|
-
executionIdentityEcho: input.executionIdentityEcho,
|
|
4279
|
-
daemonSessionId: input.daemonSessionId,
|
|
4280
|
-
connectionGeneration: input.connectionGeneration,
|
|
4281
|
-
leaseEpoch: input.leaseEpoch,
|
|
4282
|
-
taskResult: input.taskResult
|
|
4283
|
-
});
|
|
4284
|
-
if (!resultRequest.success) throw new DaemonServiceRunError({
|
|
4285
|
-
code: "daemon.run.result_payload_invalid",
|
|
4286
|
-
message: "invalid daemon dispatch result payload"
|
|
4287
|
-
});
|
|
4288
|
-
sendDaemonFrame$1(input.socket, {
|
|
4289
|
-
code: "daemon.dispatch.result",
|
|
4290
|
-
payload: resultRequest.data
|
|
4291
|
-
});
|
|
4292
|
-
}
|
|
4293
|
-
function sendDispatchLifecycleFrame(input) {
|
|
4294
|
-
const lifecycleRequest = runtimeTransportDispatchLifecycleRequestSchema.safeParse({
|
|
4295
|
-
v: 1,
|
|
4296
|
-
...input.runtimeCoordinatorExecutionId ? { runtimeCoordinatorExecutionId: input.runtimeCoordinatorExecutionId } : {},
|
|
4297
|
-
...input.executionTokenEcho ? { executionTokenEcho: input.executionTokenEcho } : {},
|
|
4298
|
-
dispatchId: input.dispatchId,
|
|
4299
|
-
attemptId: input.attemptId,
|
|
4300
|
-
daemonSessionId: input.daemonSessionId,
|
|
4301
|
-
connectionGeneration: input.connectionGeneration,
|
|
4302
|
-
leaseEpoch: input.leaseEpoch,
|
|
4303
|
-
phase: input.phase,
|
|
4304
|
-
lifecycleAtMs: Date.now(),
|
|
4305
|
-
...input.agentControllerConversationOccupancy === void 0 || input.agentControllerConversationOccupancy === null ? {} : { agentControllerConversationOccupancy: input.agentControllerConversationOccupancy },
|
|
4306
|
-
...input.localQueue === void 0 || input.localQueue === null ? {} : { localQueue: input.localQueue }
|
|
4307
|
-
});
|
|
4308
|
-
if (!lifecycleRequest.success) throw new DaemonServiceRunError({
|
|
4309
|
-
code: "daemon.run.lifecycle_payload_invalid",
|
|
4310
|
-
message: "invalid daemon dispatch lifecycle payload"
|
|
4311
|
-
});
|
|
4312
|
-
sendDaemonFrame$1(input.socket, {
|
|
4313
|
-
code: "daemon.dispatch.lifecycle",
|
|
4314
|
-
payload: lifecycleRequest.data
|
|
4315
|
-
});
|
|
4316
|
-
}
|
|
4317
|
-
function sendDispatchRuntimeEvidenceFrame(input) {
|
|
4318
|
-
const runtimeEvidenceRequest = runtimeTransportDispatchRuntimeEvidenceRequestSchema.safeParse({
|
|
4319
|
-
v: 1,
|
|
4320
|
-
...input.runtimeCoordinatorExecutionId ? { runtimeCoordinatorExecutionId: input.runtimeCoordinatorExecutionId } : {},
|
|
4321
|
-
...input.executionTokenEcho ? { executionTokenEcho: input.executionTokenEcho } : {},
|
|
4322
|
-
dispatchId: input.dispatchId,
|
|
4323
|
-
attemptId: input.attemptId,
|
|
4324
|
-
executionIdentityEcho: input.executionIdentityEcho,
|
|
4325
|
-
daemonSessionId: input.daemonSessionId,
|
|
4326
|
-
connectionGeneration: input.connectionGeneration,
|
|
4327
|
-
leaseEpoch: input.leaseEpoch,
|
|
4328
|
-
phase: input.phase,
|
|
4329
|
-
evidenceAtMs: Date.now(),
|
|
4330
|
-
taskId: input.taskId,
|
|
4331
|
-
spaceId: input.spaceId,
|
|
4332
|
-
sourceSignalId: input.sourceSignalId,
|
|
4333
|
-
...input.sourceClientMessageId === void 0 || input.sourceClientMessageId === null ? {} : { sourceClientMessageId: input.sourceClientMessageId },
|
|
4334
|
-
targetProfileId: input.targetProfileId,
|
|
4335
|
-
...input.durationMs === void 0 || input.durationMs === null ? {} : { durationMs: input.durationMs },
|
|
4336
|
-
...input.reasonCode === void 0 || input.reasonCode === null ? {} : { reasonCode: input.reasonCode },
|
|
4337
|
-
...input.errorName === void 0 || input.errorName === null ? {} : { errorName: input.errorName }
|
|
4338
|
-
});
|
|
4339
|
-
if (!runtimeEvidenceRequest.success) throw new DaemonServiceRunError({
|
|
4340
|
-
code: "daemon.run.runtime_evidence_payload_invalid",
|
|
4341
|
-
message: "invalid daemon dispatch runtime evidence payload"
|
|
4342
|
-
});
|
|
4343
|
-
sendDaemonFrame$1(input.socket, {
|
|
4344
|
-
code: "daemon.dispatch.runtime_evidence",
|
|
4345
|
-
payload: runtimeEvidenceRequest.data
|
|
4346
|
-
});
|
|
4347
|
-
}
|
|
4348
|
-
function sendDispatchReasoningFrame(input) {
|
|
4349
|
-
const { socket, ...payload } = input;
|
|
4350
|
-
const parsed = runtimeTransportDispatchReasoningRequestSchema.safeParse({
|
|
4351
|
-
...payload,
|
|
4352
|
-
v: 1
|
|
4353
|
-
});
|
|
4354
|
-
if (!parsed.success) return;
|
|
4355
|
-
sendDaemonFrame$1(socket, {
|
|
4356
|
-
code: "daemon.dispatch.reasoning",
|
|
4357
|
-
payload: parsed.data
|
|
4358
|
-
});
|
|
4359
|
-
}
|
|
4360
|
-
function sendDispatchProgressFrame(input) {
|
|
4361
|
-
const { socket, ...payload } = input;
|
|
4362
|
-
const parsed = runtimeTransportDispatchProgressRequestSchema.safeParse({
|
|
4363
|
-
...payload,
|
|
4364
|
-
v: 1
|
|
4365
|
-
});
|
|
4366
|
-
if (!parsed.success) return;
|
|
4367
|
-
sendDaemonFrame$1(socket, {
|
|
4368
|
-
code: "daemon.dispatch.progress",
|
|
4369
|
-
payload: parsed.data
|
|
4370
|
-
});
|
|
4371
|
-
}
|
|
4372
|
-
function sendDispatchToolActivityFrame(input) {
|
|
4373
|
-
const request = runtimeTransportDispatchToolActivityRequestSchema.safeParse({
|
|
4374
|
-
v: 1,
|
|
4375
|
-
runtimeCoordinatorExecutionId: input.runtimeCoordinatorExecutionId,
|
|
4376
|
-
executionTokenEcho: input.executionTokenEcho,
|
|
4377
|
-
dispatchId: input.dispatchId,
|
|
4378
|
-
attemptId: input.attemptId,
|
|
4379
|
-
executionIdentityEcho: input.executionIdentityEcho,
|
|
4380
|
-
daemonSessionId: input.daemonSessionId,
|
|
4381
|
-
connectionGeneration: input.connectionGeneration,
|
|
4382
|
-
leaseEpoch: input.leaseEpoch,
|
|
4383
|
-
sequence: input.sequence,
|
|
4384
|
-
observedAtMs: input.observedAtMs,
|
|
4385
|
-
taskId: input.taskId,
|
|
4386
|
-
spaceId: input.spaceId,
|
|
4387
|
-
sourceSignalId: input.sourceSignalId,
|
|
4388
|
-
targetProfileId: input.targetProfileId,
|
|
4389
|
-
part: input.part
|
|
4390
|
-
});
|
|
4391
|
-
if (!request.success) throw new DaemonServiceRunError({
|
|
4392
|
-
code: "daemon.run.tool_activity_payload_invalid",
|
|
4393
|
-
message: "invalid daemon dispatch tool activity payload"
|
|
4394
|
-
});
|
|
4395
|
-
sendDaemonFrame$1(input.socket, {
|
|
4396
|
-
code: "daemon.dispatch.tool_activity",
|
|
4397
|
-
payload: request.data
|
|
4398
|
-
});
|
|
4399
|
-
}
|
|
4400
|
-
function sendDispatchInteractionRequestFrame(input) {
|
|
4401
|
-
const request = runtimeTransportDispatchInteractionRequestSchema.safeParse({
|
|
4402
|
-
v: 1,
|
|
4403
|
-
runtimeCoordinatorExecutionId: input.runtimeCoordinatorExecutionId,
|
|
4404
|
-
executionTokenEcho: input.executionTokenEcho,
|
|
4405
|
-
dispatchId: input.dispatchId,
|
|
4406
|
-
attemptId: input.attemptId,
|
|
4407
|
-
executionIdentityEcho: input.executionIdentityEcho,
|
|
4408
|
-
daemonSessionId: input.daemonSessionId,
|
|
4409
|
-
connectionGeneration: input.connectionGeneration,
|
|
4410
|
-
leaseEpoch: input.leaseEpoch,
|
|
4411
|
-
taskId: input.taskId,
|
|
4412
|
-
interaction: input.interaction
|
|
4413
|
-
});
|
|
4414
|
-
if (!request.success) throw new DaemonServiceRunError({
|
|
4415
|
-
code: "daemon.run.interaction_payload_invalid",
|
|
4416
|
-
message: "invalid local agent interaction request payload"
|
|
4417
|
-
});
|
|
4418
|
-
sendDaemonFrame$1(input.socket, {
|
|
4419
|
-
code: "daemon.dispatch.interaction_request",
|
|
4420
|
-
payload: request.data
|
|
4421
|
-
});
|
|
4422
|
-
}
|
|
4423
|
-
function sendDispatchPreviewFrame(input) {
|
|
4424
|
-
const previewRequest = runtimeTransportDispatchPreviewRequestSchema.safeParse({
|
|
4425
|
-
v: 1,
|
|
4426
|
-
dispatchId: input.dispatchId,
|
|
4427
|
-
attemptId: input.attemptId,
|
|
4428
|
-
daemonSessionId: input.daemonSessionId,
|
|
4429
|
-
connectionGeneration: input.connectionGeneration,
|
|
4430
|
-
leaseEpoch: input.leaseEpoch,
|
|
4431
|
-
previewText: input.previewText
|
|
4432
|
-
});
|
|
4433
|
-
if (!previewRequest.success) return;
|
|
4434
|
-
sendDaemonFrame$1(input.socket, {
|
|
4435
|
-
code: "daemon.dispatch.preview",
|
|
4436
|
-
payload: previewRequest.data
|
|
4437
|
-
});
|
|
4438
|
-
}
|
|
4439
|
-
function sendDispatchPreviewEndFrame(input) {
|
|
4440
|
-
const previewEndRequest = runtimeTransportDispatchPreviewEndRequestSchema.safeParse({
|
|
4441
|
-
v: 1,
|
|
4442
|
-
dispatchId: input.dispatchId,
|
|
4443
|
-
attemptId: input.attemptId,
|
|
4444
|
-
daemonSessionId: input.daemonSessionId,
|
|
4445
|
-
connectionGeneration: input.connectionGeneration,
|
|
4446
|
-
leaseEpoch: input.leaseEpoch
|
|
4447
|
-
});
|
|
4448
|
-
if (!previewEndRequest.success) return;
|
|
4449
|
-
sendDaemonFrame$1(input.socket, {
|
|
4450
|
-
code: "daemon.dispatch.preview_end",
|
|
4451
|
-
payload: previewEndRequest.data
|
|
4452
|
-
});
|
|
4453
|
-
}
|
|
4454
|
-
function resolveDispatchResultPayload(input) {
|
|
4455
|
-
const contextId = normalizeOptionalText$8(input.contextDelta?.agentControllerConversationId) ?? normalizeOptionalText$8(input.existingContextId);
|
|
4456
|
-
const agentControllerConversation = input.contextDelta?.agentControllerConversation ?? input.contextResolution?.agentControllerConversation ?? input.agentControllerConversationForDispatch;
|
|
4457
|
-
const effectiveRuntimeWorkingDirectory = normalizeOptionalWorkingDirectory(input.workingDirectory) ?? null;
|
|
4458
|
-
const runtimeWorkspaceFingerprint = effectiveRuntimeWorkingDirectory ? buildRuntimeWorkspaceFingerprint(effectiveRuntimeWorkingDirectory) : null;
|
|
4459
|
-
const promptTrace = input.promptTrace ?? null;
|
|
4460
|
-
if (input.basePayload.status === "success" || input.basePayload.status === "partial_success") {
|
|
4461
|
-
const candidate = openMeldDaemonTaskResultPayloadSchema.safeParse(buildResolvedTaskResultPayloadCandidate(input, {
|
|
4462
|
-
contextId,
|
|
4463
|
-
promptTrace,
|
|
4464
|
-
requireContextId: false,
|
|
4465
|
-
agentControllerConversation,
|
|
4466
|
-
effectiveRuntimeWorkingDirectory,
|
|
4467
|
-
runtimeWorkspaceFingerprint
|
|
4468
|
-
}));
|
|
4469
|
-
if (candidate.success) return candidate.data;
|
|
4470
|
-
return buildDispatchResultNormalizationFailure(input, {
|
|
4471
|
-
errorCode: "schema.invalid.runtime_response",
|
|
4472
|
-
errorMessage: "schema.invalid.runtime_response: failed to enrich runtime task result payload",
|
|
4473
|
-
errorType: "config"
|
|
4474
|
-
});
|
|
4475
|
-
}
|
|
4476
|
-
const candidate = openMeldDaemonTaskResultPayloadSchema.safeParse(buildResolvedTaskResultPayloadCandidate(input, {
|
|
4477
|
-
contextId,
|
|
4478
|
-
promptTrace,
|
|
4479
|
-
requireContextId: false,
|
|
4480
|
-
agentControllerConversation,
|
|
4481
|
-
effectiveRuntimeWorkingDirectory,
|
|
4482
|
-
runtimeWorkspaceFingerprint
|
|
4483
|
-
}));
|
|
4484
|
-
if (candidate.success) return candidate.data;
|
|
4485
|
-
return buildDispatchResultNormalizationFailure(input, {
|
|
4486
|
-
errorCode: "schema.invalid.runtime_response",
|
|
4487
|
-
errorMessage: "schema.invalid.runtime_response: failed to normalize failed runtime task payload",
|
|
4488
|
-
errorType: "config"
|
|
4489
|
-
});
|
|
4490
|
-
}
|
|
4491
|
-
function buildResolvedTaskResultPayloadCandidate(input, options) {
|
|
4492
|
-
const resolvedAgentControllerConversationId = options.requireContextId || options.contextId ? { agentControllerConversationId: options.contextId } : {};
|
|
4493
|
-
return {
|
|
4494
|
-
...input.basePayload,
|
|
4495
|
-
attemptId: input.attemptId,
|
|
4496
|
-
agentControllerRef: input.agentControllerRef,
|
|
4497
|
-
...resolvedAgentControllerConversationId,
|
|
4498
|
-
...options.agentControllerConversation ? { agentControllerConversation: options.agentControllerConversation } : {},
|
|
4499
|
-
...options.effectiveRuntimeWorkingDirectory ? { effectiveRuntimeWorkingDirectory: options.effectiveRuntimeWorkingDirectory } : {},
|
|
4500
|
-
...options.runtimeWorkspaceFingerprint ? { runtimeWorkspaceFingerprint: options.runtimeWorkspaceFingerprint } : {},
|
|
4501
|
-
...options.promptTrace ? { promptTrace: options.promptTrace } : {},
|
|
4502
|
-
...input.bootstrapTemplateFacts ? { bootstrapTemplateFacts: input.bootstrapTemplateFacts } : {},
|
|
4503
|
-
...input.dispatchExecution ? { dispatchExecution: input.dispatchExecution } : {},
|
|
4504
|
-
...input.openClawGatewayVisibility ? { openClawGatewayVisibility: input.openClawGatewayVisibility } : {},
|
|
4505
|
-
...input.openClawBinding ? { openClawBinding: input.openClawBinding } : {},
|
|
4506
|
-
...input.spaceAction ? { spaceAction: input.spaceAction } : {},
|
|
4507
|
-
...input.spaceAction && input.spaceActionProvenance ? { spaceActionProvenance: input.spaceActionProvenance } : {}
|
|
4508
|
-
};
|
|
4509
|
-
}
|
|
4510
|
-
function buildDispatchResultNormalizationFailure(input, error) {
|
|
4511
|
-
return buildFailedTaskResultPayload({
|
|
4512
|
-
attemptId: input.attemptId,
|
|
4513
|
-
agentControllerRef: input.agentControllerRef,
|
|
4514
|
-
errorCode: error.errorCode,
|
|
4515
|
-
errorMessage: error.errorMessage,
|
|
4516
|
-
errorType: error.errorType,
|
|
4517
|
-
sourceEventId: input.sourceEventId,
|
|
4518
|
-
suppressPublicOutcome: true,
|
|
4519
|
-
targetProfileId: input.targetProfileId,
|
|
4520
|
-
taskId: input.taskId
|
|
4521
|
-
});
|
|
4522
|
-
}
|
|
4523
|
-
function buildFailedTaskResultPayload(input) {
|
|
4524
|
-
const normalizedWorkingDirectory = normalizeOptionalWorkingDirectory(input.effectiveRuntimeWorkingDirectory) ?? null;
|
|
4525
|
-
const payload = openMeldDaemonTaskResultPayloadSchema.safeParse({
|
|
4526
|
-
status: "failed",
|
|
4527
|
-
attemptId: input.attemptId,
|
|
4528
|
-
taskId: input.taskId,
|
|
4529
|
-
sourceEventId: input.sourceEventId,
|
|
4530
|
-
agentId: input.targetProfileId,
|
|
4531
|
-
deduped: false,
|
|
4532
|
-
...input.agentControllerRef ? { agentControllerRef: input.agentControllerRef } : {},
|
|
4533
|
-
errorType: input.errorType,
|
|
4534
|
-
errorCode: input.errorCode,
|
|
4535
|
-
...input.suppressPublicOutcome === true ? { suppressPublicOutcome: true } : {},
|
|
4536
|
-
...input.promptTrace ? { promptTrace: input.promptTrace } : {},
|
|
4537
|
-
...input.projectFailureContext ? { projectFailureContext: input.projectFailureContext } : {},
|
|
4538
|
-
...input.openClawGatewayVisibility ? { openClawGatewayVisibility: input.openClawGatewayVisibility } : {},
|
|
4539
|
-
...input.openClawBinding ? { openClawBinding: input.openClawBinding } : {},
|
|
4540
|
-
...input.localOwnerConflict ? { localOwnerConflict: input.localOwnerConflict } : {},
|
|
4541
|
-
...input.agentControllerConversation ? { agentControllerConversation: input.agentControllerConversation } : {},
|
|
4542
|
-
...normalizedWorkingDirectory ? { effectiveRuntimeWorkingDirectory: normalizedWorkingDirectory } : {},
|
|
4543
|
-
errorMessage: input.errorMessage.startsWith(`${input.errorCode}:`) ? input.errorMessage : `${input.errorCode}: ${input.errorMessage}`
|
|
4544
|
-
});
|
|
4545
|
-
if (!payload.success) return {
|
|
4546
|
-
status: "failed",
|
|
4547
|
-
attemptId: input.attemptId,
|
|
4548
|
-
taskId: input.taskId,
|
|
4549
|
-
sourceEventId: input.sourceEventId,
|
|
4550
|
-
agentId: input.targetProfileId,
|
|
4551
|
-
deduped: false,
|
|
4552
|
-
suppressPublicOutcome: true,
|
|
4553
|
-
errorType: "internal",
|
|
4554
|
-
errorMessage: "dispatch.execution_failed: failed to construct task result payload"
|
|
4555
|
-
};
|
|
4556
|
-
return payload.data;
|
|
4557
|
-
}
|
|
4558
|
-
function sendDaemonFrame$1(inputSocket, input) {
|
|
4559
|
-
inputSocket.send(JSON.stringify(toCompatibleSpaceAddressingRequestWireValue({
|
|
4560
|
-
v: 1,
|
|
4561
|
-
code: input.code,
|
|
4562
|
-
payload: input.payload
|
|
4563
|
-
})));
|
|
4564
|
-
}
|
|
4565
|
-
//#endregion
|
|
4566
|
-
//#region src/local-service/dispatch/dispatch-result-outbox.ts
|
|
4567
|
-
const OUTBOX_SCHEMA = "openmeld-daemon-dispatch-result-outbox-v1";
|
|
4568
|
-
const OUTBOX_RECORD_SCHEMA = "openmeld-daemon-dispatch-result-outbox-record-v1";
|
|
4569
|
-
const RESULT_OUTBOX_FILE_NAME = "dispatch-result-outbox.json";
|
|
4570
|
-
const RESULT_OUTBOX_TEMP_FILE_NAME = "dispatch-result-outbox.tmp";
|
|
4571
|
-
const SEND_FAILURE_BACKOFF_MS = [
|
|
4572
|
-
1e3,
|
|
4573
|
-
5e3,
|
|
4574
|
-
15e3,
|
|
4575
|
-
3e4
|
|
4576
|
-
];
|
|
4577
|
-
const ACK_PENDING_BACKOFF_MS = [
|
|
4578
|
-
15e3,
|
|
4579
|
-
3e4,
|
|
4580
|
-
6e4
|
|
4581
|
-
];
|
|
4582
|
-
const acknowledgementWaiters = /* @__PURE__ */ new Map();
|
|
4583
|
-
const settlementWaiters = /* @__PURE__ */ new Map();
|
|
4584
|
-
function enqueueDispatchResultOutboxRecord(input) {
|
|
4585
|
-
const nowMs = Date.now();
|
|
4586
|
-
const record = {
|
|
4587
|
-
schema: OUTBOX_RECORD_SCHEMA,
|
|
4588
|
-
attemptCount: 0,
|
|
4589
|
-
attemptId: input.attemptId,
|
|
4590
|
-
blockedReasonCode: null,
|
|
4591
|
-
connectionGeneration: input.connectionGeneration,
|
|
4592
|
-
createdAtMs: nowMs,
|
|
4593
|
-
daemonSessionId: input.daemonSessionId,
|
|
4594
|
-
dispatchId: input.dispatchId,
|
|
4595
|
-
executionIdentityEcho: input.executionIdentityEcho,
|
|
4596
|
-
executionTokenEcho: input.executionTokenEcho ?? null,
|
|
4597
|
-
lastFailureReason: null,
|
|
4598
|
-
lastSendAtMs: null,
|
|
4599
|
-
leaseEpoch: input.leaseEpoch,
|
|
4600
|
-
nextAttemptAtMs: nowMs,
|
|
4601
|
-
runtimeCoordinatorExecutionId: input.runtimeCoordinatorExecutionId ?? null,
|
|
4602
|
-
taskId: input.taskId,
|
|
4603
|
-
taskResult: buildTaskResultEnvelope(sanitizeTaskResultPayload(input.payload)),
|
|
4604
|
-
updatedAtMs: nowMs
|
|
4605
|
-
};
|
|
4606
|
-
upsertOutboxRecord(input.ledgerPaths, record);
|
|
4607
|
-
const settlement = input.waitForSettlement ? registerDispatchResultOutboxSettlementWaiter({
|
|
4608
|
-
ledgerPaths: input.ledgerPaths,
|
|
4609
|
-
recordKey: buildRecordKey(record)
|
|
4610
|
-
}) : null;
|
|
4611
|
-
emitRunLine({
|
|
4612
|
-
presenter: input.presenter,
|
|
4613
|
-
code: "daemon.run.result_outbox_queued",
|
|
4614
|
-
text: `daemon result queued for durable delivery (${input.dispatchId})`,
|
|
4615
|
-
payload: {
|
|
4616
|
-
attemptId: input.attemptId,
|
|
4617
|
-
dispatchId: input.dispatchId,
|
|
4618
|
-
taskId: input.taskId
|
|
4619
|
-
}
|
|
4620
|
-
});
|
|
4621
|
-
flushDispatchResultOutbox({
|
|
4622
|
-
currentSocketRef: input.currentSocketRef,
|
|
4623
|
-
ledgerPaths: input.ledgerPaths,
|
|
4624
|
-
presenter: input.presenter
|
|
4625
|
-
});
|
|
4626
|
-
return settlement;
|
|
4627
|
-
}
|
|
4628
|
-
function acknowledgeDispatchResultOutboxRecord(input) {
|
|
4629
|
-
const acknowledgedAtMs = Date.now();
|
|
4630
|
-
const records = readOutboxRecords(input.ledgerPaths);
|
|
4631
|
-
const matchedRecordKeys = records.filter((record) => record.dispatchId === input.dispatchId && (!input.attemptId || record.attemptId === input.attemptId)).map(buildRecordKey);
|
|
4632
|
-
const nextRecords = records.flatMap((record) => {
|
|
4633
|
-
if (record.dispatchId !== input.dispatchId || input.attemptId && record.attemptId !== input.attemptId) return [record];
|
|
4634
|
-
if (input.ok || input.status === "review_required") return [];
|
|
4635
|
-
if (input.status === "retry_later") {
|
|
4636
|
-
const attemptCount = Math.max(1, record.attemptCount);
|
|
4637
|
-
return [{
|
|
4638
|
-
...record,
|
|
4639
|
-
blockedReasonCode: null,
|
|
4640
|
-
lastFailureReason: input.reasonCode ?? "daemon.dispatch.result_retry_later",
|
|
4641
|
-
nextAttemptAtMs: record.nextAttemptAtMs > acknowledgedAtMs ? record.nextAttemptAtMs : acknowledgedAtMs + resolveAckPendingBackoffMs(attemptCount),
|
|
4642
|
-
updatedAtMs: acknowledgedAtMs
|
|
4643
|
-
}];
|
|
4644
|
-
}
|
|
4645
|
-
return [{
|
|
4646
|
-
...record,
|
|
4647
|
-
blockedReasonCode: input.reasonCode ?? "daemon.dispatch.result_rejected",
|
|
4648
|
-
updatedAtMs: acknowledgedAtMs
|
|
4649
|
-
}];
|
|
4650
|
-
});
|
|
4651
|
-
writeOutboxRecords(input.ledgerPaths, nextRecords);
|
|
4652
|
-
const settlement = resolveDispatchResultOutboxSettlement(input);
|
|
4653
|
-
if (settlement) notifySettlementWaiters(input.ledgerPaths, matchedRecordKeys, settlement);
|
|
4654
|
-
const retryLater = !input.ok && input.status === "retry_later";
|
|
4655
|
-
let eventCode = "daemon.run.result_outbox_rejected";
|
|
4656
|
-
let eventText = `daemon result outbox rejected for dispatch ${input.dispatchId}: ${input.reasonCode ?? "unknown"}`;
|
|
4657
|
-
if (input.ok) {
|
|
4658
|
-
eventCode = "daemon.run.result_outbox_acknowledged";
|
|
4659
|
-
eventText = `daemon result outbox acknowledged for dispatch ${input.dispatchId}`;
|
|
4660
|
-
} else if (retryLater) {
|
|
4661
|
-
eventCode = "daemon.run.result_outbox_retry_later";
|
|
4662
|
-
eventText = `daemon result outbox will retry dispatch ${input.dispatchId}: ${input.reasonCode ?? "unknown"}`;
|
|
4663
|
-
}
|
|
4664
|
-
emitRunLine({
|
|
4665
|
-
presenter: input.presenter,
|
|
4666
|
-
code: eventCode,
|
|
4667
|
-
text: eventText,
|
|
4668
|
-
payload: {
|
|
4669
|
-
attemptId: input.attemptId,
|
|
4670
|
-
dispatchId: input.dispatchId,
|
|
4671
|
-
ok: input.ok,
|
|
4672
|
-
reasonCode: input.reasonCode ?? null,
|
|
4673
|
-
status: input.status ?? null
|
|
4674
|
-
}
|
|
4675
|
-
});
|
|
4676
|
-
}
|
|
4677
|
-
const registerDispatchResultOutboxSettlementWaiter = (input) => new Promise((resolve) => {
|
|
4678
|
-
const rootKey = input.ledgerPaths.rootDirPath;
|
|
4679
|
-
const waiters = settlementWaiters.get(rootKey) ?? /* @__PURE__ */ new Map();
|
|
4680
|
-
waiters.set(input.recordKey, resolve);
|
|
4681
|
-
settlementWaiters.set(rootKey, waiters);
|
|
4682
|
-
});
|
|
4683
|
-
function waitForDispatchResultOutboxAcknowledgement(input) {
|
|
4684
|
-
const recordKeys = new Set(input.recordKeys);
|
|
4685
|
-
if (recordKeys.size === 0 || !readOutboxRecords(input.ledgerPaths).some((record) => recordKeys.has(buildRecordKey(record)))) return Promise.resolve("acknowledged");
|
|
4686
|
-
return new Promise((resolve) => {
|
|
4687
|
-
const rootKey = input.ledgerPaths.rootDirPath;
|
|
4688
|
-
const waiters = acknowledgementWaiters.get(rootKey) ?? [];
|
|
4689
|
-
let settled = false;
|
|
4690
|
-
const settle = (result) => {
|
|
4691
|
-
if (settled) return;
|
|
4692
|
-
settled = true;
|
|
4693
|
-
input.abortSignal?.removeEventListener("abort", abort);
|
|
4694
|
-
const currentWaiters = acknowledgementWaiters.get(rootKey);
|
|
4695
|
-
if (currentWaiters) {
|
|
4696
|
-
const pendingWaiters = currentWaiters.filter((waiter) => waiter.resolve !== settle);
|
|
4697
|
-
if (pendingWaiters.length === 0) acknowledgementWaiters.delete(rootKey);
|
|
4698
|
-
else acknowledgementWaiters.set(rootKey, pendingWaiters);
|
|
4699
|
-
}
|
|
4700
|
-
resolve(result);
|
|
4701
|
-
};
|
|
4702
|
-
const abort = () => settle("aborted");
|
|
4703
|
-
if (input.abortSignal?.aborted) {
|
|
4704
|
-
abort();
|
|
4705
|
-
return;
|
|
4706
|
-
}
|
|
4707
|
-
waiters.push({
|
|
4708
|
-
recordKeys,
|
|
4709
|
-
resolve: settle
|
|
4710
|
-
});
|
|
4711
|
-
acknowledgementWaiters.set(rootKey, waiters);
|
|
4712
|
-
input.abortSignal?.addEventListener("abort", abort, { once: true });
|
|
4713
|
-
});
|
|
4714
|
-
}
|
|
4715
|
-
function listDispatchResultOutboxPendingAcknowledgementKeys(input) {
|
|
4716
|
-
return readOutboxRecords(input.ledgerPaths).filter((record) => record.blockedReasonCode === null).map(buildRecordKey);
|
|
4717
|
-
}
|
|
4718
|
-
function flushDispatchResultOutbox(input) {
|
|
4719
|
-
const socket = input.currentSocketRef.socket;
|
|
4720
|
-
const activeConnectionGeneration = input.currentSocketRef.connectionGeneration;
|
|
4721
|
-
if (!socket || activeConnectionGeneration === null) return;
|
|
4722
|
-
const nowMs = Date.now();
|
|
4723
|
-
const records = readOutboxRecords(input.ledgerPaths);
|
|
4724
|
-
let changed = false;
|
|
4725
|
-
const nextRecords = records.map((record) => {
|
|
4726
|
-
const connectionChanged = record.connectionGeneration !== activeConnectionGeneration;
|
|
4727
|
-
if (record.blockedReasonCode || !connectionChanged && record.nextAttemptAtMs > nowMs) return record;
|
|
4728
|
-
try {
|
|
4729
|
-
sendDispatchResultEnvelopeFrame({
|
|
4730
|
-
attemptId: record.attemptId,
|
|
4731
|
-
connectionGeneration: activeConnectionGeneration,
|
|
4732
|
-
daemonSessionId: record.daemonSessionId,
|
|
4733
|
-
dispatchId: record.dispatchId,
|
|
4734
|
-
executionIdentityEcho: record.executionIdentityEcho,
|
|
4735
|
-
executionTokenEcho: record.executionTokenEcho ?? null,
|
|
4736
|
-
leaseEpoch: record.leaseEpoch,
|
|
4737
|
-
runtimeCoordinatorExecutionId: record.runtimeCoordinatorExecutionId ?? null,
|
|
4738
|
-
socket,
|
|
4739
|
-
taskResult: record.taskResult
|
|
4740
|
-
});
|
|
4741
|
-
emitDaemonDispatchJournalEvent({
|
|
4742
|
-
attemptId: record.attemptId,
|
|
4743
|
-
connectionGeneration: activeConnectionGeneration,
|
|
4744
|
-
daemonSessionId: record.daemonSessionId,
|
|
4745
|
-
dispatchId: record.dispatchId,
|
|
4746
|
-
leaseEpoch: record.leaseEpoch,
|
|
4747
|
-
metadata: {
|
|
4748
|
-
delivery: "outbox_flush",
|
|
4749
|
-
queuedForMs: Math.max(0, nowMs - record.createdAtMs),
|
|
4750
|
-
replayedAfterReconnect: connectionChanged,
|
|
4751
|
-
outboxAttemptCount: record.attemptCount + 1
|
|
4752
|
-
},
|
|
4753
|
-
result: record.taskResult.payload.status,
|
|
4754
|
-
taskId: record.taskId,
|
|
4755
|
-
type: "dispatch.result.sent"
|
|
4756
|
-
});
|
|
4757
|
-
changed = true;
|
|
4758
|
-
return {
|
|
4759
|
-
...record,
|
|
4760
|
-
attemptCount: record.attemptCount + 1,
|
|
4761
|
-
connectionGeneration: activeConnectionGeneration,
|
|
4762
|
-
lastFailureReason: null,
|
|
4763
|
-
lastSendAtMs: nowMs,
|
|
4764
|
-
nextAttemptAtMs: nowMs + resolveAckPendingBackoffMs(record.attemptCount + 1),
|
|
4765
|
-
updatedAtMs: nowMs
|
|
4766
|
-
};
|
|
4767
|
-
} catch (error) {
|
|
4768
|
-
changed = true;
|
|
4769
|
-
return {
|
|
4770
|
-
...record,
|
|
4771
|
-
attemptCount: record.attemptCount + 1,
|
|
4772
|
-
connectionGeneration: activeConnectionGeneration,
|
|
4773
|
-
lastFailureReason: toErrorMessage(error),
|
|
4774
|
-
nextAttemptAtMs: nowMs + resolveSendFailureBackoffMs(record.attemptCount + 1),
|
|
4775
|
-
updatedAtMs: nowMs
|
|
4776
|
-
};
|
|
4777
|
-
}
|
|
4778
|
-
});
|
|
4779
|
-
if (changed) writeOutboxRecords(input.ledgerPaths, nextRecords);
|
|
4780
|
-
}
|
|
4781
|
-
const sanitizeTaskResultPayload = (payload) => {
|
|
4782
|
-
const { bootstrapTemplateFacts: _bootstrapTemplateFacts, promptTrace: _promptTrace, ...safePayload } = payload;
|
|
4783
|
-
return safePayload;
|
|
4784
|
-
};
|
|
4785
|
-
const resolveAckPendingBackoffMs = (attemptCount) => {
|
|
4786
|
-
const index = Math.min(ACK_PENDING_BACKOFF_MS.length - 1, Math.max(0, attemptCount - 1));
|
|
4787
|
-
const backoffMs = ACK_PENDING_BACKOFF_MS[index];
|
|
4788
|
-
return typeof backoffMs === "number" ? backoffMs : 6e4;
|
|
4789
|
-
};
|
|
4790
|
-
const resolveSendFailureBackoffMs = (attemptCount) => {
|
|
4791
|
-
const index = Math.min(SEND_FAILURE_BACKOFF_MS.length - 1, Math.max(0, attemptCount - 1));
|
|
4792
|
-
const backoffMs = SEND_FAILURE_BACKOFF_MS[index];
|
|
4793
|
-
return typeof backoffMs === "number" ? backoffMs : 3e4;
|
|
4794
|
-
};
|
|
4795
|
-
const upsertOutboxRecord = (ledgerPaths, record) => {
|
|
4796
|
-
const records = readOutboxRecords(ledgerPaths);
|
|
4797
|
-
const key = buildRecordKey(record);
|
|
4798
|
-
const nextRecords = [...records.filter((candidate) => buildRecordKey(candidate) !== key), record].sort((left, right) => left.createdAtMs - right.createdAtMs);
|
|
4799
|
-
writeOutboxRecords(ledgerPaths, nextRecords);
|
|
4800
|
-
};
|
|
4801
|
-
const readOutboxRecords = (ledgerPaths) => {
|
|
4802
|
-
const outboxPath = resolveOutboxPath(ledgerPaths);
|
|
4803
|
-
if (!existsSync(outboxPath)) return [];
|
|
4804
|
-
const parsed = JSON.parse(readFileSync(outboxPath, "utf8"));
|
|
4805
|
-
if (parsed.schema !== OUTBOX_SCHEMA || !Array.isArray(parsed.records)) return [];
|
|
4806
|
-
return parsed.records.filter(isDispatchResultOutboxRecord);
|
|
4807
|
-
};
|
|
4808
|
-
const writeOutboxRecords = (ledgerPaths, records) => {
|
|
4809
|
-
const outboxPath = resolveOutboxPath(ledgerPaths);
|
|
4810
|
-
const tempPath = join(ledgerPaths.rootDirPath, RESULT_OUTBOX_TEMP_FILE_NAME);
|
|
4811
|
-
mkdirSync(dirname(outboxPath), { recursive: true });
|
|
4812
|
-
writeFileSync(tempPath, JSON.stringify({
|
|
4813
|
-
schema: OUTBOX_SCHEMA,
|
|
4814
|
-
v: 1,
|
|
4815
|
-
records,
|
|
4816
|
-
updatedAtMs: Date.now()
|
|
4817
|
-
}, null, 2), "utf8");
|
|
4818
|
-
renameSync(tempPath, outboxPath);
|
|
4819
|
-
notifyAcknowledgementWaiters(ledgerPaths, records);
|
|
4820
|
-
};
|
|
4821
|
-
const resolveOutboxPath = (ledgerPaths) => {
|
|
4822
|
-
return join(ledgerPaths.rootDirPath, RESULT_OUTBOX_FILE_NAME);
|
|
4823
|
-
};
|
|
4824
|
-
const buildRecordKey = (record) => {
|
|
4825
|
-
return `${record.dispatchId}::${record.attemptId}`;
|
|
4826
|
-
};
|
|
4827
|
-
const notifyAcknowledgementWaiters = (ledgerPaths, records) => {
|
|
4828
|
-
const rootKey = ledgerPaths.rootDirPath;
|
|
4829
|
-
const waiters = acknowledgementWaiters.get(rootKey);
|
|
4830
|
-
if (!waiters) return;
|
|
4831
|
-
const retainedKeys = new Set(records.filter((record) => record.blockedReasonCode === null).map(buildRecordKey));
|
|
4832
|
-
const pendingWaiters = waiters.filter((waiter) => {
|
|
4833
|
-
const isPending = [...waiter.recordKeys].some((key) => retainedKeys.has(key));
|
|
4834
|
-
if (!isPending) waiter.resolve("acknowledged");
|
|
4835
|
-
return isPending;
|
|
4836
|
-
});
|
|
4837
|
-
if (pendingWaiters.length === 0) {
|
|
4838
|
-
acknowledgementWaiters.delete(rootKey);
|
|
4839
|
-
return;
|
|
4840
|
-
}
|
|
4841
|
-
acknowledgementWaiters.set(rootKey, pendingWaiters);
|
|
4842
|
-
};
|
|
4843
|
-
const resolveDispatchResultOutboxSettlement = (input) => {
|
|
4844
|
-
if (input.ok) return { status: "accepted" };
|
|
4845
|
-
if (input.status === "review_required" && input.reasonCode === "space.agent_reply.context_changed") return {
|
|
4846
|
-
reasonCode: input.reasonCode,
|
|
4847
|
-
status: "review_required"
|
|
4848
|
-
};
|
|
4849
|
-
if (input.status === "rejected_terminal") return {
|
|
4850
|
-
reasonCode: input.reasonCode ?? "daemon.dispatch.result_rejected",
|
|
4851
|
-
status: "rejected_terminal"
|
|
4852
|
-
};
|
|
4853
|
-
return null;
|
|
4854
|
-
};
|
|
4855
|
-
const notifySettlementWaiters = (ledgerPaths, recordKeys, settlement) => {
|
|
4856
|
-
const rootKey = ledgerPaths.rootDirPath;
|
|
4857
|
-
const waiters = settlementWaiters.get(rootKey);
|
|
4858
|
-
if (!waiters) return;
|
|
4859
|
-
for (const recordKey of recordKeys) {
|
|
4860
|
-
const resolve = waiters.get(recordKey);
|
|
4861
|
-
if (!resolve) continue;
|
|
4862
|
-
waiters.delete(recordKey);
|
|
4863
|
-
resolve(settlement);
|
|
4864
|
-
}
|
|
4865
|
-
if (waiters.size === 0) settlementWaiters.delete(rootKey);
|
|
4866
|
-
};
|
|
4867
|
-
const isDispatchResultOutboxRecord = (value) => {
|
|
4868
|
-
const candidate = value;
|
|
4869
|
-
return candidate.schema === OUTBOX_RECORD_SCHEMA && typeof candidate.attemptId === "string" && typeof candidate.dispatchId === "string" && typeof candidate.daemonSessionId === "string" && typeof candidate.executionIdentityEcho === "object" && candidate.executionIdentityEcho !== null && typeof candidate.leaseEpoch === "number" && typeof candidate.connectionGeneration === "number" && typeof candidate.taskId === "string" && typeof candidate.taskResult === "object" && candidate.taskResult !== null && typeof candidate.createdAtMs === "number" && typeof candidate.updatedAtMs === "number" && typeof candidate.nextAttemptAtMs === "number" && typeof candidate.attemptCount === "number";
|
|
4870
|
-
};
|
|
4871
|
-
//#endregion
|
|
4872
4270
|
//#region src/local-service/inventory/agent-controller-interface-keeper.ts
|
|
4873
4271
|
const LAST_GOOD_REUSE_TTL_MS = 15 * 6e4;
|
|
4874
4272
|
const AGENT_CONTROLLER_INTERFACE_REPROBE_DELAY_MS = 45e3;
|
|
@@ -4907,9 +4305,8 @@ function recordAgentControllerInterfaceProbeSuccess(input) {
|
|
|
4907
4305
|
});
|
|
4908
4306
|
const passiveUsageLimits = existingEntry?.passiveUsageLimits ?? [];
|
|
4909
4307
|
const canBindPassiveUsageLimits = !isAgentControllerUsageAccountUnavailable(input.snapshot.usageLimits) && areAgentControllerInterfaceAccountsSame(existingEntry?.passiveUsageLimitsAuth, input.snapshot.auth);
|
|
4910
|
-
let
|
|
4911
|
-
if (
|
|
4912
|
-
else if (canBindPassiveUsageLimits && passiveUsageLimits.length > 0) authenticatedSnapshot = {
|
|
4308
|
+
let completedSnapshot = input.snapshot;
|
|
4309
|
+
if (canBindPassiveUsageLimits && passiveUsageLimits.length > 0) completedSnapshot = {
|
|
4913
4310
|
...input.snapshot,
|
|
4914
4311
|
usageLimits: mergeObservedUsageLimits({
|
|
4915
4312
|
existing: input.snapshot.usageLimits,
|
|
@@ -4918,15 +4315,15 @@ function recordAgentControllerInterfaceProbeSuccess(input) {
|
|
|
4918
4315
|
};
|
|
4919
4316
|
keeperEntries.set(input.keeperKey, {
|
|
4920
4317
|
commandFingerprint: input.commandFingerprint,
|
|
4921
|
-
lastGoodSnapshot:
|
|
4318
|
+
lastGoodSnapshot: completedSnapshot,
|
|
4922
4319
|
lastSuccessfulCheckAt: input.snapshot.checkedAt,
|
|
4923
4320
|
lastSuccessAtMs: input.nowMs,
|
|
4924
|
-
passiveUsageLimits:
|
|
4925
|
-
passiveUsageLimitsAuth:
|
|
4321
|
+
passiveUsageLimits: canBindPassiveUsageLimits ? passiveUsageLimits : [],
|
|
4322
|
+
passiveUsageLimitsAuth: canBindPassiveUsageLimits ? input.snapshot.auth : null,
|
|
4926
4323
|
reuseInvalidatedByProbeFailure: false,
|
|
4927
4324
|
reprobe: "idle"
|
|
4928
4325
|
});
|
|
4929
|
-
return
|
|
4326
|
+
return completedSnapshot;
|
|
4930
4327
|
}
|
|
4931
4328
|
function recordAgentControllerUsageLimitsObservation(input) {
|
|
4932
4329
|
if (input.usageLimits.length === 0 || !hasStableProviderAccountIdentity(input.authSnapshot)) return false;
|
|
@@ -5052,6 +4449,42 @@ function resolveNextRuntimeAgentControllerReportSyncAtMs(input) {
|
|
|
5052
4449
|
return Math.min(baseNextMs, input.nowMs + AGENT_CONTROLLER_INTERFACE_REPROBE_DELAY_MS);
|
|
5053
4450
|
}
|
|
5054
4451
|
//#endregion
|
|
4452
|
+
//#region src/local-service/projects/service-git-environment.ts
|
|
4453
|
+
/** Service inspection/preparation never executes repository-provided commands. */
|
|
4454
|
+
function createServiceGitEnvironment() {
|
|
4455
|
+
const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.startsWith("GIT_")));
|
|
4456
|
+
const settings = {
|
|
4457
|
+
"core.hooksPath": "/dev/null",
|
|
4458
|
+
"core.attributesFile": "/dev/null",
|
|
4459
|
+
"core.fsmonitor": "false",
|
|
4460
|
+
"core.sshCommand": "false",
|
|
4461
|
+
"credential.helper": "",
|
|
4462
|
+
"protocol.allow": "never",
|
|
4463
|
+
"protocol.file.allow": "always",
|
|
4464
|
+
"fetch.recurseSubmodules": "false",
|
|
4465
|
+
"submodule.recurse": "false",
|
|
4466
|
+
"uploadpack.packObjectsHook": "",
|
|
4467
|
+
"gc.auto": "0",
|
|
4468
|
+
"maintenance.auto": "false"
|
|
4469
|
+
};
|
|
4470
|
+
Object.assign(env, {
|
|
4471
|
+
GIT_CONFIG_NOSYSTEM: "1",
|
|
4472
|
+
GIT_CONFIG_SYSTEM: "/dev/null",
|
|
4473
|
+
GIT_CONFIG_GLOBAL: "/dev/null",
|
|
4474
|
+
GIT_ATTR_NOSYSTEM: "1",
|
|
4475
|
+
GIT_NO_REPLACE_OBJECTS: "1",
|
|
4476
|
+
GIT_NO_LAZY_FETCH: "1",
|
|
4477
|
+
GIT_ALLOW_PROTOCOL: "file",
|
|
4478
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
4479
|
+
GIT_CONFIG_COUNT: String(Object.keys(settings).length)
|
|
4480
|
+
});
|
|
4481
|
+
for (const [index, [key, value]] of Object.entries(settings).entries()) {
|
|
4482
|
+
env[`GIT_CONFIG_KEY_${index}`] = key;
|
|
4483
|
+
env[`GIT_CONFIG_VALUE_${index}`] = value;
|
|
4484
|
+
}
|
|
4485
|
+
return env;
|
|
4486
|
+
}
|
|
4487
|
+
//#endregion
|
|
5055
4488
|
//#region src/agent-activity/hook-projection-store.ts
|
|
5056
4489
|
const STORE_LIMIT = 2e3;
|
|
5057
4490
|
const HOOK_RECONCILIATION_GRACE_MS = 2 * 6e4;
|
|
@@ -7163,6 +6596,6 @@ function prependPathEntry(input) {
|
|
|
7163
6596
|
return [input.nextEntry, ...dedupedEntries].join(delimiter);
|
|
7164
6597
|
}
|
|
7165
6598
|
//#endregion
|
|
7166
|
-
export {
|
|
6599
|
+
export { readComputerFileAccessPolicy as $, isWakeClosingSystemNoticeType as $t, AgentActivitySubmissionResultsMismatchError as A, buildPublicSpaceEntryUrl as At, didAgentControllerCommandFingerprintRemainStable as B, buildUpdatesReplyWorkflowProjection as Bt, buildAgentActivityEvent as C, getOrganizationJoinLinkResponseSchema as Cn, updateSpaceLastSeenTs as Ct, drainAgentActivityHookInbox as D, SpaceComposerSubmissionError as Dt, readCodexSessionTitles as E, revokeOrganizationJoinLinkResponseSchema as En, writeSpaceRecentMentionProfileIds as Et, removeProjectOutbox as F, buildSpaceMentionProfileIndex as Ft, recordAgentControllerInterfaceProbeFailure as G, createSpaceTargetCatalog as Gt, readLastKnownAgentControllerUsageLimits as H, collectResolvedSpaceMentions as Ht, readRecentAgentActivityHookStatus as I, buildSpaceMessageReadRelationSummary as It, resolveAgentControllerCommandFingerprint as J, formatRemovedCcRelationMessage as Jt, recordAgentControllerInterfaceProbeSuccess as K, enterRelationPickerState as Kt, createServiceGitEnvironment as L, buildSpaceProfileAddPlan as Lt, deferAgentActivityOutbox as M, buildSignalMessageReadProjection as Mt, readAgentActivityOutboxHealth as N, buildSignalReplyWorkflowProjection as Nt, enqueueAgentActivityHookEvent as O, buildDispatchResultMessageReadProjection as Ot, readDueAgentActivityOutbox as P, buildSpaceMemberAgentPresencePresentation as Pt, ComputerFileAccessStoreError as Q, isTargetPickerState as Qt, buildAgentControllerInterfaceKeeperKey as R, buildSpaceRoundReadProjection as Rt, resolveOpenCodeDatabasePath as S, acceptOrganizationJoinLinkBodySchema as Sn, toSpaceConfigListIntegrityError as St, normalizeSharedSessionTitle as T, organizationJoinLinkManagementQuerySchema as Tn, writeSpaceCacheDeletionNoticeState as Tt, readLastSuccessfulAgentControllerInterfaceCheckAt as U, createDispatchContinuationSpaceAccessContext as Ut, readLastKnownAgentControllerAuthSnapshot as V, closeMentionPickerState as Vt, readReusableAgentControllerInterfaceSnapshot as W, createSpaceMemberIdentityIndex as Wt, emitDaemonDispatchJournalEvent as X, getSpaceAccessRequestContext as Xt, resolveNextRuntimeAgentControllerReportSyncAtMs as Y, getSpaceAccessPassword as Yt, readRecentDaemonDispatchJournalEvents as Z, isRelationPickerState as Zt, collectObservedSessionWorkingDirectories as _, cliJsonSkillsAddPreviewEnvelopeSchema as _n, readSpaceConfig as _t, DispatchSpaceActionClosedError as a, prepareSpaceFileOnlySubmission as an, buildDispatchPromptPlan as at, readOpenCodeSessionRows as b, cliJsonSkillsScanEnvelopeSchema as bn, removeSpaceConfig as bt, createDispatchSpaceActionContext as c, returnToTargetPickerState as cn, resolveBootstrapSpaceOwnerProfileId as ct, readDispatchSpaceActionRecord as d, DISPATCH_SPACE_ACTION_CLI_FALLBACK_COMMAND as dn, projectSpaceProfileCache as dt, listSpaceMemberDirectorySendTargets as en, resolveComputerFileAccessStorePath as et, supersedeDispatchSpaceActionRecordForReconsideration as f, OPENMELD_DISPATCH_RUNTIME_MODE_ENV as fn, LocalSpaceStateIntegrityError as ft, sendDaemonFrame as g, cliJsonSkillsAddEnvelopeSchema as gn, readSpaceCacheDeletionNoticeState as gt, parseDaemonFrame as h, cliJsonSkillsAddAllEnvelopeSchema as hn, listSpaceConfigs as ht, readDispatchOwnedRuntimeGuard as i, prepareSpaceComposerSubmission as in, buildDispatchCorrelation as it, applyAgentActivitySubmissionResults as j, buildSignalIndex as jt, removeProjectInbox as k, buildDispatchResultReplyWorkflowProjection as kt, readDispatchSpaceActionContextForReceiptFromEnv as l, updateAuthoredMentionRanges as ln, resolveBootstrapTargetProfileContext as lt, handleDaemonTransportFrame as m, cliJsonOutputEnvelopeSchema as mn, isLocalSpaceStateCorruptResult as mt, assertDispatchOwnedRuntimeServiceMutationAllowed as n, listSpaceMentionSuggestions as nn, isSameOrDescendantPath as nt, DispatchSpaceActionRejectedError as o, resolveNextRecentMentionProfileIdsForQueuedText as on, buildDispatchSessionTitle as ot, writeDispatchSpaceActionRecord as p, cliJsonErrorEnvelopeSchema as pn, inspectSpaceCacheFile as pt, recordAgentControllerUsageLimitsObservation as q, extractMentionAuthoringPrefix as qt, buildDispatchOwnedRuntimeEnv as r, openTargetPickerState as rn, buildDispatchBootstrapTemplateFacts as rt, OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV as s, resolveSpaceMemberAgentOwnerWakeDiagnosticsView as sn, parseDispatchTask as st, assertDispatchOwnedRuntimePublicWriteAllowed as t, listSpaceMentionRelationChoices as tn, updateComputerFileAccessPolicy as tt, readDispatchSpaceActionContextFromEnv as u, DISPATCH_OWNED_RUNTIME_MODE as un, resolveDispatchMentionSourceContext as ut, scanLocalAgentActivity as v, cliJsonSkillsListEnvelopeSchema as vn, readSpaceLastSeenTs as vt, resolveObservedAgentActivityBinding as w, organizationJoinLinkErrorResponseSchema as wn, upsertSpaceConfig as wt, resolveOpenCodeAuthPath as x, cliJsonSkillsShowEnvelopeSchema as xn, toLocalSpaceStateIntegrityError as xt, startAgentActivityTranscriptWatchers as y, cliJsonSkillsLoadEnvelopeSchema as yn, readSpaceRecentMentionProfileIds as yt, consumeArmedAgentControllerInterfaceReprobe as z, buildSpaceRoundSignalPublication as zt };
|
|
7167
6600
|
|
|
7168
|
-
//# sourceMappingURL=dispatch-owned-runtime-
|
|
6601
|
+
//# sourceMappingURL=dispatch-owned-runtime-FNjbFwSu.js.map
|