maka-agent 0.2.0-dev.34.20260915 → 0.2.0-dev.36.20260915
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/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
- package/node_modules/@maka/core/dist/model-metadata.generated.js +175 -116
- package/node_modules/@maka/core/dist/models-dev-projection.js +1 -0
- package/node_modules/@maka/core/dist/provider-registry.js +17 -0
- package/node_modules/@maka/eval/dist/harbor-maka-subject.js +13 -3
- package/node_modules/@maka/eval/dist/maka-artifacts.js +28 -14
- package/node_modules/@maka/eval/dist/maka-subject.js +28 -3
- package/node_modules/@maka/eval/harbor/relay_agent.py +42 -2
- package/node_modules/@maka/runtime/dist/ai-sdk-backend.js +0 -1
- package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +40 -53
- package/node_modules/@maka/runtime/dist/ai-sdk-turn.js +28 -47
- package/node_modules/@maka/runtime/dist/builtin-tools.js +20 -12
- package/node_modules/@maka/runtime/dist/openai-codex-history-compactor.js +1 -2
- package/node_modules/@maka/runtime/dist/provider-error-classification.js +29 -38
- package/node_modules/@maka/runtime/dist/runtime-kernel.js +1 -0
- package/node_modules/@maka/runtime/dist/telemetry/model-pricing.generated.js +144 -77
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/run-code-mode.js +6 -19
- package/node_modules/@maka/runtime-host/dist/client/connect-or-spawn.js +28 -4
- package/node_modules/@maka/runtime-host/dist/client/connection.js +20 -2
- package/node_modules/@maka/runtime-host/dist/client/hosted-execution-target.js +27 -6
- package/node_modules/@maka/runtime-host/dist/client/hosted-execution.js +10 -28
- package/node_modules/@maka/runtime-host/dist/client/startup-error.js +1 -1
- package/node_modules/@maka/runtime-host/dist/client/wait-for-ready.js +1 -1
- package/node_modules/@maka/runtime-host/dist/control/endpoint.js +7 -6
- package/node_modules/@maka/runtime-host/dist/execution-candidate-main.js +8 -1
- package/node_modules/@maka/runtime-host/dist/protocol/agent-graph.js +1 -11
- package/node_modules/@maka/runtime-host/dist/protocol/client-capability.js +2 -2
- package/node_modules/@maka/runtime-host/dist/protocol/codec.js +11 -0
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +1 -1
- package/node_modules/@maka/runtime-host/dist/protocol/workhub-coordination.js +10 -2
- package/node_modules/@maka/runtime-host/dist/server/bootstrap-runtime-policy.js +65 -0
- package/node_modules/@maka/runtime-host/dist/server/execution-candidate.js +4 -1
- package/node_modules/@maka/runtime-host/dist/server/execution-composition-factory.js +9 -3
- package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +13 -2
- package/node_modules/@maka/runtime-host/dist/server/hosted-execution-tool-profile.js +3 -15
- package/node_modules/@maka/runtime-host/dist/server/interactive-run-composer.js +9 -4
- package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +1 -2
- package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +4 -1
- package/node_modules/@maka/runtime-host/dist/server/workhub-message-attachments.js +1 -0
- package/node_modules/@maka/storage/dist/agent-run-store-contract.js +945 -0
- package/node_modules/@maka/storage/dist/agent-run-store.js +3 -923
- package/node_modules/@maka/storage/dist/artifact-store.js +63 -7
- package/node_modules/@maka/storage/dist/execution-persistence-provider.js +54 -0
- package/node_modules/@maka/storage/dist/execution-stores.js +182 -59
- package/node_modules/@maka/storage/dist/goal-authority.js +39 -8
- package/node_modules/@maka/storage/dist/graph-control-values.js +126 -0
- package/node_modules/@maka/storage/dist/interaction-store-contract.js +231 -0
- package/node_modules/@maka/storage/dist/interaction-store.js +62 -217
- package/node_modules/@maka/storage/dist/local-execution-persistence.js +80 -0
- package/node_modules/@maka/storage/dist/message-admission-store.js +5 -3
- package/node_modules/@maka/storage/dist/root-authority.js +4 -0
- package/node_modules/@maka/{eval/dist/maka-runtime-policy.js → storage/dist/runtime-event-store-contract.js} +1 -24
- package/node_modules/@maka/storage/dist/runtime-partial-values.js +114 -0
- package/node_modules/@maka/storage/dist/session-store-contract.js +61 -0
- package/node_modules/@maka/storage/dist/session-store-values.js +342 -0
- package/node_modules/@maka/storage/dist/session-store.js +7 -351
- package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +4 -185
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +23 -135
- package/node_modules/@maka/storage/dist/storage-writer-composition.js +2 -3
- package/node_modules/@maka/storage/dist/tool-commit-validation.js +111 -0
- package/node_modules/@maka/storage/package.json +1 -0
- package/package.json +1 -1
|
@@ -67,7 +67,6 @@ import { PluginSessionQueryService } from '@maka/runtime/plugin-session-query-se
|
|
|
67
67
|
import { PluginShellEnvService } from '@maka/runtime/plugin-shell-env-service';
|
|
68
68
|
import { PluginSkillService } from '@maka/runtime/plugin-skill-service';
|
|
69
69
|
import { isHostedExecutionTerminal } from './hosted-execution-authority.js';
|
|
70
|
-
import { createAgentGraphControlStore } from '@maka/storage/agent-graph-control-store';
|
|
71
70
|
import { createArtifactAttachmentResourceReader } from '@maka/storage/artifact-stores';
|
|
72
71
|
import { createReadImageSnapshotStore } from '@maka/storage/read-image-snapshot-store';
|
|
73
72
|
import { isSessionNotFoundError } from '@maka/storage/execution-stores';
|
|
@@ -175,12 +174,14 @@ export function runtimeHostFilesystemWorkerRuntime(versions) {
|
|
|
175
174
|
}
|
|
176
175
|
export async function createExecutionRuntimeHostComposition(context, options = {}, dependencies = {}) {
|
|
177
176
|
const storage = await openStorageWriterComposition(context.owner.lease, {
|
|
177
|
+
executionProvider: dependencies.executionPersistenceProvider,
|
|
178
178
|
contextOffloadLimits: CONTEXT_OFFLOAD_LIMITS,
|
|
179
179
|
afterRuntimePolicyOpened: async (stores) => {
|
|
180
180
|
if (options.bootstrapRuntimePolicy !== false) {
|
|
181
181
|
await ensureBootstrapRuntimePolicy({
|
|
182
182
|
workspaceRoot: context.owner.capability.canonicalPath,
|
|
183
183
|
stores,
|
|
184
|
+
initialization: options.initialization,
|
|
184
185
|
onDeferredError: (error) => console.error(`[runtime-host] optional bootstrap target could not be configured: ${generalizedErrorMessage(error)}`),
|
|
185
186
|
});
|
|
186
187
|
}
|
|
@@ -499,7 +500,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
|
|
|
499
500
|
hostTools: childHostTools,
|
|
500
501
|
worktreePatchWriteBackAvailable: true,
|
|
501
502
|
});
|
|
502
|
-
const openedGraphControlStore =
|
|
503
|
+
const openedGraphControlStore = stores.graphControlStore;
|
|
503
504
|
graphControlStore = openedGraphControlStore;
|
|
504
505
|
let resolveAvailableToolNames;
|
|
505
506
|
let resolveNewSessionToolNames;
|
|
@@ -1028,6 +1029,16 @@ export async function createExecutionRuntimeHostComposition(context, options = {
|
|
|
1028
1029
|
},
|
|
1029
1030
|
}),
|
|
1030
1031
|
runBackendActivation: (operation) => runtimePolicyActivation.runBackendActivation(operation),
|
|
1032
|
+
resolveFreshTurnToolMode: async (header) => {
|
|
1033
|
+
// WorkHub keeps one permanent Session, so creation-time defaults cannot
|
|
1034
|
+
// track this setting. Snapshot it per turn without rewriting that Session.
|
|
1035
|
+
if (header.id !== WORKHUB_COORDINATION_SESSION_ID)
|
|
1036
|
+
return undefined;
|
|
1037
|
+
return (await runtimePolicyStores.runtimePolicy.getSnapshot()).policy.chatDefaults
|
|
1038
|
+
.codeModeEnabled
|
|
1039
|
+
? 'code_mode'
|
|
1040
|
+
: 'direct';
|
|
1041
|
+
},
|
|
1031
1042
|
messageAuthority: runtimeAuthority,
|
|
1032
1043
|
hostedAgentGraphExecution: {
|
|
1033
1044
|
readAgentGraphIntentClaim: (graphId, intentId) => openedGraphControlStore.readAgentGraphIntentClaim(graphId, intentId),
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
19
|
import { parseAttachmentResourceRef } from '@maka/core/attachments';
|
|
20
|
-
import { z } from 'zod';
|
|
21
20
|
import { readParameters, resolveReadInput } from '@maka/runtime/read-page';
|
|
22
21
|
const HEADLESS_CODING_V1_TOOL_NAMES = [
|
|
23
22
|
'Bash',
|
|
23
|
+
'StopBackgroundTask',
|
|
24
|
+
'WriteStdin',
|
|
24
25
|
'Read',
|
|
25
26
|
'Write',
|
|
26
27
|
'Edit',
|
|
@@ -34,13 +35,6 @@ const HEADLESS_CODING_V1_SYSTEM_PROMPT = [
|
|
|
34
35
|
'Verify the result when practical.',
|
|
35
36
|
'Stop when the task is complete.',
|
|
36
37
|
].join('\n');
|
|
37
|
-
const HEADLESS_CODING_V1_BASH_DESCRIPTION = 'Run a foreground shell command in the session cwd. Use Bash for inspection, builds, tests, and task-local generation. Background execution and PTY sessions are unavailable in this profile.';
|
|
38
|
-
const HEADLESS_CODING_V1_BASH_PARAMETERS = z
|
|
39
|
-
.object({
|
|
40
|
-
command: z.string().describe('The shell command to execute'),
|
|
41
|
-
timeout_ms: z.number().int().positive().max(600_000).optional(),
|
|
42
|
-
})
|
|
43
|
-
.strict();
|
|
44
38
|
const WORKHUB_COORDINATION_V1_SYSTEM_PROMPT = [
|
|
45
39
|
'You are the conversational coordinator for WorkHub.',
|
|
46
40
|
'Answer ordinary questions directly and help the user clarify intent.',
|
|
@@ -136,11 +130,5 @@ export function projectHostedExecutionTools(tools, profile) {
|
|
|
136
130
|
parameters: WORKHUB_ATTACHMENT_READ_PARAMETERS,
|
|
137
131
|
impl: (input, context) => tool.impl(WORKHUB_ATTACHMENT_READ_PARAMETERS.parse(input), context),
|
|
138
132
|
}
|
|
139
|
-
: tool
|
|
140
|
-
? {
|
|
141
|
-
...tool,
|
|
142
|
-
description: HEADLESS_CODING_V1_BASH_DESCRIPTION,
|
|
143
|
-
parameters: HEADLESS_CODING_V1_BASH_PARAMETERS,
|
|
144
|
-
}
|
|
145
|
-
: tool);
|
|
133
|
+
: tool);
|
|
146
134
|
}
|
|
@@ -355,9 +355,14 @@ function assertUniqueToolNames(tools) {
|
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
function buildDefaultHostTools(sessionTodo, inventoryFor, builtinOptions, hostTools = [], scheduledTaskTool, goalTools = [], parentAgentTools = [], plan, deepResearchTools = []) {
|
|
358
|
-
|
|
358
|
+
// Full access has no boundary to widen, so neither the Bash declaration nor
|
|
359
|
+
// the widening tool is offered. An unknown mode is not Full access.
|
|
360
|
+
const fullAccess = plan?.permissionMode === 'bypass';
|
|
361
|
+
const builtins = builtinOptions
|
|
362
|
+
? buildBuiltinTools({ ...builtinOptions, declareSandboxBoundary: !fullAccess })
|
|
363
|
+
: [];
|
|
359
364
|
const question = buildAskUserQuestionTool();
|
|
360
|
-
const sandboxBoundary = buildRequestSandboxBoundaryTool();
|
|
365
|
+
const sandboxBoundary = fullAccess ? undefined : buildRequestSandboxBoundaryTool();
|
|
361
366
|
const todoTools = buildSessionTodoTools(sessionTodo);
|
|
362
367
|
const activeExecution = plan ? activePlanExecution(plan.state) : undefined;
|
|
363
368
|
const interruptedExecution = plan
|
|
@@ -377,7 +382,7 @@ function buildDefaultHostTools(sessionTodo, inventoryFor, builtinOptions, hostTo
|
|
|
377
382
|
...builtins.map((tool) => tool.name),
|
|
378
383
|
...hostTools.map((tool) => tool.name),
|
|
379
384
|
question.name,
|
|
380
|
-
sandboxBoundary.name,
|
|
385
|
+
...(sandboxBoundary ? [sandboxBoundary.name] : []),
|
|
381
386
|
'Skill',
|
|
382
387
|
'SkillSearch',
|
|
383
388
|
...todoTools.map((tool) => tool.name),
|
|
@@ -393,7 +398,7 @@ function buildDefaultHostTools(sessionTodo, inventoryFor, builtinOptions, hostTo
|
|
|
393
398
|
...builtins,
|
|
394
399
|
...hostTools,
|
|
395
400
|
question,
|
|
396
|
-
sandboxBoundary,
|
|
401
|
+
...(sandboxBoundary ? [sandboxBoundary] : []),
|
|
397
402
|
buildSkillAgentToolFromInventory(inventoryFor, skillHost, { shadowTracker }),
|
|
398
403
|
buildSkillSearchAgentToolFromInventory(inventoryFor, skillHost, { shadowTracker }),
|
|
399
404
|
...todoTools,
|
|
@@ -498,8 +498,7 @@ export class HostMessageCoordinator {
|
|
|
498
498
|
throw new RuntimeMessageAuthorityInvariantError(`Root admission does not prove Message handoff ${messageId}`);
|
|
499
499
|
}
|
|
500
500
|
return {
|
|
501
|
-
|
|
502
|
-
content: proof.sourceMessage.content,
|
|
501
|
+
...proof.sourceMessage,
|
|
503
502
|
admittedAt: proof.admission.admittedAt,
|
|
504
503
|
};
|
|
505
504
|
}
|
|
@@ -451,7 +451,10 @@ export class HostSessionCatalogCoordinator {
|
|
|
451
451
|
return this.#updateConfiguration({
|
|
452
452
|
sessionId: WORKHUB_COORDINATION_SESSION_ID,
|
|
453
453
|
expectedRevision: input.expectedRevision,
|
|
454
|
-
patch: {
|
|
454
|
+
patch: {
|
|
455
|
+
modelTarget: input.modelTarget,
|
|
456
|
+
thinkingLevel: input.thinkingLevel,
|
|
457
|
+
},
|
|
455
458
|
}, 'workhub');
|
|
456
459
|
}
|
|
457
460
|
async #updateConfiguration(input, authority = 'ordinary') {
|
|
@@ -33,6 +33,7 @@ export async function copyWorkHubAttachmentsToTarget(store, artifacts, targetSes
|
|
|
33
33
|
targetSessionId,
|
|
34
34
|
turnIds: [],
|
|
35
35
|
includeArtifactIds: ids,
|
|
36
|
+
existingTarget: 'reuse_verified',
|
|
36
37
|
});
|
|
37
38
|
return attachments.map((attachment, index) => {
|
|
38
39
|
const relativePath = copied.artifactIds.get(ids[index]);
|