mixdog 0.9.106 → 0.9.107
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/package.json +1 -1
- package/src/runtime/agent/orchestrator/session/approval-mode.mjs +9 -0
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +8 -1
- package/src/runtime/shared/automation-workflow.mjs +7 -4
- package/src/session-runtime/runtime-core.mjs +2 -0
- package/src/session-runtime/session-lifecycle.mjs +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const IMPLICIT_APPROVAL_MODE = 'implicit';
|
|
2
|
+
export const IMPLICIT_APPROVAL_CONTEXT =
|
|
3
|
+
'Non-interactive execution: treat the initial user request as the approved plan and proceed without requesting approval.';
|
|
4
|
+
|
|
5
|
+
export function workflowContextForApprovalMode(workflowContext, approvalMode) {
|
|
6
|
+
if (approvalMode !== IMPLICIT_APPROVAL_MODE) return workflowContext || null;
|
|
7
|
+
const workflow = typeof workflowContext === 'string' ? workflowContext.trim() : '';
|
|
8
|
+
return [workflow, IMPLICIT_APPROVAL_CONTEXT].filter(Boolean).join('\n\n');
|
|
9
|
+
}
|
|
@@ -34,6 +34,10 @@ import { getAgentRuntimeSync, warnAgentRuntimeResolveFailureOnce } from './agent
|
|
|
34
34
|
import { mintSessionId } from './session-id.mjs';
|
|
35
35
|
import { providerCacheKey } from './provider-cache-key.mjs';
|
|
36
36
|
import { clearTurnCheckpoint, recoverTurnCheckpoint } from './turn-checkpoint.mjs';
|
|
37
|
+
import {
|
|
38
|
+
IMPLICIT_APPROVAL_MODE,
|
|
39
|
+
workflowContextForApprovalMode,
|
|
40
|
+
} from '../approval-mode.mjs';
|
|
37
41
|
|
|
38
42
|
function buildSessionProviderCacheOpts(providerName, sessionId, agent = null) {
|
|
39
43
|
// Keep this in sync with createSession's provider-cache policy: only
|
|
@@ -274,7 +278,7 @@ export function createSession(opts) {
|
|
|
274
278
|
skipRoleCatalog: !ownerIsAgent,
|
|
275
279
|
profile: profile || undefined,
|
|
276
280
|
agent: resolvedAgent,
|
|
277
|
-
workflowContext: opts.workflowContext
|
|
281
|
+
workflowContext: workflowContextForApprovalMode(opts.workflowContext, opts.approvalMode),
|
|
278
282
|
workspaceContext: opts.workspaceContext || null,
|
|
279
283
|
coreMemoryContext: opts.coreMemoryContext || null,
|
|
280
284
|
skillManifest: buildSkillManifest(skills),
|
|
@@ -373,6 +377,9 @@ export function createSession(opts) {
|
|
|
373
377
|
fast,
|
|
374
378
|
agent: opts.agent,
|
|
375
379
|
owner: opts.owner || 'user',
|
|
380
|
+
...(opts.approvalMode === IMPLICIT_APPROVAL_MODE
|
|
381
|
+
? { approvalMode: IMPLICIT_APPROVAL_MODE }
|
|
382
|
+
: {}),
|
|
376
383
|
mcpPid: process.pid,
|
|
377
384
|
mcpScopeId: opts.mcpScopeId || null,
|
|
378
385
|
scopeKey: opts.scopeKey || null,
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { createWorkflowHelpers } from '../../session-runtime/workflow.mjs';
|
|
10
10
|
import { STANDALONE_ROOT, STANDALONE_DATA_DIR } from '../../session-runtime/runtime-paths.mjs';
|
|
11
11
|
import { readMarkdownDocument, normalizeAgentPermissionOrNone } from './markdown-frontmatter.mjs';
|
|
12
|
+
import { IMPLICIT_APPROVAL_MODE } from '../agent/orchestrator/session/approval-mode.mjs';
|
|
12
13
|
|
|
13
14
|
let _helpers = null;
|
|
14
15
|
function helpers() {
|
|
@@ -23,19 +24,21 @@ function helpers() {
|
|
|
23
24
|
return _helpers;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
/**
|
|
27
|
+
/** Non-interactive createSession opts, plus workflow context when the id resolves. */
|
|
27
28
|
export function automationWorkflowOpts(workflowId) {
|
|
29
|
+
const approvalOpts = { approvalMode: IMPLICIT_APPROVAL_MODE };
|
|
28
30
|
const id = String(workflowId || '').trim();
|
|
29
|
-
if (!id) return
|
|
31
|
+
if (!id) return approvalOpts;
|
|
30
32
|
try {
|
|
31
33
|
const h = helpers();
|
|
32
34
|
const pack = h.loadWorkflowPack(undefined, id);
|
|
33
|
-
if (!pack) return
|
|
35
|
+
if (!pack) return approvalOpts;
|
|
34
36
|
return {
|
|
37
|
+
...approvalOpts,
|
|
35
38
|
workflow: h.workflowSummary(pack),
|
|
36
39
|
workflowContext: h.workflowContextBlock({ workflow: { active: id } }, undefined),
|
|
37
40
|
};
|
|
38
41
|
} catch {
|
|
39
|
-
return
|
|
42
|
+
return approvalOpts;
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -329,6 +329,7 @@ export async function createMixdogSessionRuntime({
|
|
|
329
329
|
model,
|
|
330
330
|
cwd = process.cwd(),
|
|
331
331
|
toolMode = 'full',
|
|
332
|
+
approvalMode = null,
|
|
332
333
|
remote = false,
|
|
333
334
|
desktopSession: initialDesktopSession = null,
|
|
334
335
|
agentSession = null,
|
|
@@ -336,6 +337,7 @@ export async function createMixdogSessionRuntime({
|
|
|
336
337
|
// Shared mutable runtime state, promoted from closure `let`s so extracted
|
|
337
338
|
// modules can read/write live values through one reference.
|
|
338
339
|
const rt = {};
|
|
340
|
+
rt.approvalMode = approvalMode === 'implicit' ? 'implicit' : null;
|
|
339
341
|
rt.mcpScopeId = randomUUID();
|
|
340
342
|
rt.desktopSession = initialDesktopSession;
|
|
341
343
|
// Agent shard spread: a daemon-hosted worker runtime carries the resolved
|
|
@@ -232,6 +232,7 @@ export function createSessionLifecycle({
|
|
|
232
232
|
lane: 'cli',
|
|
233
233
|
sourceType: 'lead',
|
|
234
234
|
sourceName: 'main',
|
|
235
|
+
...(rt.approvalMode ? { approvalMode: rt.approvalMode } : {}),
|
|
235
236
|
clientHostPid: process.pid,
|
|
236
237
|
mcpScopeId: rt.mcpScopeId,
|
|
237
238
|
disallowedTools: [...LEAD_DISALLOWED_TOOLS, ...featureDisallowedTools()],
|