openmeld 0.3.232 → 0.3.234
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-ChntsjGm.js → add-me-membership-CmHUjDvu.js} +2 -2
- package/dist/{add-me-membership-ChntsjGm.js.map → add-me-membership-CmHUjDvu.js.map} +1 -1
- package/dist/{agents-DruPcNSg.js → agents-CNW1dony.js} +9 -9
- package/dist/{agents-DruPcNSg.js.map → agents-CNW1dony.js.map} +1 -1
- package/dist/{api-client-foundation-CDj_9Rks.js → api-client-foundation-BHjffwwr.js} +1 -1
- package/dist/{api-client-foundation-EZpFLGVC.js → api-client-foundation-D6zHrrGV.js} +3 -3
- package/dist/{api-client-foundation-EZpFLGVC.js.map → api-client-foundation-D6zHrrGV.js.map} +1 -1
- package/dist/auth-session-CCLabxRT.js +4 -0
- package/dist/{auth-session-DhSHCYvl.js → auth-session-CjxqNKvh.js} +4 -4
- package/dist/{auth-session-DhSHCYvl.js.map → auth-session-CjxqNKvh.js.map} +1 -1
- package/dist/{channel-tvFZSSVr.js → channel-BW2_rI6u.js} +4 -4
- package/dist/{channel-tvFZSSVr.js.map → channel-BW2_rI6u.js.map} +1 -1
- package/dist/{cli-binary-manifest-Bjf6T7Ef.js → cli-binary-manifest-ETxqCzfS.js} +8 -1
- package/dist/cli-binary-manifest-ETxqCzfS.js.map +1 -0
- package/dist/{command-0yoZa1GT.js → command-9Iorb5GA.js} +16 -16
- package/dist/{command-0yoZa1GT.js.map → command-9Iorb5GA.js.map} +1 -1
- package/dist/{computer-connection-CoBDorh6.js → computer-connection-LX1R7jD0.js} +2 -2
- package/dist/{computer-connection-CoBDorh6.js.map → computer-connection-LX1R7jD0.js.map} +1 -1
- package/dist/{computer-connection-review-Dy7p1LXZ.js → computer-connection-review-CeOHkloT.js} +5 -5
- package/dist/{computer-connection-review-Dy7p1LXZ.js.map → computer-connection-review-CeOHkloT.js.map} +1 -1
- package/dist/{computer-disconnect-4Ks_DVXV.js → computer-disconnect-CXDO8zgT.js} +7 -7
- package/dist/{computer-disconnect-4Ks_DVXV.js.map → computer-disconnect-CXDO8zgT.js.map} +1 -1
- package/dist/{computer-setup-continuation-ZcQb7MvI.js → computer-setup-continuation-XgvjM0jF.js} +3 -3
- package/dist/{computer-setup-continuation-ZcQb7MvI.js.map → computer-setup-continuation-XgvjM0jF.js.map} +1 -1
- package/dist/{context-BPIoofMa.js → context-D3GnSqg8.js} +3 -3
- package/dist/{context-BPIoofMa.js.map → context-D3GnSqg8.js.map} +1 -1
- package/dist/{control-plane-rTE2rHZ5.js → control-plane-QqGL-jtT.js} +2 -2
- package/dist/{control-plane-rTE2rHZ5.js.map → control-plane-QqGL-jtT.js.map} +1 -1
- package/dist/{daemon-device-id-DDazRZUV.js → daemon-device-id-OMqh2F9_.js} +5 -5
- package/dist/{daemon-device-id-DDazRZUV.js.map → daemon-device-id-OMqh2F9_.js.map} +1 -1
- package/dist/{daemon-lifecycle-journal-CRxQL9m6.js → daemon-lifecycle-journal-Dq8W9V9C.js} +6 -6
- package/dist/{daemon-lifecycle-journal-CRxQL9m6.js.map → daemon-lifecycle-journal-Dq8W9V9C.js.map} +1 -1
- package/dist/{daemon-service-runtime-BTzL0w6s.js → daemon-service-runtime-B-x4bBKx.js} +4 -4
- package/dist/{daemon-service-runtime-BTzL0w6s.js.map → daemon-service-runtime-B-x4bBKx.js.map} +1 -1
- package/dist/{daemon-service-update-coordinator-BDs0p4bA.js → daemon-service-update-coordinator-Brv_30Kn.js} +20 -18
- package/dist/{daemon-service-update-coordinator-BDs0p4bA.js.map → daemon-service-update-coordinator-Brv_30Kn.js.map} +1 -1
- package/dist/{dispatch-owned-runtime-CK2YJ2Oo.js → dispatch-owned-runtime-Czq270vy.js} +52 -619
- package/dist/dispatch-owned-runtime-Czq270vy.js.map +1 -0
- package/dist/{dist-Bw6OBFYo.js → dist-CJL7LE-y.js} +203 -362
- package/dist/dist-CJL7LE-y.js.map +1 -0
- package/dist/{dist--TaSMxQz.js → dist-Ccpvj1tf.js} +3 -3
- package/dist/{dist--TaSMxQz.js.map → dist-Ccpvj1tf.js.map} +1 -1
- package/dist/{dist-B12upl5l.js → dist-MpN-h8da.js} +1 -1
- package/dist/{elapsed-time-C3nfbdd9.js → elapsed-time-BSphCejK.js} +6 -6
- package/dist/{elapsed-time-C3nfbdd9.js.map → elapsed-time-BSphCejK.js.map} +1 -1
- package/dist/{entry-De__5RVq.js → entry-CDablKgv.js} +7 -7
- package/dist/{entry-De__5RVq.js.map → entry-CDablKgv.js.map} +1 -1
- package/dist/{installation-inventory-Bq8iZfSa.js → installation-inventory-CRnah3Xf.js} +3 -3
- package/dist/{installation-inventory-Bq8iZfSa.js.map → installation-inventory-CRnah3Xf.js.map} +1 -1
- package/dist/{installer-C7iSAOSz.js → installer-BYBrLBth.js} +2 -2
- package/dist/{installer-C7iSAOSz.js.map → installer-BYBrLBth.js.map} +1 -1
- package/dist/{local-components-DleLEzSU.js → local-components-DJiMS67S.js} +36 -3
- package/dist/local-components-DJiMS67S.js.map +1 -0
- package/dist/{meta-api-BpwJWE22.js → meta-api-ClHCkzZB.js} +4 -4
- package/dist/{meta-api-BpwJWE22.js.map → meta-api-ClHCkzZB.js.map} +1 -1
- package/dist/{openmeld-C0OSZJtn.js → openmeld-Yz7J0OaB.js} +32 -32
- package/dist/{openmeld-C0OSZJtn.js.map → openmeld-Yz7J0OaB.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-DY90mkWW.js → openmeld-maintenance-worker-CVjbc-dv.js} +9 -9
- package/dist/{openmeld-maintenance-worker-DY90mkWW.js.map → openmeld-maintenance-worker-CVjbc-dv.js.map} +1 -1
- package/dist/{openmeld-tools-update-join-DgzNuaDy.js → openmeld-tools-update-join-Em7DfQt6.js} +4 -4
- package/dist/{openmeld-tools-update-join-DgzNuaDy.js.map → openmeld-tools-update-join-Em7DfQt6.js.map} +1 -1
- package/dist/{openmeld-tools-update-process-frame-DbEZ3fEh.js → openmeld-tools-update-process-frame-Csy2XKUf.js} +1 -1
- package/dist/{openmeld-tools-update-process-frame-BtFKp70p.js → openmeld-tools-update-process-frame-YLOS82E3.js} +2 -2
- package/dist/{openmeld-tools-update-process-frame-BtFKp70p.js.map → openmeld-tools-update-process-frame-YLOS82E3.js.map} +1 -1
- package/dist/openmeld.js +5 -5
- package/dist/{prepare-provider-runtime-BGdfbFyZ.js → prepare-provider-runtime-Bf2GBijn.js} +537 -213
- package/dist/prepare-provider-runtime-Bf2GBijn.js.map +1 -0
- package/dist/{prepare-session-executor-CA1gq8dR.js → prepare-session-executor-D8Vbyoq4.js} +19 -19
- package/dist/{prepare-session-executor-CA1gq8dR.js.map → prepare-session-executor-D8Vbyoq4.js.map} +1 -1
- package/dist/{process-channel-C1wRGUmk.js → process-channel-CTPL81j6.js} +2 -2
- package/dist/{process-channel-C1wRGUmk.js.map → process-channel-CTPL81j6.js.map} +1 -1
- package/dist/{runtime-DFlEdls4.js → runtime-aUrBNKSl.js} +7860 -7249
- package/dist/runtime-aUrBNKSl.js.map +1 -0
- package/dist/{runtime-agent-controller-reporting-submission-C_xD2A-P.js → runtime-agent-controller-reporting-submission-BJY9cLyh.js} +146 -70
- package/dist/runtime-agent-controller-reporting-submission-BJY9cLyh.js.map +1 -0
- package/dist/{runtime-transport-DH8Ks-AU.js → runtime-transport-DyBmX7ds.js} +569 -30
- package/dist/runtime-transport-DyBmX7ds.js.map +1 -0
- package/dist/{service-KHA_Yv8q.js → service-CMNaJrvV.js} +105 -39
- package/dist/service-CMNaJrvV.js.map +1 -0
- package/dist/{service-account-authorization-BHWs8cRP.js → service-account-authorization-CdyvPbvg.js} +2 -2
- package/dist/{service-account-authorization-BHWs8cRP.js.map → service-account-authorization-CdyvPbvg.js.map} +1 -1
- package/dist/{service-account-control-BcHjpVid.js → service-account-control-jnKTjLAR.js} +9 -9
- package/dist/{service-account-control-BcHjpVid.js.map → service-account-control-jnKTjLAR.js.map} +1 -1
- package/dist/{service-control-capabilities-B4433dGT.js → service-control-capabilities-CRsFO-Jf.js} +3 -3
- package/dist/{service-control-capabilities-B4433dGT.js.map → service-control-capabilities-CRsFO-Jf.js.map} +1 -1
- package/dist/{service-control-capabilities-DTKD2-o0.js → service-control-capabilities-DpJNUd1S.js} +1 -1
- package/dist/{state-iJqU2XWw.js → state-CON1kJsS.js} +2 -2
- package/dist/{state-iJqU2XWw.js.map → state-CON1kJsS.js.map} +1 -1
- package/dist/{runtime-reporting-health-state-_bvJcV1y.js → updates-api-BpWiCpAo.js} +378 -209
- package/dist/updates-api-BpWiCpAo.js.map +1 -0
- package/dist/{upgrade-DlBDEvs4.js → upgrade-Bdh732dG.js} +8 -8
- package/dist/{upgrade-DlBDEvs4.js.map → upgrade-Bdh732dG.js.map} +1 -1
- package/dist/upgrade-frLu7pCB.js +4 -0
- package/package.json +13 -13
- package/dist/auth-session-BOG3gV2K2.js +0 -4
- package/dist/cli-binary-manifest-Bjf6T7Ef.js.map +0 -1
- package/dist/dispatch-owned-runtime-CK2YJ2Oo.js.map +0 -1
- package/dist/dist-Bw6OBFYo.js.map +0 -1
- package/dist/local-components-DleLEzSU.js.map +0 -1
- package/dist/prepare-provider-runtime-BGdfbFyZ.js.map +0 -1
- package/dist/runtime-DFlEdls4.js.map +0 -1
- package/dist/runtime-agent-controller-reporting-submission-C_xD2A-P.js.map +0 -1
- package/dist/runtime-reporting-health-state-_bvJcV1y.js.map +0 -1
- package/dist/runtime-transport-DH8Ks-AU.js.map +0 -1
- package/dist/service-KHA_Yv8q.js.map +0 -1
- package/dist/upgrade-CuzsgsKh.js +0 -4
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { g as toSpaceUpdatesUrl } from "./urls-CY2uzH2-.js";
|
|
4
4
|
import { F as resolveOpenMeldRootDir, k as organizationSkillReleaseDir, t as OPENMELD_HOME_ENV_KEY } from "./paths-De9xdA2h.js";
|
|
5
|
-
import { Cr as spaceTaskMutationReceiptSchema,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { A as
|
|
11
|
-
import { B as requireOpenMeldProfile, o as dirnamePath } from "./daemon-device-id-
|
|
5
|
+
import { Cr as spaceTaskMutationReceiptSchema, Hr as organizationSkillBundleSchema, Lt as createAgentActivityApi, Pi as signalTextEnvelopeSchema, Sr as spaceTaskIdSchema, br as createSpaceTaskBodySchema, fn as createRuntimeReportingApi, or as getSpaceUpdatesResponseSchema, pi as observedLocalAgentSessionSchema, qr as stringifyOrganizationSkillBundleCanonicalJson, ri as submitAgentControllerTaskLifecycleEventItemSchema, rr as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, t as OpenMeldApiClientHttpError, xr as mutateSpaceTaskBodySchema } from "./dist-CJL7LE-y.js";
|
|
6
|
+
import { Fn as spaceFileRevisionNumberSchema, Rn as spaceMessageFileReferenceSchema, Sr as executionContextTaskSchema, br as executionContextAssignmentSchema, cn as spaceWorkingCopyResultSchema, in as SPACE_WORK_MAX_BYTES, jn as spaceFileEntryIdSchema, on as spaceWorkRelativePathSchema, sn as spaceWorkSelectionSchema, yn as readSpaceFileTextResponseSchema } from "./runtime-transport-DyBmX7ds.js";
|
|
7
|
+
import { O as openMeldRuntimeProfileIdSchema } from "./control-plane-QqGL-jtT.js";
|
|
8
|
+
import { $n as resolveExecutablePathsOnPath, On as resolveInstalledClaudeCodeLaunchCandidates, Tt as withAgentActivityLocalStateLock, Xn as resolveDispatchSpaceActionMcpServer, Zn as buildCliLaunchInvocation, er as listAgentControllerSupervisedProcessIds, ft as listProjectBindings, hn as resolveInstalledOpenCodeLaunchCandidates, ht as removeAgentActivityBindingsWhileDeliveryLocked, rr as isDispatchSpaceActionDeliveryOnly, vn as resolveInstalledGrokBuildLaunchCandidates, vt as resolveProjectBindingForPath, wt as withAgentActivityDeliveryLock, xn as resolveInstalledCodexLaunchCandidates } from "./prepare-provider-runtime-Bf2GBijn.js";
|
|
9
|
+
import { d as getAuthSessionState } from "./auth-session-CjxqNKvh.js";
|
|
10
|
+
import { A as AgentActivitySubmissionResultsMismatchError, D as drainAgentActivityHookInbox, F as removeProjectOutbox, I as readRecentAgentActivityHookStatus, L as createServiceGitEnvironment, M as deferAgentActivityOutbox, N as readAgentActivityOutboxHealth, P as readDueAgentActivityOutbox, S as resolveOpenCodeDatabasePath, T as normalizeSharedSessionTitle, a as DispatchSpaceActionClosedError, b as readOpenCodeSessionRows, d as readDispatchSpaceActionRecord, j as applyAgentActivitySubmissionResults, k as removeProjectInbox, l as readDispatchSpaceActionContextForReceiptFromEnv, o as DispatchSpaceActionRejectedError, p as writeDispatchSpaceActionRecord, pn as cliJsonErrorEnvelopeSchema, s as OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV, u as readDispatchSpaceActionContextFromEnv, v as scanLocalAgentActivity, w as resolveObservedAgentActivityBinding, y as startAgentActivityTranscriptWatchers } from "./dispatch-owned-runtime-Czq270vy.js";
|
|
11
|
+
import { B as requireOpenMeldProfile, o as dirnamePath } from "./daemon-device-id-OMqh2F9_.js";
|
|
12
12
|
import { d as runWithHeldLock, s as releaseLock, t as acquireLock } from "./lock-BMI00i2F.js";
|
|
13
13
|
import { a as resolveBaseUrl } from "./base-url-0AoeTi3w.js";
|
|
14
14
|
import { n as writeDaemonLocalStateFile, t as readDaemonLocalStateFile } from "./daemon-local-state-file-jOXuXrky.js";
|
|
@@ -16,8 +16,8 @@ import { _ as daemonRuntimeStateRootPath } from "./daemon-state-Dte9re5V.js";
|
|
|
16
16
|
import { i as readDaemonServiceContract } from "./daemon-service-contract-COPKbCy_.js";
|
|
17
17
|
import { l as resolveUserFacingCliEntryCommand, n as formatOpenMeldCliCommand } from "./cli-entry-command-CR_9QU1i.js";
|
|
18
18
|
import { r as outLine } from "./io-DT66typ4.js";
|
|
19
|
-
import { d as buildOpenMeldRequestContextFromProfile, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation } from "./api-client-foundation-
|
|
20
|
-
import { d as uploadPreparedSpaceFiles, f as createCliSpaceApi, l as parseJsonResponse, s as readGatewayTextResponse, u as prepareRequestedSpaceSendFiles } from "./meta-api-
|
|
19
|
+
import { d as buildOpenMeldRequestContextFromProfile, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation } from "./api-client-foundation-D6zHrrGV.js";
|
|
20
|
+
import { d as uploadPreparedSpaceFiles, f as createCliSpaceApi, l as parseJsonResponse, s as readGatewayTextResponse, u as prepareRequestedSpaceSendFiles } from "./meta-api-ClHCkzZB.js";
|
|
21
21
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
22
22
|
import { homedir } from "node:os";
|
|
23
23
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
@@ -29,9 +29,9 @@ import { execFile, spawn } from "node:child_process";
|
|
|
29
29
|
import { promisify } from "node:util";
|
|
30
30
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
31
31
|
import { createInterface } from "node:readline";
|
|
32
|
+
import { performance } from "node:perf_hooks";
|
|
32
33
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
33
34
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
34
|
-
import { performance } from "node:perf_hooks";
|
|
35
35
|
//#region ../../packages/schemas/dist/schemas/config/agent-activity-route-registry.js
|
|
36
36
|
const agentActivityRouteRegistrySchema = z$1.strictObject({
|
|
37
37
|
routes: z$1.array(z$1.strictObject({ rootDir: z$1.string().trim().min(1).max(4096) })).max(64),
|
|
@@ -226,6 +226,7 @@ const readOpenMeldContext = (directory) => new Promise((resolve) => {
|
|
|
226
226
|
let stdout = "";
|
|
227
227
|
const child = spawn("${input.cliEntryCommand}", ["activity", "context", "--path", directory, "--json"], {
|
|
228
228
|
stdio: ["ignore", "pipe", "ignore"],
|
|
229
|
+
windowsHide: true,
|
|
229
230
|
});
|
|
230
231
|
const finish = () => {
|
|
231
232
|
try {
|
|
@@ -333,7 +334,7 @@ export const OpenMeldAgentActivityPlugin = async ({ client, directory }) => {
|
|
|
333
334
|
const child = spawn(
|
|
334
335
|
"${input.cliEntryCommand}",
|
|
335
336
|
["activity", "hook", "--provider", "opencode", "--owner", "${input.owner}"],
|
|
336
|
-
{ stdio: ["pipe", "ignore", "ignore"] }
|
|
337
|
+
{ stdio: ["pipe", "ignore", "ignore"], windowsHide: true }
|
|
337
338
|
);
|
|
338
339
|
const finish = () => resolve(undefined);
|
|
339
340
|
const timeout = setTimeout(() => {
|
|
@@ -702,7 +703,7 @@ function isKnownOpenCodePlugin(value, knownArtifacts) {
|
|
|
702
703
|
artifacts.preSessionIdFallbackLegacyOpenCodePlugin,
|
|
703
704
|
artifacts.preDirectoryFallbackOpenCodePlugin,
|
|
704
705
|
artifacts.preDirectoryFallbackLegacyOpenCodePlugin
|
|
705
|
-
].includes(value ?? ""));
|
|
706
|
+
].flatMap((content) => [content, content.replace("\n windowsHide: true,", "").replace(", windowsHide: true }", " }")]).includes(value ?? ""));
|
|
706
707
|
}
|
|
707
708
|
async function planTextUpdate(path, key, transform) {
|
|
708
709
|
const actualCurrent = await readOptionalFile(path);
|
|
@@ -2875,6 +2876,169 @@ async function readLocalReportingHealth(rootDir) {
|
|
|
2875
2876
|
return await Promise.all([readAgentActivityOutboxHealth({ rootDir }), readControllerTaskLifecycleOutboxHealth({ rootDir })]);
|
|
2876
2877
|
}
|
|
2877
2878
|
//#endregion
|
|
2879
|
+
//#region src/local-service/state/ledger-io.ts
|
|
2880
|
+
function createLedgerIo() {
|
|
2881
|
+
return {
|
|
2882
|
+
appendFile: async (filePath, content, encoding) => {
|
|
2883
|
+
await mkdir(dirnamePath(filePath), { recursive: true });
|
|
2884
|
+
await appendFile(filePath, content, { encoding });
|
|
2885
|
+
},
|
|
2886
|
+
copyFile: async (fromPath, toPath) => {
|
|
2887
|
+
await mkdir(dirnamePath(toPath), { recursive: true });
|
|
2888
|
+
await copyFile(fromPath, toPath);
|
|
2889
|
+
},
|
|
2890
|
+
mkdir: async (dirPath, options) => {
|
|
2891
|
+
await mkdir(dirPath, options);
|
|
2892
|
+
},
|
|
2893
|
+
readFile: async (filePath, encoding) => {
|
|
2894
|
+
return await readFile(filePath, encoding);
|
|
2895
|
+
},
|
|
2896
|
+
rename: async (fromPath, toPath) => {
|
|
2897
|
+
await mkdir(dirnamePath(toPath), { recursive: true });
|
|
2898
|
+
await rename(fromPath, toPath);
|
|
2899
|
+
},
|
|
2900
|
+
syncPath: async (fileOrDirectoryPath) => {
|
|
2901
|
+
const isWindows = process.platform === "win32";
|
|
2902
|
+
if (isWindows && (await stat(fileOrDirectoryPath)).isDirectory()) return;
|
|
2903
|
+
const handle = await open(fileOrDirectoryPath, isWindows ? "r+" : "r");
|
|
2904
|
+
try {
|
|
2905
|
+
await handle.sync();
|
|
2906
|
+
} finally {
|
|
2907
|
+
await handle.close();
|
|
2908
|
+
}
|
|
2909
|
+
},
|
|
2910
|
+
rm: async (filePath, options) => {
|
|
2911
|
+
await rm(filePath, options);
|
|
2912
|
+
},
|
|
2913
|
+
writeFile: async (filePath, content, encoding) => {
|
|
2914
|
+
await mkdir(dirnamePath(filePath), { recursive: true });
|
|
2915
|
+
await writeFile(filePath, content, encoding);
|
|
2916
|
+
}
|
|
2917
|
+
};
|
|
2918
|
+
}
|
|
2919
|
+
//#endregion
|
|
2920
|
+
//#region src/local-service/state/runtime-reporting-health-state.ts
|
|
2921
|
+
const RUNTIME_REPORTING_HEALTH_FILENAME = "reporting-health.json";
|
|
2922
|
+
const DIAGNOSTIC_WHITESPACE_RE = /\s+/gu;
|
|
2923
|
+
const stateUpdateQueueByPath = /* @__PURE__ */ new Map();
|
|
2924
|
+
function runtimeReportingHealthStatePath(pathInput = {}) {
|
|
2925
|
+
return join(daemonRuntimeStateRootPath(pathInput), RUNTIME_REPORTING_HEALTH_FILENAME);
|
|
2926
|
+
}
|
|
2927
|
+
async function readRuntimeReportingHealthState(pathInput = {}, expectedServiceIdentity) {
|
|
2928
|
+
const state = await readDaemonLocalStateFile({
|
|
2929
|
+
path: runtimeReportingHealthStatePath(pathInput),
|
|
2930
|
+
schema: runtimeReportingHealthStateSchema
|
|
2931
|
+
});
|
|
2932
|
+
if (!(state && expectedServiceIdentity)) return state;
|
|
2933
|
+
return isSameServiceIdentity(state.serviceIdentity, expectedServiceIdentity) ? state : createInitialRuntimeReportingHealthState(expectedServiceIdentity);
|
|
2934
|
+
}
|
|
2935
|
+
async function recordRuntimeReportingFailure(input) {
|
|
2936
|
+
return await updateRuntimeReportingHealthState(input.pathInput, input.serviceIdentity, (current) => {
|
|
2937
|
+
const channelState = current[input.channel];
|
|
2938
|
+
const observedAt = input.at ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
2939
|
+
return {
|
|
2940
|
+
...current,
|
|
2941
|
+
[input.channel]: {
|
|
2942
|
+
...channelState,
|
|
2943
|
+
applicability: {
|
|
2944
|
+
observedAt,
|
|
2945
|
+
status: "applicable"
|
|
2946
|
+
},
|
|
2947
|
+
consecutiveFailures: channelState.consecutiveFailures + 1,
|
|
2948
|
+
lastFailure: {
|
|
2949
|
+
at: observedAt,
|
|
2950
|
+
reasonCode: normalizeDiagnosticText({
|
|
2951
|
+
fallback: "runtime.reporting.failed",
|
|
2952
|
+
maxLength: 160,
|
|
2953
|
+
value: input.reasonCode
|
|
2954
|
+
}),
|
|
2955
|
+
message: normalizeDiagnosticText({
|
|
2956
|
+
fallback: "Runtime reporting failed.",
|
|
2957
|
+
maxLength: 500,
|
|
2958
|
+
value: input.message
|
|
2959
|
+
})
|
|
2960
|
+
},
|
|
2961
|
+
lastSuccessAt: channelState.applicability?.status === "not_applicable" ? null : channelState.lastSuccessAt
|
|
2962
|
+
}
|
|
2963
|
+
};
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2966
|
+
function normalizeDiagnosticText(input) {
|
|
2967
|
+
return (input.value.replace(DIAGNOSTIC_WHITESPACE_RE, " ").trim() || input.fallback).slice(0, input.maxLength);
|
|
2968
|
+
}
|
|
2969
|
+
async function recordRuntimeReportingSuccess(input) {
|
|
2970
|
+
return await updateRuntimeReportingHealthState(input.pathInput, input.serviceIdentity, (current) => {
|
|
2971
|
+
const observedAt = input.at ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
2972
|
+
return {
|
|
2973
|
+
...current,
|
|
2974
|
+
[input.channel]: {
|
|
2975
|
+
applicability: {
|
|
2976
|
+
observedAt,
|
|
2977
|
+
status: "applicable"
|
|
2978
|
+
},
|
|
2979
|
+
lastSuccessAt: observedAt,
|
|
2980
|
+
consecutiveFailures: 0,
|
|
2981
|
+
lastFailure: null
|
|
2982
|
+
}
|
|
2983
|
+
};
|
|
2984
|
+
});
|
|
2985
|
+
}
|
|
2986
|
+
async function recordRuntimeReportingNotApplicable(input) {
|
|
2987
|
+
return await updateRuntimeReportingHealthState(input.pathInput, input.serviceIdentity, (current) => ({
|
|
2988
|
+
...current,
|
|
2989
|
+
[input.channel]: {
|
|
2990
|
+
...current[input.channel],
|
|
2991
|
+
applicability: {
|
|
2992
|
+
observedAt: input.at ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
2993
|
+
status: "not_applicable"
|
|
2994
|
+
},
|
|
2995
|
+
consecutiveFailures: 0,
|
|
2996
|
+
lastFailure: null
|
|
2997
|
+
}
|
|
2998
|
+
}));
|
|
2999
|
+
}
|
|
3000
|
+
function createInitialRuntimeReportingHealthState(serviceIdentity) {
|
|
3001
|
+
return {
|
|
3002
|
+
schema: RUNTIME_REPORTING_HEALTH_SCHEMA_NAME,
|
|
3003
|
+
v: 1,
|
|
3004
|
+
serviceIdentity,
|
|
3005
|
+
serviceIdentityObservedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3006
|
+
runtimeAgentController: createInitialRuntimeReportingChannelHealth(),
|
|
3007
|
+
providerConversationProof: createInitialRuntimeReportingChannelHealth()
|
|
3008
|
+
};
|
|
3009
|
+
}
|
|
3010
|
+
function createInitialRuntimeReportingChannelHealth() {
|
|
3011
|
+
return {
|
|
3012
|
+
lastSuccessAt: null,
|
|
3013
|
+
consecutiveFailures: 0,
|
|
3014
|
+
lastFailure: null
|
|
3015
|
+
};
|
|
3016
|
+
}
|
|
3017
|
+
async function writeRuntimeReportingHealthState(state, pathInput = {}) {
|
|
3018
|
+
await writeDaemonLocalStateFile({
|
|
3019
|
+
path: runtimeReportingHealthStatePath(pathInput),
|
|
3020
|
+
schema: runtimeReportingHealthStateSchema,
|
|
3021
|
+
value: state,
|
|
3022
|
+
mode: 384
|
|
3023
|
+
});
|
|
3024
|
+
}
|
|
3025
|
+
function updateRuntimeReportingHealthState(pathInput, serviceIdentity, update) {
|
|
3026
|
+
const path = runtimeReportingHealthStatePath(pathInput);
|
|
3027
|
+
const updatePromise = (stateUpdateQueueByPath.get(path) ?? Promise.resolve()).then(async () => {
|
|
3028
|
+
const next = update(await readRuntimeReportingHealthState(pathInput, serviceIdentity) ?? createInitialRuntimeReportingHealthState(serviceIdentity));
|
|
3029
|
+
await writeRuntimeReportingHealthState(next, pathInput);
|
|
3030
|
+
return next;
|
|
3031
|
+
});
|
|
3032
|
+
const queueTail = updatePromise.then(() => void 0, () => void 0);
|
|
3033
|
+
stateUpdateQueueByPath.set(path, queueTail);
|
|
3034
|
+
return updatePromise.finally(() => {
|
|
3035
|
+
if (stateUpdateQueueByPath.get(path) === queueTail) stateUpdateQueueByPath.delete(path);
|
|
3036
|
+
});
|
|
3037
|
+
}
|
|
3038
|
+
function isSameServiceIdentity(left, right) {
|
|
3039
|
+
return left?.deviceId === right.deviceId && left.contractGeneration === right.contractGeneration;
|
|
3040
|
+
}
|
|
3041
|
+
//#endregion
|
|
2878
3042
|
//#region src/runtime/dispatch-space-progress-relay.ts
|
|
2879
3043
|
const DISPATCH_PROGRESS_RELAY_FILENAME = "progress.ndjson";
|
|
2880
3044
|
const DISPATCH_PROGRESS_RELAY_POLL_INTERVAL_MS = 50;
|
|
@@ -3245,45 +3409,159 @@ function assertContainedWorkspace(boundaryRoot, workspacePath) {
|
|
|
3245
3409
|
return within.split(sep).join("/");
|
|
3246
3410
|
}
|
|
3247
3411
|
//#endregion
|
|
3248
|
-
//#region src/local-service/
|
|
3249
|
-
|
|
3412
|
+
//#region src/local-service/dispatch/execution-context-git-config.ts
|
|
3413
|
+
const entries = z.record(z.string(), z.array(z.string()));
|
|
3414
|
+
const executionContextGitConfigBaselineSchema = z.strictObject({
|
|
3415
|
+
common: entries,
|
|
3416
|
+
worktree: entries
|
|
3417
|
+
});
|
|
3418
|
+
const EXECUTABLE_KEY = /^(?:core\.(?:fsmonitor|hooksPath|sshCommand|worktree|pager|editor)|filter\..+|.+\.textconv|diff\..+\.command|credential\.helper|include\.path|includeIf\..+\.path|sequence\.editor|gpg\..*program|uploadpack\.packObjectsHook)$/iu;
|
|
3419
|
+
const HOOK_INSTALLER = /\b(?:husky|lefthook)\b/u;
|
|
3420
|
+
function executableSetting(key, values) {
|
|
3421
|
+
return EXECUTABLE_KEY.test(key) || key.toLowerCase().startsWith("alias.") && values.some((value) => value.trimStart().startsWith("!"));
|
|
3422
|
+
}
|
|
3423
|
+
async function readConfig(path, run) {
|
|
3424
|
+
const info = await lstat(path).catch((error) => {
|
|
3425
|
+
if (error.code === "ENOENT") return null;
|
|
3426
|
+
throw error;
|
|
3427
|
+
});
|
|
3428
|
+
if (!info) return {};
|
|
3429
|
+
if (!info.isFile() || info.nlink !== 1 || info.size > 64 * 1024) throw new Error("execution_context.workspace_git_config_invalid");
|
|
3430
|
+
const output = await run(dirname(path), [
|
|
3431
|
+
"config",
|
|
3432
|
+
"--file",
|
|
3433
|
+
path,
|
|
3434
|
+
"--no-includes",
|
|
3435
|
+
"--null",
|
|
3436
|
+
"--list"
|
|
3437
|
+
]);
|
|
3438
|
+
const result = {};
|
|
3439
|
+
for (const field of output.split("\0")) {
|
|
3440
|
+
if (!field) continue;
|
|
3441
|
+
const separator = field.indexOf("\n");
|
|
3442
|
+
const key = (separator < 0 ? field : field.slice(0, separator)).toLowerCase();
|
|
3443
|
+
const value = separator < 0 ? "" : field.slice(separator + 1);
|
|
3444
|
+
result[key] ??= [];
|
|
3445
|
+
result[key].push(value);
|
|
3446
|
+
}
|
|
3447
|
+
return result;
|
|
3448
|
+
}
|
|
3449
|
+
function configPaths(root) {
|
|
3250
3450
|
return {
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3451
|
+
common: join(root, "repository.git/config"),
|
|
3452
|
+
worktree: join(root, "repository.git/worktrees/worktree/config.worktree")
|
|
3453
|
+
};
|
|
3454
|
+
}
|
|
3455
|
+
async function captureExecutionContextGitConfig(root, run) {
|
|
3456
|
+
const paths = configPaths(root);
|
|
3457
|
+
const result = {
|
|
3458
|
+
common: await readConfig(paths.common, run),
|
|
3459
|
+
worktree: await readConfig(paths.worktree, run)
|
|
3460
|
+
};
|
|
3461
|
+
for (const group of Object.values(result)) for (const [key, values] of Object.entries(group)) if (!executableSetting(key, values)) delete group[key];
|
|
3462
|
+
return result;
|
|
3463
|
+
}
|
|
3464
|
+
function baselinePath(ledgerRoot, contextId) {
|
|
3465
|
+
if (!z.uuid().safeParse(contextId).success) throw new Error("execution_context.workspace_identity_mismatch");
|
|
3466
|
+
return join(ledgerRoot, "execution-context-git-config-baselines", `${contextId}.json`);
|
|
3467
|
+
}
|
|
3468
|
+
async function saveExecutionContextGitConfigBaseline(ledgerRoot, contextId, baseline) {
|
|
3469
|
+
const path = baselinePath(ledgerRoot, contextId);
|
|
3470
|
+
await mkdir(dirname(path), {
|
|
3471
|
+
recursive: true,
|
|
3472
|
+
mode: 448
|
|
3473
|
+
});
|
|
3474
|
+
const temporary = `${path}.${randomUUID()}.tmp`;
|
|
3475
|
+
const file = await open(temporary, "wx", 384);
|
|
3476
|
+
try {
|
|
3477
|
+
await file.writeFile(JSON.stringify(baseline), "utf8");
|
|
3478
|
+
await file.sync();
|
|
3479
|
+
} finally {
|
|
3480
|
+
await file.close();
|
|
3481
|
+
}
|
|
3482
|
+
await rename(temporary, path);
|
|
3483
|
+
}
|
|
3484
|
+
async function readExecutionContextGitConfigBaseline(ledgerRoot, contextId) {
|
|
3485
|
+
const path = baselinePath(ledgerRoot, contextId);
|
|
3486
|
+
const info = await lstat(path);
|
|
3487
|
+
if (!info.isFile() || info.nlink !== 1 || info.size > 256 * 1024) throw new Error("execution_context.workspace_git_config_baseline_invalid");
|
|
3488
|
+
return executionContextGitConfigBaselineSchema.parse(JSON.parse(await readFile(path, "utf8")));
|
|
3489
|
+
}
|
|
3490
|
+
async function isDeclaredHookInstaller(worktree, value, run) {
|
|
3491
|
+
const path = resolve(worktree, value);
|
|
3492
|
+
const child = relative(worktree, path);
|
|
3493
|
+
if (!child || isAbsolute(child) || child === ".." || child.startsWith(`..${sep}`)) return false;
|
|
3494
|
+
const canonical = await realpath(path).catch(() => null);
|
|
3495
|
+
if (!canonical || canonical !== path) return false;
|
|
3496
|
+
const packageText = await run(worktree, ["show", "HEAD:package.json"]).catch(() => null);
|
|
3497
|
+
if (!packageText) return false;
|
|
3498
|
+
let packageValue;
|
|
3499
|
+
try {
|
|
3500
|
+
packageValue = JSON.parse(packageText);
|
|
3501
|
+
} catch {
|
|
3502
|
+
return false;
|
|
3503
|
+
}
|
|
3504
|
+
const parsed = z.object({ scripts: z.record(z.string(), z.string()).optional() }).safeParse(packageValue);
|
|
3505
|
+
if (!(parsed.success && Object.values(parsed.data.scripts ?? {}).some((script) => HOOK_INSTALLER.test(script)))) return false;
|
|
3506
|
+
return (await run(worktree, [
|
|
3507
|
+
"ls-tree",
|
|
3508
|
+
"-r",
|
|
3509
|
+
"--name-only",
|
|
3510
|
+
"HEAD",
|
|
3511
|
+
"--",
|
|
3512
|
+
child.split(sep)[0] ?? child
|
|
3513
|
+
])).length > 0;
|
|
3514
|
+
}
|
|
3515
|
+
async function restoreSetting(input) {
|
|
3516
|
+
try {
|
|
3517
|
+
await input.run(input.worktree, [
|
|
3518
|
+
"config",
|
|
3519
|
+
"--file",
|
|
3520
|
+
input.path,
|
|
3521
|
+
"--unset-all",
|
|
3522
|
+
input.key
|
|
3523
|
+
]);
|
|
3524
|
+
for (const value of input.values) await input.run(input.worktree, [
|
|
3525
|
+
"config",
|
|
3526
|
+
"--file",
|
|
3527
|
+
input.path,
|
|
3528
|
+
"--add",
|
|
3529
|
+
input.key,
|
|
3530
|
+
value
|
|
3531
|
+
]);
|
|
3532
|
+
} catch {
|
|
3533
|
+
throw new Error("execution_context.workspace_git_config_audit_failed");
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
async function auditExecutionContextGitConfig(input) {
|
|
3537
|
+
const audit = {
|
|
3538
|
+
restoredSettings: 0,
|
|
3539
|
+
declaredHookInstallers: 0,
|
|
3540
|
+
unverifiedHookSettings: 0
|
|
3541
|
+
};
|
|
3542
|
+
const worktree = join(input.root, "worktree");
|
|
3543
|
+
const paths = configPaths(input.root);
|
|
3544
|
+
for (const group of ["common", "worktree"]) {
|
|
3545
|
+
const path = paths[group];
|
|
3546
|
+
const current = await readConfig(path, input.run);
|
|
3547
|
+
for (const [key, values] of Object.entries(current)) {
|
|
3548
|
+
if (!executableSetting(key, values) || JSON.stringify(values) === JSON.stringify(input.baseline[group][key])) continue;
|
|
3549
|
+
if (key === "core.hookspath") {
|
|
3550
|
+
if (await isDeclaredHookInstaller(worktree, values.at(-1) ?? "", input.run)) audit.declaredHookInstallers += 1;
|
|
3551
|
+
else audit.unverifiedHookSettings += 1;
|
|
3552
|
+
continue;
|
|
3277
3553
|
}
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3554
|
+
await restoreSetting({
|
|
3555
|
+
run: input.run,
|
|
3556
|
+
worktree,
|
|
3557
|
+
path,
|
|
3558
|
+
key,
|
|
3559
|
+
values: input.baseline[group][key] ?? []
|
|
3560
|
+
});
|
|
3561
|
+
audit.restoredSettings += 1;
|
|
3285
3562
|
}
|
|
3286
|
-
}
|
|
3563
|
+
}
|
|
3564
|
+
return audit;
|
|
3287
3565
|
}
|
|
3288
3566
|
//#endregion
|
|
3289
3567
|
//#region src/local-service/dispatch/execution-context-workspace.ts
|
|
@@ -3488,6 +3766,7 @@ async function markExecutionContextWorkspaceInUse(input) {
|
|
|
3488
3766
|
const path = join(root, "execution-context-workspace-records", `${context.id}.json`);
|
|
3489
3767
|
const record = await readManifest(path);
|
|
3490
3768
|
if (record?.status !== "completed") throw failure("workspace_execution_quiescence_unconfirmed");
|
|
3769
|
+
await saveExecutionContextGitConfigBaseline(root, context.id, await captureExecutionContextGitConfig(record.boundaryRoot, git));
|
|
3491
3770
|
await writeManifest(path, {
|
|
3492
3771
|
...record,
|
|
3493
3772
|
status: "in_use",
|
|
@@ -3508,6 +3787,15 @@ async function markExecutionContextWorkspaceInUse(input) {
|
|
|
3508
3787
|
throw error;
|
|
3509
3788
|
}
|
|
3510
3789
|
}
|
|
3790
|
+
async function auditWorkspaceGitConfig(input) {
|
|
3791
|
+
if (!input.use) return;
|
|
3792
|
+
const audit = await auditExecutionContextGitConfig({
|
|
3793
|
+
root: input.boundaryRoot,
|
|
3794
|
+
baseline: await readExecutionContextGitConfigBaseline(input.ledgerRoot, input.contextId),
|
|
3795
|
+
run: git
|
|
3796
|
+
});
|
|
3797
|
+
return Object.values(audit).some((count) => count > 0) ? audit : void 0;
|
|
3798
|
+
}
|
|
3511
3799
|
async function releaseExecutionContextWorkspace(input) {
|
|
3512
3800
|
const root = await canonicalDirectory(input.ledgerRootPath);
|
|
3513
3801
|
try {
|
|
@@ -3527,6 +3815,12 @@ async function releaseExecutionContextWorkspace(input) {
|
|
|
3527
3815
|
status: "retained",
|
|
3528
3816
|
reason: "execution_quiescence_unconfirmed"
|
|
3529
3817
|
};
|
|
3818
|
+
const gitConfigAudit = await auditWorkspaceGitConfig({
|
|
3819
|
+
use: input.use,
|
|
3820
|
+
boundaryRoot: record.boundaryRoot,
|
|
3821
|
+
ledgerRoot: root,
|
|
3822
|
+
contextId: input.context.id
|
|
3823
|
+
});
|
|
3530
3824
|
const { activeAttemptId: _activeAttemptId, activeDispatchId: _activeDispatchId, containerRuntime: _containerRuntime, ...quiescentRecord } = record;
|
|
3531
3825
|
const completed = {
|
|
3532
3826
|
...quiescentRecord,
|
|
@@ -3536,24 +3830,32 @@ async function releaseExecutionContextWorkspace(input) {
|
|
|
3536
3830
|
record = await removePristineRetirement(completed, path);
|
|
3537
3831
|
if (record.retirement) return {
|
|
3538
3832
|
status: "retained",
|
|
3539
|
-
reason: "cleanup_incomplete"
|
|
3833
|
+
reason: "cleanup_incomplete",
|
|
3834
|
+
gitConfigAudit
|
|
3540
3835
|
};
|
|
3541
3836
|
if (!record.pristineFingerprint) return {
|
|
3542
3837
|
status: "retained",
|
|
3543
|
-
reason: "baseline_unverified"
|
|
3838
|
+
reason: "baseline_unverified",
|
|
3839
|
+
gitConfigAudit
|
|
3544
3840
|
};
|
|
3545
3841
|
await verifyRetainedWorkspace(record);
|
|
3546
3842
|
if (await fingerprintDirectory(record.boundaryRoot) !== record.pristineFingerprint) return {
|
|
3547
3843
|
status: "retained",
|
|
3548
|
-
reason: "workspace_changed"
|
|
3844
|
+
reason: "workspace_changed",
|
|
3845
|
+
gitConfigAudit
|
|
3549
3846
|
};
|
|
3550
3847
|
if (record.sourceWorkingDirectory && !await sourceHasCommit(record)) return {
|
|
3551
3848
|
status: "retained",
|
|
3552
|
-
reason: "source_commit_unavailable"
|
|
3849
|
+
reason: "source_commit_unavailable",
|
|
3850
|
+
gitConfigAudit
|
|
3553
3851
|
};
|
|
3554
|
-
return (await retirePristineWorkspace(record, path)).status === "released" ? {
|
|
3852
|
+
return (await retirePristineWorkspace(record, path)).status === "released" ? {
|
|
3853
|
+
status: "released",
|
|
3854
|
+
gitConfigAudit
|
|
3855
|
+
} : {
|
|
3555
3856
|
status: "retained",
|
|
3556
|
-
reason: "workspace_changed"
|
|
3857
|
+
reason: "workspace_changed",
|
|
3858
|
+
gitConfigAudit
|
|
3557
3859
|
};
|
|
3558
3860
|
});
|
|
3559
3861
|
} finally {
|
|
@@ -3755,7 +4057,17 @@ async function acquireWorkspaceExecutionLock(root, contextId) {
|
|
|
3755
4057
|
});
|
|
3756
4058
|
}
|
|
3757
4059
|
function workspaceResult(manifest) {
|
|
4060
|
+
const repository = join(manifest.boundaryRoot, "repository.git");
|
|
4061
|
+
const gitDirectory = join(repository, "worktrees", "worktree");
|
|
3758
4062
|
return {
|
|
4063
|
+
...manifest.sourceWorkingDirectory ? { gitMetadata: {
|
|
4064
|
+
commonDirectoryPointerPath: join(gitDirectory, "commondir"),
|
|
4065
|
+
configPath: join(repository, "config"),
|
|
4066
|
+
gitDirectoryPointerPath: join(gitDirectory, "gitdir"),
|
|
4067
|
+
hooksPath: join(repository, "hooks"),
|
|
4068
|
+
worktreeConfigPath: join(gitDirectory, "config.worktree"),
|
|
4069
|
+
worktreeGitPointerPath: join(manifest.workingDirectory, ".git")
|
|
4070
|
+
} } : {},
|
|
3759
4071
|
workingDirectory: manifest.workingDirectory,
|
|
3760
4072
|
boundaryRoot: manifest.boundaryRoot,
|
|
3761
4073
|
...manifest.sourceWorkingDirectory ? { sourceWorkingDirectory: manifest.sourceWorkingDirectory } : {},
|
|
@@ -3869,38 +4181,17 @@ function within(child, parent) {
|
|
|
3869
4181
|
const path = relative(resolve(parent), child);
|
|
3870
4182
|
return path === "" || path !== ".." && !path.startsWith(`..${sep}`) && !isAbsolute(path);
|
|
3871
4183
|
}
|
|
3872
|
-
const GIT_SETTINGS = {
|
|
3873
|
-
"core.hooksPath": "/dev/null",
|
|
3874
|
-
"core.attributesFile": "/dev/null",
|
|
3875
|
-
"core.fsmonitor": "false",
|
|
3876
|
-
"credential.helper": "",
|
|
3877
|
-
"protocol.allow": "never",
|
|
3878
|
-
"protocol.file.allow": "always",
|
|
3879
|
-
"fetch.recurseSubmodules": "false",
|
|
3880
|
-
"submodule.recurse": "false",
|
|
3881
|
-
"uploadpack.packObjectsHook": "",
|
|
3882
|
-
"gc.auto": "0",
|
|
3883
|
-
"maintenance.auto": "false"
|
|
3884
|
-
};
|
|
3885
4184
|
async function git(cwd, args, processSupervisionId) {
|
|
3886
|
-
const env =
|
|
3887
|
-
Object.assign(env, {
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
GIT_TERMINAL_PROMPT: "0",
|
|
3897
|
-
GIT_CONFIG_COUNT: String(Object.keys(GIT_SETTINGS).length)
|
|
3898
|
-
});
|
|
3899
|
-
for (const [index, [key, value]] of Object.entries(GIT_SETTINGS).entries()) {
|
|
3900
|
-
env[`GIT_CONFIG_KEY_${index}`] = key;
|
|
3901
|
-
env[`GIT_CONFIG_VALUE_${index}`] = value;
|
|
3902
|
-
}
|
|
3903
|
-
return (await execFileAsync$1("git", args, {
|
|
4185
|
+
const env = createServiceGitEnvironment();
|
|
4186
|
+
Object.assign(env, { ...processSupervisionId ? { OPENMELD_PROCESS_SUPERVISION_ID: processSupervisionId } : {} });
|
|
4187
|
+
return (await execFileAsync$1("git", [
|
|
4188
|
+
"-c",
|
|
4189
|
+
"core.fsmonitor=false",
|
|
4190
|
+
"-c",
|
|
4191
|
+
"core.hooksPath=/dev/null",
|
|
4192
|
+
...await lstat(join(cwd, ".git")).catch(() => null) ? ["-c", `core.worktree=${cwd}`] : [],
|
|
4193
|
+
...args
|
|
4194
|
+
], {
|
|
3904
4195
|
cwd,
|
|
3905
4196
|
env,
|
|
3906
4197
|
encoding: "utf8",
|
|
@@ -5631,128 +5922,6 @@ async function fetchSpaceUpdates(input) {
|
|
|
5631
5922
|
return parsed.data;
|
|
5632
5923
|
}
|
|
5633
5924
|
//#endregion
|
|
5634
|
-
|
|
5635
|
-
const RUNTIME_REPORTING_HEALTH_FILENAME = "reporting-health.json";
|
|
5636
|
-
const DIAGNOSTIC_WHITESPACE_RE = /\s+/gu;
|
|
5637
|
-
const stateUpdateQueueByPath = /* @__PURE__ */ new Map();
|
|
5638
|
-
function runtimeReportingHealthStatePath(pathInput = {}) {
|
|
5639
|
-
return join(daemonRuntimeStateRootPath(pathInput), RUNTIME_REPORTING_HEALTH_FILENAME);
|
|
5640
|
-
}
|
|
5641
|
-
async function readRuntimeReportingHealthState(pathInput = {}, expectedServiceIdentity) {
|
|
5642
|
-
const state = await readDaemonLocalStateFile({
|
|
5643
|
-
path: runtimeReportingHealthStatePath(pathInput),
|
|
5644
|
-
schema: runtimeReportingHealthStateSchema
|
|
5645
|
-
});
|
|
5646
|
-
if (!(state && expectedServiceIdentity)) return state;
|
|
5647
|
-
return isSameServiceIdentity(state.serviceIdentity, expectedServiceIdentity) ? state : createInitialRuntimeReportingHealthState(expectedServiceIdentity);
|
|
5648
|
-
}
|
|
5649
|
-
async function recordRuntimeReportingFailure(input) {
|
|
5650
|
-
return await updateRuntimeReportingHealthState(input.pathInput, input.serviceIdentity, (current) => {
|
|
5651
|
-
const channelState = current[input.channel];
|
|
5652
|
-
const observedAt = input.at ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
5653
|
-
return {
|
|
5654
|
-
...current,
|
|
5655
|
-
[input.channel]: {
|
|
5656
|
-
...channelState,
|
|
5657
|
-
applicability: {
|
|
5658
|
-
observedAt,
|
|
5659
|
-
status: "applicable"
|
|
5660
|
-
},
|
|
5661
|
-
consecutiveFailures: channelState.consecutiveFailures + 1,
|
|
5662
|
-
lastFailure: {
|
|
5663
|
-
at: observedAt,
|
|
5664
|
-
reasonCode: normalizeDiagnosticText({
|
|
5665
|
-
fallback: "runtime.reporting.failed",
|
|
5666
|
-
maxLength: 160,
|
|
5667
|
-
value: input.reasonCode
|
|
5668
|
-
}),
|
|
5669
|
-
message: normalizeDiagnosticText({
|
|
5670
|
-
fallback: "Runtime reporting failed.",
|
|
5671
|
-
maxLength: 500,
|
|
5672
|
-
value: input.message
|
|
5673
|
-
})
|
|
5674
|
-
},
|
|
5675
|
-
lastSuccessAt: channelState.applicability?.status === "not_applicable" ? null : channelState.lastSuccessAt
|
|
5676
|
-
}
|
|
5677
|
-
};
|
|
5678
|
-
});
|
|
5679
|
-
}
|
|
5680
|
-
function normalizeDiagnosticText(input) {
|
|
5681
|
-
return (input.value.replace(DIAGNOSTIC_WHITESPACE_RE, " ").trim() || input.fallback).slice(0, input.maxLength);
|
|
5682
|
-
}
|
|
5683
|
-
async function recordRuntimeReportingSuccess(input) {
|
|
5684
|
-
return await updateRuntimeReportingHealthState(input.pathInput, input.serviceIdentity, (current) => {
|
|
5685
|
-
const observedAt = input.at ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
5686
|
-
return {
|
|
5687
|
-
...current,
|
|
5688
|
-
[input.channel]: {
|
|
5689
|
-
applicability: {
|
|
5690
|
-
observedAt,
|
|
5691
|
-
status: "applicable"
|
|
5692
|
-
},
|
|
5693
|
-
lastSuccessAt: observedAt,
|
|
5694
|
-
consecutiveFailures: 0,
|
|
5695
|
-
lastFailure: null
|
|
5696
|
-
}
|
|
5697
|
-
};
|
|
5698
|
-
});
|
|
5699
|
-
}
|
|
5700
|
-
async function recordRuntimeReportingNotApplicable(input) {
|
|
5701
|
-
return await updateRuntimeReportingHealthState(input.pathInput, input.serviceIdentity, (current) => ({
|
|
5702
|
-
...current,
|
|
5703
|
-
[input.channel]: {
|
|
5704
|
-
...current[input.channel],
|
|
5705
|
-
applicability: {
|
|
5706
|
-
observedAt: input.at ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
5707
|
-
status: "not_applicable"
|
|
5708
|
-
},
|
|
5709
|
-
consecutiveFailures: 0,
|
|
5710
|
-
lastFailure: null
|
|
5711
|
-
}
|
|
5712
|
-
}));
|
|
5713
|
-
}
|
|
5714
|
-
function createInitialRuntimeReportingHealthState(serviceIdentity) {
|
|
5715
|
-
return {
|
|
5716
|
-
schema: RUNTIME_REPORTING_HEALTH_SCHEMA_NAME,
|
|
5717
|
-
v: 1,
|
|
5718
|
-
serviceIdentity,
|
|
5719
|
-
serviceIdentityObservedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5720
|
-
runtimeAgentController: createInitialRuntimeReportingChannelHealth(),
|
|
5721
|
-
providerConversationProof: createInitialRuntimeReportingChannelHealth()
|
|
5722
|
-
};
|
|
5723
|
-
}
|
|
5724
|
-
function createInitialRuntimeReportingChannelHealth() {
|
|
5725
|
-
return {
|
|
5726
|
-
lastSuccessAt: null,
|
|
5727
|
-
consecutiveFailures: 0,
|
|
5728
|
-
lastFailure: null
|
|
5729
|
-
};
|
|
5730
|
-
}
|
|
5731
|
-
async function writeRuntimeReportingHealthState(state, pathInput = {}) {
|
|
5732
|
-
await writeDaemonLocalStateFile({
|
|
5733
|
-
path: runtimeReportingHealthStatePath(pathInput),
|
|
5734
|
-
schema: runtimeReportingHealthStateSchema,
|
|
5735
|
-
value: state,
|
|
5736
|
-
mode: 384
|
|
5737
|
-
});
|
|
5738
|
-
}
|
|
5739
|
-
function updateRuntimeReportingHealthState(pathInput, serviceIdentity, update) {
|
|
5740
|
-
const path = runtimeReportingHealthStatePath(pathInput);
|
|
5741
|
-
const updatePromise = (stateUpdateQueueByPath.get(path) ?? Promise.resolve()).then(async () => {
|
|
5742
|
-
const next = update(await readRuntimeReportingHealthState(pathInput, serviceIdentity) ?? createInitialRuntimeReportingHealthState(serviceIdentity));
|
|
5743
|
-
await writeRuntimeReportingHealthState(next, pathInput);
|
|
5744
|
-
return next;
|
|
5745
|
-
});
|
|
5746
|
-
const queueTail = updatePromise.then(() => void 0, () => void 0);
|
|
5747
|
-
stateUpdateQueueByPath.set(path, queueTail);
|
|
5748
|
-
return updatePromise.finally(() => {
|
|
5749
|
-
if (stateUpdateQueueByPath.get(path) === queueTail) stateUpdateQueueByPath.delete(path);
|
|
5750
|
-
});
|
|
5751
|
-
}
|
|
5752
|
-
function isSameServiceIdentity(left, right) {
|
|
5753
|
-
return left?.deviceId === right.deviceId && left.contractGeneration === right.contractGeneration;
|
|
5754
|
-
}
|
|
5755
|
-
//#endregion
|
|
5756
|
-
export { enqueueControllerTaskLifecycleEventWhileLocked as A, resolveAgentActivityDispatcherCommand as B, startDispatchSpaceProgressRelay as C, recordOpenMeldCreatedLocalAgentSession as D, discoverLocalAgentSessionProviders as E, unregisterAgentActivityRoute as F, AGENT_ACTIVITY_INTEGRATION_OWNER as I, defaultManagedIntegrationPaths as L, isAgentActivityRouteRegistered as M, registerAgentActivityRoute as N, readAgentActivityContextForPath as O, resolveAgentActivityRouteForPath as P, installAgentActivityIntegrations as R, prepareClaudeProjectContainer as S, syncLocalAgentActivity as T, uninstallAgentActivityIntegrations as V, markExecutionContextWorkspaceInUse as _, fetchSpaceUpdates as a, releaseExecutionContextWorkspace as b, materializeOrganizationSkillRelease as c, runSpaceActionHelp as d, runSpaceActionReply as f, runSpaceActionWake as g, runSpaceActionTargets as h, recordRuntimeReportingSuccess as i, readControllerTaskLifecycleOutboxHealth as j, removeAgentActivityContextCache as k, createDispatchSpaceTools as l, runSpaceActionStatus as m, recordRuntimeReportingFailure as n, createSpaceWorkingCopies as o, runSpaceActionSilent as p, recordRuntimeReportingNotApplicable as r, downloadWorkingCopyFile as s, readRuntimeReportingHealthState as t, runSpaceActionMcpServer as u, prepareExecutionContextWorkspace as v, startLocalAgentActivitySyncLoop as w, createLedgerIo as x, readExecutionContextWorkspace as y, readAgentActivityIntegrationStatus as z };
|
|
5925
|
+
export { enqueueControllerTaskLifecycleEventWhileLocked as A, resolveAgentActivityDispatcherCommand as B, createLedgerIo as C, recordOpenMeldCreatedLocalAgentSession as D, discoverLocalAgentSessionProviders as E, unregisterAgentActivityRoute as F, AGENT_ACTIVITY_INTEGRATION_OWNER as I, defaultManagedIntegrationPaths as L, isAgentActivityRouteRegistered as M, registerAgentActivityRoute as N, readAgentActivityContextForPath as O, resolveAgentActivityRouteForPath as P, installAgentActivityIntegrations as R, recordRuntimeReportingSuccess as S, syncLocalAgentActivity as T, uninstallAgentActivityIntegrations as V, prepareClaudeProjectContainer as _, createDispatchSpaceTools as a, recordRuntimeReportingFailure as b, runSpaceActionReply as c, runSpaceActionTargets as d, runSpaceActionWake as f, releaseExecutionContextWorkspace as g, readExecutionContextWorkspace as h, materializeOrganizationSkillRelease as i, readControllerTaskLifecycleOutboxHealth as j, removeAgentActivityContextCache as k, runSpaceActionSilent as l, prepareExecutionContextWorkspace as m, createSpaceWorkingCopies as n, runSpaceActionMcpServer as o, markExecutionContextWorkspaceInUse as p, downloadWorkingCopyFile as r, runSpaceActionHelp as s, fetchSpaceUpdates as t, runSpaceActionStatus as u, startDispatchSpaceProgressRelay as v, startLocalAgentActivitySyncLoop as w, recordRuntimeReportingNotApplicable as x, readRuntimeReportingHealthState as y, readAgentActivityIntegrationStatus as z };
|
|
5757
5926
|
|
|
5758
|
-
//# sourceMappingURL=
|
|
5927
|
+
//# sourceMappingURL=updates-api-BpWiCpAo.js.map
|