@adhdev/daemon-core 1.0.18-rc.16 → 1.0.18-rc.18
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/commands/cli-manager.d.ts +9 -0
- package/dist/config/mesh-json-config.d.ts +62 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +919 -421
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +880 -391
- package/dist/index.mjs.map +1 -1
- package/dist/providers/auto-approve-modes.d.ts +14 -0
- package/dist/providers/cli-provider-instance.d.ts +4 -0
- package/dist/providers/contracts.d.ts +17 -0
- package/dist/providers/provider-schema.d.ts +1 -0
- package/dist/repo-mesh-types.d.ts +38 -6
- package/dist/shared-types.d.ts +3 -1
- package/package.json +3 -3
- package/src/commands/cli-manager.ts +54 -8
- package/src/commands/med-family/mesh-crud.ts +155 -0
- package/src/config/mesh-json-config.ts +103 -0
- package/src/index.ts +21 -1
- package/src/mesh/mesh-event-forwarding.ts +18 -2
- package/src/mesh/mesh-queue-assignment.ts +66 -9
- package/src/providers/auto-approve-modes.ts +97 -0
- package/src/providers/cli-provider-instance.ts +45 -13
- package/src/providers/contracts.ts +25 -1
- package/src/providers/provider-schema.ts +83 -0
- package/src/providers/sdk/v1/schemas/cli/provider.schema.json +44 -0
- package/src/repo-mesh-types.ts +112 -12
- package/src/shared-types.ts +3 -1
- package/src/status/snapshot.ts +2 -0
|
@@ -131,6 +131,15 @@ export declare function expandModelLaunchArgs(template: string[] | undefined, mo
|
|
|
131
131
|
* thinking request without a template is a no-op). BRAIN-ROUTING thinking axis.
|
|
132
132
|
*/
|
|
133
133
|
export declare function expandThinkingLaunchArgs(template: string[] | undefined, level: string | undefined, levelMap: Partial<Record<string, string>> | undefined): string[] | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Apply a selected launch-args auto-approve mode without mutating provider metadata.
|
|
136
|
+
* removeArgs only targets provider-owned base spawn.args; launchArgs are prepended to
|
|
137
|
+
* per-launch args beside model/thinking args, making conflict removal order-independent.
|
|
138
|
+
*/
|
|
139
|
+
export declare function applyAutoApproveModeLaunchArgs(provider: ProviderModule | undefined, cliArgs: string[] | undefined, settings: Record<string, unknown> | undefined): {
|
|
140
|
+
provider: ProviderModule | undefined;
|
|
141
|
+
cliArgs: string[] | undefined;
|
|
142
|
+
};
|
|
134
143
|
export declare function supportsExplicitSessionResume(resume?: ProviderResumeCapability): boolean;
|
|
135
144
|
export declare function resolveCliSessionBinding(provider: ProviderModule | undefined, normalizedType: string, cliArgs?: string[], requestedResumeSessionId?: string): CliSessionBinding;
|
|
136
145
|
export declare class DaemonCliManager {
|
|
@@ -19,6 +19,18 @@
|
|
|
19
19
|
* machine-local policy directly. The repo file shapes the coordinator prompt and
|
|
20
20
|
* operating notes, nothing else.
|
|
21
21
|
*
|
|
22
|
+
* `providerDefaults` IS NOT POLICY EITHER. It is a repo-shared DECLARATIVE
|
|
23
|
+
* "requested auto-approve mode" per providerType — the answer to "WHEN a delegated
|
|
24
|
+
* worker of type X is auto-approved, WHICH mode should it use by default". It has
|
|
25
|
+
* NO say over WHETHER auto-approve is enabled: the ENABLE decision (and the
|
|
26
|
+
* dangerous-mode opt-in) remains 100% machine-local (meshes.json /
|
|
27
|
+
* RepoMeshPolicy). A repo can declare `providerDefaults` freely; a machine that
|
|
28
|
+
* has delegatedWorkerAutoApprove=false still gets no auto-approve, and a dangerous
|
|
29
|
+
* requested mode is still downgraded to PTY parsing unless the machine opts in.
|
|
30
|
+
* The requested mode ID is validated at runtime against the provider spec — an
|
|
31
|
+
* unknown mode ID is IGNORED (fall back to the provider's own default), never
|
|
32
|
+
* silently coerced into a dangerous mode.
|
|
33
|
+
*
|
|
22
34
|
* The coordinator/operatingNotes merge is **in-memory only**: the on-disk
|
|
23
35
|
* machine-local `meshes.json` is never mutated by this module.
|
|
24
36
|
*
|
|
@@ -48,6 +60,18 @@ export interface RepoMeshDeclarativeLimits {
|
|
|
48
60
|
/** Advisory only in v1 — recorded but never enforced. */
|
|
49
61
|
maxNotes?: number;
|
|
50
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Repo-shared declarative per-provider defaults. NOT policy — see the file header.
|
|
65
|
+
* `autoApproveModes` maps a providerType (e.g. "claude-cli") to the auto-approve
|
|
66
|
+
* mode ID that a delegated worker of that type should REQUEST when it is
|
|
67
|
+
* auto-approved. The map only influences WHICH mode is used, never WHETHER
|
|
68
|
+
* auto-approve is enabled (that stays machine-local). Mode IDs are validated
|
|
69
|
+
* against the live provider spec at resolve time; an unknown ID is ignored.
|
|
70
|
+
*/
|
|
71
|
+
export interface RepoMeshDeclarativeProviderDefaults {
|
|
72
|
+
/** providerType → requested auto-approve mode ID. */
|
|
73
|
+
autoApproveModes?: Record<string, string>;
|
|
74
|
+
}
|
|
51
75
|
/**
|
|
52
76
|
* Parsed + normalized `.adhdev/mesh.json` shape. Every field is optional except
|
|
53
77
|
* version so a repo can declare only the zone(s) it cares about. Policy is NOT a
|
|
@@ -58,6 +82,8 @@ export interface RepoMeshDeclarativeConfig {
|
|
|
58
82
|
coordinator?: RepoMeshDeclarativeCoordinatorConfig;
|
|
59
83
|
operatingNotes?: CoordinatorOperatingNote[];
|
|
60
84
|
limits?: RepoMeshDeclarativeLimits;
|
|
85
|
+
/** Repo-shared per-provider defaults (requested auto-approve mode). NOT policy. */
|
|
86
|
+
providerDefaults?: RepoMeshDeclarativeProviderDefaults;
|
|
61
87
|
}
|
|
62
88
|
export interface RepoMeshJsonConfigLoadResult {
|
|
63
89
|
config?: RepoMeshDeclarativeConfig;
|
|
@@ -133,6 +159,18 @@ export declare const MESH_JSON_CONFIG_SCHEMA: {
|
|
|
133
159
|
};
|
|
134
160
|
};
|
|
135
161
|
};
|
|
162
|
+
readonly providerDefaults: {
|
|
163
|
+
readonly type: "object";
|
|
164
|
+
readonly additionalProperties: false;
|
|
165
|
+
readonly properties: {
|
|
166
|
+
readonly autoApproveModes: {
|
|
167
|
+
readonly type: "object";
|
|
168
|
+
readonly additionalProperties: {
|
|
169
|
+
readonly type: "string";
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
136
174
|
};
|
|
137
175
|
};
|
|
138
176
|
/**
|
|
@@ -193,7 +231,31 @@ export declare function applyRepoMeshConfig<T extends Pick<LocalMeshEntry, 'coor
|
|
|
193
231
|
* exported — it is machine-local only and has no place in mesh.json. Operating
|
|
194
232
|
* notes are intentionally NOT exported either: those are runtime ledger lessons,
|
|
195
233
|
* and a repo should declare baseline notes deliberately.
|
|
234
|
+
*
|
|
235
|
+
* `providerDefaults` is NOT auto-exported from the machine-local mesh (there is no
|
|
236
|
+
* machine-local source for it — it is a repo-authored declaration). To help an
|
|
237
|
+
* operator hand-author it, the scaffold carries a commented example shape:
|
|
238
|
+
*
|
|
239
|
+
* "providerDefaults": {
|
|
240
|
+
* "autoApproveModes": {
|
|
241
|
+
* "claude-cli": "accept-edits", // requested mode WHEN auto-approve is on
|
|
242
|
+
* "codex-cli": "auto" // (enable/dangerous opt-in stays machine-local)
|
|
243
|
+
* }
|
|
244
|
+
* }
|
|
245
|
+
*
|
|
246
|
+
* The example is surfaced via the scaffold's `_providerDefaultsExample` hint (JSON
|
|
247
|
+
* has no comments) rather than a live `providerDefaults` value, so serializing the
|
|
248
|
+
* scaffold never writes an unwanted requested-mode map into the repo file.
|
|
196
249
|
*/
|
|
197
250
|
export declare function buildMeshJsonConfigScaffold(mesh: Pick<LocalMeshEntry, 'coordinator'>): RepoMeshDeclarativeConfig;
|
|
251
|
+
/**
|
|
252
|
+
* A copy-paste example of the `providerDefaults` zone for operators hand-authoring
|
|
253
|
+
* a repo `.adhdev/mesh.json`. Returned by the export/write commands as a separate
|
|
254
|
+
* hint field (never merged into the serialized scaffold) so the repo file stays
|
|
255
|
+
* clean. The mode IDs shown are illustrative — a repo should use IDs that exist in
|
|
256
|
+
* its own providers' specs; an unknown ID is ignored at resolve time and the
|
|
257
|
+
* provider's own default is used.
|
|
258
|
+
*/
|
|
259
|
+
export declare const MESH_JSON_PROVIDER_DEFAULTS_EXAMPLE: RepoMeshDeclarativeProviderDefaults;
|
|
198
260
|
/** Serialize a scaffold to the canonical 2-space JSON draft text. */
|
|
199
261
|
export declare function serializeMeshJsonConfigScaffold(config: RepoMeshDeclarativeConfig): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export type { SessionEntry, CompactSessionEntry, CompactDaemonEntry, CloudDaemon
|
|
|
8
8
|
export type { InteractivePrompt, InteractiveQuestion, InteractiveOption, InteractivePromptResponse, InteractiveAnswer, } from './providers/types/interactive-prompt.js';
|
|
9
9
|
export { normalizeInteractivePrompt, normalizeInteractivePromptResponse, buildClaudeInteractiveToolResult, interactivePromptFromClaudeAskUserQuestion, detectClaudeAskUserQuestionPromptFromJson, } from './providers/types/interactive-prompt.js';
|
|
10
10
|
export type { RepoMesh, RepoMeshDaemonRole, RepoMeshHostMetadata, RepoMeshHostPairingMetadata, RepoMeshHostStatus, RepoMeshNode, RepoMeshNodeHealth, RepoMeshPolicy, RepoMeshMagiSessionCleanupMode, RepoMeshNodePolicy, RepoMeshRelatedRepo, RepoMeshNodeCapabilities, DetectedCommand, ProjectContextSnapshot, ProjectContextSource, RepoMeshCoordinatorConfig, LocalMeshConfig, LocalMeshEntry, LocalMeshNodeEntry, RepoMeshStatus, RepoMeshNodeStatus, RepoMeshPeerConnectionStatus, RepoMeshPeerConnectionState, RepoMeshPeerConnectionTransport, RepoMeshSessionStatus, RepoMeshQueueTask, RepoMeshQueueTaskStatus, RepoMeshQueueSummary, RepoMeshQueueStatus, RepoMeshLedgerEntryStatus, RepoMeshLedgerSummaryStatus, RepoMeshLedgerStatus, MeshAsyncJobLifecycle, RepoMeshSchedulingStrategy, RepoMeshSchedulingStatus, RepoMeshNodeSchedulingStatus, RepoMeshNodeProviderSchedulingStatus, } from './repo-mesh-types.js';
|
|
11
|
-
export { DEFAULT_MESH_POLICY, resolveDelegatedWorkerAutoApprove, resolveAllowSendKeysDestructive, resolveMagiSessionCleanupMode, magiAutoLaunchedSessionCleanupDecision, MESH_SCHEDULING_STRATEGIES, DEFAULT_MESH_SCHEDULING_STRATEGY, normalizeMeshSchedulingStrategy, resolveNodeSchedulingPriority, resolveProviderMaxParallel, mergeAndNormalizePolicy, normalizeAutoFastForwardPolicy, resolveMaxParallelTasks, MESH_MAX_PARALLEL_TASKS_MIN, MESH_MAX_PARALLEL_TASKS_MAX, MESH_CONVERGE_REFINE_TAG, MESH_CONVERGE_FAST_FORWARD_TAG, resolveAutoConvergeCodeChange, } from './repo-mesh-types.js';
|
|
11
|
+
export { DEFAULT_MESH_POLICY, resolveDelegatedWorkerAutoApprove, delegatedWorkerAutoApproveSettings, resolveDelegatedWorkerDangerousModeAllow, resolveAllowSendKeysDestructive, resolveMagiSessionCleanupMode, magiAutoLaunchedSessionCleanupDecision, MESH_SCHEDULING_STRATEGIES, DEFAULT_MESH_SCHEDULING_STRATEGY, normalizeMeshSchedulingStrategy, resolveNodeSchedulingPriority, resolveProviderMaxParallel, mergeAndNormalizePolicy, normalizeAutoFastForwardPolicy, resolveMaxParallelTasks, MESH_MAX_PARALLEL_TASKS_MIN, MESH_MAX_PARALLEL_TASKS_MAX, MESH_CONVERGE_REFINE_TAG, MESH_CONVERGE_FAST_FORWARD_TAG, resolveAutoConvergeCodeChange, } from './repo-mesh-types.js';
|
|
12
|
+
export { loadRepoMeshJsonConfig, normalizeRepoMeshDeclarativeConfig, buildMeshJsonConfigScaffold, serializeMeshJsonConfigScaffold, MESH_JSON_CONFIG_LOCATIONS, MESH_JSON_CONFIG_SCHEMA, MESH_JSON_PROVIDER_DEFAULTS_EXAMPLE, } from './config/mesh-json-config.js';
|
|
13
|
+
export type { RepoMeshDeclarativeConfig, RepoMeshDeclarativeCoordinatorConfig, RepoMeshDeclarativeLimits, RepoMeshDeclarativeProviderDefaults, RepoMeshJsonConfigLoadResult, } from './config/mesh-json-config.js';
|
|
12
14
|
export * from './git/index.js';
|
|
13
15
|
import type { RuntimeWriteOwner as _RuntimeWriteOwner } from './shared-types-extra.js';
|
|
14
16
|
import type { RuntimeAttachedClient as _RuntimeAttachedClient } from './shared-types-extra.js';
|
|
@@ -137,7 +139,7 @@ export { ProviderInstanceManager } from './providers/provider-instance-manager.j
|
|
|
137
139
|
export { IdeProviderInstance } from './providers/ide-provider-instance.js';
|
|
138
140
|
export { CliProviderInstance } from './providers/cli-provider-instance.js';
|
|
139
141
|
export { AcpProviderInstance } from './providers/acp-provider-instance.js';
|
|
140
|
-
export type { ProviderModule, CdpTargetFilter, ProviderResumeCapability, InputEnvelope, InputPart, MessagePart, ReadChatTurnStatus, ControlListResult, ControlSetResult, ControlInvokeResult } from './providers/contracts.js';
|
|
142
|
+
export type { ProviderModule, AutoApproveMode, AutoApproveModesConfig, AutoApproveModeRisk, AutoApproveModeStrategy, CdpTargetFilter, ProviderResumeCapability, InputEnvelope, InputPart, MessagePart, ReadChatTurnStatus, ControlListResult, ControlSetResult, ControlInvokeResult } from './providers/contracts.js';
|
|
141
143
|
export type { ProviderSourceConfigSnapshot, ProviderSourceConfigUpdate } from './config/provider-source-config.js';
|
|
142
144
|
export { parseProviderSourceConfigUpdate } from './config/provider-source-config.js';
|
|
143
145
|
export { normalizeInputEnvelope, normalizeMessageParts, flattenMessageParts } from './providers/io-contracts.js';
|