@adhdev/daemon-core 0.9.82-rc.262 → 0.9.82-rc.263
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/build-info.d.ts +37 -0
- package/dist/git/git-status.d.ts +7 -0
- package/dist/git/git-types.d.ts +19 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +490 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +486 -64
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-active-work.d.ts +18 -0
- package/dist/mesh/mesh-fast-forward.d.ts +41 -1
- package/dist/mesh/mesh-ledger.d.ts +1 -1
- package/dist/mesh/mesh-runtime-store.d.ts +6 -0
- package/dist/mesh/mesh-work-queue.d.ts +6 -0
- package/package.json +1 -1
- package/src/build-info.ts +73 -0
- package/src/commands/router.ts +49 -2
- package/src/git/git-status.ts +73 -1
- package/src/git/git-types.ts +20 -0
- package/src/index.ts +5 -2
- package/src/mesh/mesh-active-work.ts +31 -0
- package/src/mesh/mesh-fast-forward.ts +418 -17
- package/src/mesh/mesh-ledger.ts +1 -0
- package/src/mesh/mesh-runtime-store.ts +19 -0
- package/src/mesh/mesh-work-queue.ts +13 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon build stamp — single runtime source for "which commit is this running
|
|
3
|
+
* daemon built from?".
|
|
4
|
+
*
|
|
5
|
+
* The values are injected at BUILD time via tsup `define` (esbuild global
|
|
6
|
+
* replacement). Every build config that bundles daemon-core into a shippable
|
|
7
|
+
* daemon (daemon-core's own dist, daemon-standalone, daemon-cloud) replaces
|
|
8
|
+
* these `__DAEMON_BUILD_*` identifiers with the literal git commit/version that
|
|
9
|
+
* was current when the bundle was produced. See:
|
|
10
|
+
* - oss/packages/daemon-core/tsup.config.ts (standalone consumes this dist)
|
|
11
|
+
* - packages/daemon-cloud/tsup.config.ts (re-bundles daemon-core from source)
|
|
12
|
+
*
|
|
13
|
+
* If a bundle is produced WITHOUT the define (e.g. running src directly through
|
|
14
|
+
* tsx in dev, or a build env without git), the identifiers stay undefined and
|
|
15
|
+
* we fall back to `"unknown"` — never a ReferenceError, never a build failure.
|
|
16
|
+
*
|
|
17
|
+
* IMPORTANT (live-reflection caveat): a fresh local `daemon-core dist` rebuild +
|
|
18
|
+
* daemon restart is NOT enough to make a *cloud* daemon report a new commit —
|
|
19
|
+
* daemon-cloud ships its own re-bundle of daemon-core, so the build stamp only
|
|
20
|
+
* advances after the cloud daemon is rebuilt/redeployed and restarted. This is
|
|
21
|
+
* precisely the gap `mesh_status`'s `staleDaemonBuild` warning exists to surface.
|
|
22
|
+
*/
|
|
23
|
+
export interface DaemonBuildInfo {
|
|
24
|
+
/** Full 40-char git commit the daemon bundle was built from, or 'unknown'. */
|
|
25
|
+
commit: string;
|
|
26
|
+
/** Short (7-char) form of the same commit, or 'unknown'. */
|
|
27
|
+
commitShort: string;
|
|
28
|
+
/** package.json version baked in at build time, or 'unknown'. */
|
|
29
|
+
version: string;
|
|
30
|
+
/** ISO build timestamp if the build config injected one. */
|
|
31
|
+
builtAt?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolve the build stamp baked into the running daemon bundle. Pure read of
|
|
35
|
+
* build-time constants — no I/O, safe to call from any runtime path. Cached.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getDaemonBuildInfo(): DaemonBuildInfo;
|
package/dist/git/git-status.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GitRepoStatus } from './git-types.js';
|
|
2
|
+
import { type DaemonBuildInfo } from '../build-info.js';
|
|
2
3
|
export interface GitStatusOptions {
|
|
3
4
|
timeoutMs?: number;
|
|
4
5
|
/** When true, include submodule status in the result. Defaults to true. */
|
|
@@ -10,6 +11,12 @@ export interface GitStatusOptions {
|
|
|
10
11
|
* Callers should opt into this only for convergence-critical surfaces.
|
|
11
12
|
*/
|
|
12
13
|
refreshUpstream?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Test/override seam for the daemon build stamp used by the stale-build
|
|
16
|
+
* detector. Production callers omit this so the real baked-in build commit
|
|
17
|
+
* (getDaemonBuildInfo) is used.
|
|
18
|
+
*/
|
|
19
|
+
daemonBuildInfo?: DaemonBuildInfo;
|
|
13
20
|
}
|
|
14
21
|
export declare function getGitRepoStatus(workspace: string, options?: GitStatusOptions): Promise<GitRepoStatus>;
|
|
15
22
|
interface ParsedPorcelainStatus {
|
package/dist/git/git-types.d.ts
CHANGED
|
@@ -54,9 +54,28 @@ export interface GitRepoStatus extends GitRepoIdentity {
|
|
|
54
54
|
lastCheckedAt: number;
|
|
55
55
|
/** Submodule statuses when auto-discover is enabled */
|
|
56
56
|
submodules?: GitSubmoduleStatus[];
|
|
57
|
+
/**
|
|
58
|
+
* Set when the running daemon's build commit is a STRICT ancestor of this
|
|
59
|
+
* repo's HEAD (or a submodule HEAD) — i.e. the live daemon predates committed
|
|
60
|
+
* code in this workspace and is awaiting a deploy/restart to catch up.
|
|
61
|
+
* Omitted entirely when no staleness is provable (unknown build, commit not
|
|
62
|
+
* present in repo, or build commit == HEAD) to avoid over-warning.
|
|
63
|
+
*/
|
|
64
|
+
daemonBuildBehind?: DaemonBuildBehind;
|
|
57
65
|
error?: string;
|
|
58
66
|
reason?: GitFailureReason;
|
|
59
67
|
}
|
|
68
|
+
export interface DaemonBuildBehind {
|
|
69
|
+
/** Full build commit baked into the running daemon. */
|
|
70
|
+
buildCommit: string;
|
|
71
|
+
/** Short build commit. */
|
|
72
|
+
buildCommitShort: string;
|
|
73
|
+
/** HEAD commit the build commit is behind (repo or submodule). */
|
|
74
|
+
head: string;
|
|
75
|
+
/** Where the comparison matched: 'root' or the submodule path. */
|
|
76
|
+
scope: string;
|
|
77
|
+
warning: string;
|
|
78
|
+
}
|
|
60
79
|
export type GitFileChangeStatus = 'added' | 'modified' | 'deleted' | 'renamed' | 'copied' | 'untracked' | 'conflict';
|
|
61
80
|
export interface GitFileChange {
|
|
62
81
|
path: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -49,9 +49,10 @@ export { fastForwardMeshNode } from './mesh/mesh-fast-forward.js';
|
|
|
49
49
|
export type { MeshFastForwardNodeArgs, MeshFastForwardPlannedStep, MeshFastForwardResult } from './mesh/mesh-fast-forward.js';
|
|
50
50
|
export { buildMeshLedgerReconciliationEvidence, buildMeshLedgerReplicaEvidence } from './mesh/mesh-ledger-reconciliation.js';
|
|
51
51
|
export type { AnyLedgerSlice, MeshLedgerReconciliationEvidence, MeshLedgerReplicaEvidence, MeshLedgerReplicaStatus } from './mesh/mesh-ledger-reconciliation.js';
|
|
52
|
-
export { enqueueTask, recordDirectDispatchTask, getQueue, claimNextTask, updateTaskStatus, updateSessionTaskStatus, cancelTask, requeueTask, getMeshQueueStats, getMeshQueueRevision, normalizeMeshTaskMode, validateMeshTaskModeRequest, buildMeshNodeCapabilityTags, nodeSatisfiesRequiredTags, normalizeMeshCapabilityTags, insertDirectDispatch, getActiveDirectDispatches, updateDirectDispatchStatus, cleanupTerminalDirectDispatches, markStaleDirectDispatches, recordMeshToolCall, assertNoDependencyCycle, hasPendingDependents, describeTaskDependencyState } from './mesh/mesh-work-queue.js';
|
|
52
|
+
export { enqueueTask, recordDirectDispatchTask, getQueue, claimNextTask, updateTaskStatus, updateSessionTaskStatus, cancelTask, requeueTask, getMeshQueueStats, getMeshQueueRevision, normalizeMeshTaskMode, validateMeshTaskModeRequest, buildMeshNodeCapabilityTags, nodeSatisfiesRequiredTags, normalizeMeshCapabilityTags, insertDirectDispatch, getActiveDirectDispatches, updateDirectDispatchStatus, cleanupTerminalDirectDispatches, markStaleDirectDispatches, deleteDirectDispatchesByTaskId, recordMeshToolCall, assertNoDependencyCycle, hasPendingDependents, describeTaskDependencyState } from './mesh/mesh-work-queue.js';
|
|
53
53
|
export type { MeshWorkQueueEntry, MeshTaskStatus, MeshTaskMode, MeshWorkQueueStats, MeshQueueMutationOptions, MeshTaskModeValidationResult, DirectDispatchRecord, MeshToolCallRateResult } from './mesh/mesh-work-queue.js';
|
|
54
|
-
export { buildCompactStaleDirectWorkSummary, buildMeshActiveWork, buildMeshActiveWorkSummary } from './mesh/mesh-active-work.js';
|
|
54
|
+
export { buildCompactStaleDirectWorkSummary, buildMeshActiveWork, buildMeshActiveWorkSummary, classifyStaleDirectForPrune, PRUNABLE_ORPHAN_STALE_REASONS } from './mesh/mesh-active-work.js';
|
|
55
|
+
export type { StaleDirectPruneClassification } from './mesh/mesh-active-work.js';
|
|
55
56
|
export type { MeshActiveWorkRecord, MeshActiveWorkStatus, MeshActiveWorkSummary, MeshActiveWorkSource, MeshStaleDirectWorkSummary } from './mesh/mesh-active-work.js';
|
|
56
57
|
export { buildMeshAsyncRefineJobs, summarizeMeshAsyncRefineJobs, STALE_TERMINAL_REFINE_WINDOW_MS, RECENT_TERMINAL_REFINE_CAP } from './mesh/mesh-refine-status.js';
|
|
57
58
|
export type { MeshAsyncRefineJobStatus, MeshAsyncRefineJobSummary, MeshAsyncRefineJobsSummary } from './mesh/mesh-refine-status.js';
|
|
@@ -87,6 +88,8 @@ export type { DaemonUpgradeHelperPayload, CurrentGlobalInstallSurface, PinnedGlo
|
|
|
87
88
|
export { DaemonStatusReporter } from './status/reporter.js';
|
|
88
89
|
export { buildSessionEntries, findCdpManager, hasCdpManager, isCdpConnected } from './status/builders.js';
|
|
89
90
|
export { buildStatusSnapshot, buildMachineInfo } from './status/snapshot.js';
|
|
91
|
+
export { getDaemonBuildInfo } from './build-info.js';
|
|
92
|
+
export type { DaemonBuildInfo } from './build-info.js';
|
|
90
93
|
export { normalizeManagedStatus, isManagedStatusWorking, isManagedStatusWaiting, normalizeActiveChatData } from './status/normalize.js';
|
|
91
94
|
export type { ManagedStatus } from './status/normalize.js';
|
|
92
95
|
export type { StatusSnapshotOptions, StatusSnapshot } from './status/snapshot.js';
|