maka-agent 0.2.0-dev.44.20260920 → 0.2.0-dev.46.20260922

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.
Files changed (61) hide show
  1. package/dist/runtime-host-service-manager.js +1 -6
  2. package/dist/runtime-host-update-command.js +39 -27
  3. package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
  4. package/node_modules/@maka/core/dist/artifacts.js +1 -0
  5. package/node_modules/@maka/core/dist/model-metadata.js +1 -2
  6. package/node_modules/@maka/core/dist/provider-auth.js +1 -7
  7. package/node_modules/@maka/core/dist/provider-registry.js +13 -7
  8. package/node_modules/@maka/core/dist/recall.js +5 -1
  9. package/node_modules/@maka/core/dist/session-start-mode.js +2 -5
  10. package/node_modules/@maka/core/dist/session.js +0 -1
  11. package/node_modules/@maka/core/dist/settings.js +17 -0
  12. package/node_modules/@maka/core/dist/tool-quiet-preview.js +2 -16
  13. package/node_modules/@maka/core/dist/transcript-search.js +46 -0
  14. package/node_modules/@maka/core/package.json +1 -4
  15. package/node_modules/@maka/runtime/dist/model-factory.js +0 -16
  16. package/node_modules/@maka/runtime/dist/model-fetcher.js +1 -4
  17. package/node_modules/@maka/runtime/dist/model-runtime.js +0 -8
  18. package/node_modules/@maka/runtime/dist/recall-tools.js +4 -0
  19. package/node_modules/@maka/runtime/dist/session-manager.js +4 -13
  20. package/node_modules/@maka/runtime/dist/subagent-tools.js +69 -11
  21. package/node_modules/@maka/runtime/dist/test-connection.js +1 -48
  22. package/node_modules/@maka/runtime/package.json +0 -1
  23. package/node_modules/@maka/runtime-host/dist/client/host-handoff-copy.js +25 -18
  24. package/node_modules/@maka/runtime-host/dist/client/host-handoff.js +3 -1
  25. package/node_modules/@maka/runtime-host/dist/protocol/connection-effects.js +0 -108
  26. package/node_modules/@maka/runtime-host/dist/protocol/index.js +6 -1
  27. package/node_modules/@maka/runtime-host/dist/protocol/operations.js +4 -5
  28. package/node_modules/@maka/runtime-host/dist/protocol/recall.js +270 -0
  29. package/node_modules/@maka/runtime-host/dist/protocol/session-continuity.js +1 -7
  30. package/node_modules/@maka/runtime-host/dist/protocol/usage-screen.js +12 -4
  31. package/node_modules/@maka/runtime-host/dist/server/access-credential-store.js +4 -0
  32. package/node_modules/@maka/runtime-host/dist/server/connection-effect-coordinator.js +1 -57
  33. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +11 -33
  34. package/node_modules/@maka/runtime-host/dist/server/interactive-run-composer.js +3 -20
  35. package/node_modules/@maka/runtime-host/dist/server/recall-coordinator.js +117 -0
  36. package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +0 -4
  37. package/node_modules/@maka/storage/dist/artifact-metadata-codec.js +4 -3
  38. package/node_modules/@maka/storage/dist/artifact-store.js +1 -11
  39. package/node_modules/@maka/storage/dist/process-lifetime-file-update-lock.js +0 -41
  40. package/node_modules/@maka/storage/dist/runtime-policy/coordinator.js +0 -28
  41. package/node_modules/@maka/storage/dist/runtime-policy-stores.js +0 -2
  42. package/node_modules/@maka/storage/dist/sqlite-usage-schema.js +29 -5
  43. package/node_modules/@maka/storage/dist/sqlite-workflow-schema.js +2 -0
  44. package/node_modules/@maka/storage/dist/storage-writer-composition.js +0 -3
  45. package/node_modules/@maka/storage/dist/telemetry-file-schema.js +5 -3
  46. package/node_modules/@maka/storage/dist/usage-screen.js +5 -6
  47. package/node_modules/@maka/storage/dist/usage-stores.js +14 -4
  48. package/node_modules/@maka/storage/package.json +0 -2
  49. package/package.json +1 -1
  50. package/node_modules/@maka/core/dist/connection-usage.js +0 -27
  51. package/node_modules/@maka/core/dist/deep-research-client-progress.js +0 -132
  52. package/node_modules/@maka/core/dist/deep-research-run.js +0 -625
  53. package/node_modules/@maka/core/dist/deep-research.js +0 -208
  54. package/node_modules/@maka/core/dist/thread-search.js +0 -498
  55. package/node_modules/@maka/runtime/dist/commandcode-cli-language-model.js +0 -837
  56. package/node_modules/@maka/runtime/dist/connection-usage.js +0 -232
  57. package/node_modules/@maka/runtime/dist/deep-research-tools.js +0 -732
  58. package/node_modules/@maka/runtime-host/dist/protocol/deep-research.js +0 -233
  59. package/node_modules/@maka/runtime-host/dist/server/deep-research-coordinator.js +0 -116
  60. package/node_modules/@maka/storage/dist/deep-research-authority.js +0 -129
  61. package/node_modules/@maka/storage/dist/deep-research-store.js +0 -343
@@ -1,132 +0,0 @@
1
- /*
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
- import { buildDeepResearchImplementationPrompt } from './deep-research.js';
20
- import { DEEP_RESEARCH_CLIENT_IMPLEMENTATION_PROMPT_MAX_BYTES, DEEP_RESEARCH_CLIENT_OBJECTIVE_MAX_BYTES, DEEP_RESEARCH_CLIENT_PROGRESS_MAX_BYTES, DEEP_RESEARCH_CLIENT_RECENT_ITEMS_MAX, DEEP_RESEARCH_CLIENT_TEXT_MAX_BYTES, } from './deep-research-run.js';
21
- /** Build the single bounded product projection used by local and hosted clients. */
22
- export function projectDeepResearchClientProgress(run) {
23
- const blockers = [
24
- ...run.checklist.flatMap((item) => item.blockedReason ? [labeledBlocker(item.title, item.blockedReason)] : []),
25
- ...run.steps.flatMap((step) => step.blockedReason ? [labeledBlocker(step.objective, step.blockedReason)] : []),
26
- ];
27
- const base = {
28
- sessionId: run.sessionId,
29
- objective: truncateUtf8(run.objective, DEEP_RESEARCH_CLIENT_OBJECTIVE_MAX_BYTES),
30
- scopeLevel: run.scopeLevel,
31
- status: run.status,
32
- stage: run.stage,
33
- round: run.round,
34
- createdAt: run.createdAt,
35
- updatedAt: run.updatedAt,
36
- artifactsCount: run.artifacts.length,
37
- stepsCount: run.steps.length,
38
- checklist: run.checklist.map((item) => ({
39
- itemId: item.itemId,
40
- title: truncateUtf8(item.title, DEEP_RESEARCH_CLIENT_TEXT_MAX_BYTES),
41
- status: item.status,
42
- ...(item.blockedReason
43
- ? { blockedReason: truncateUtf8(item.blockedReason, DEEP_RESEARCH_CLIENT_TEXT_MAX_BYTES) }
44
- : {}),
45
- })),
46
- reportSections: run.reportSections.map(({ key, status }) => ({ key, status })),
47
- recentInspectedRefs: run.steps
48
- .flatMap((step) => step.inspectedRefs)
49
- .slice(-DEEP_RESEARCH_CLIENT_RECENT_ITEMS_MAX)
50
- .map((ref) => ({
51
- kind: ref.kind,
52
- locator: truncateUtf8(ref.locator, DEEP_RESEARCH_CLIENT_TEXT_MAX_BYTES),
53
- ...(ref.label
54
- ? { label: truncateUtf8(ref.label, DEEP_RESEARCH_CLIENT_TEXT_MAX_BYTES) }
55
- : {}),
56
- })),
57
- workerRunIds: [...new Set(run.steps.flatMap((step) => step.workerRunIds))].slice(-DEEP_RESEARCH_CLIENT_RECENT_ITEMS_MAX),
58
- blockers: [
59
- ...new Set(blockers.map((value) => truncateUtf8(value, DEEP_RESEARCH_CLIENT_TEXT_MAX_BYTES))),
60
- ].slice(-DEEP_RESEARCH_CLIENT_RECENT_ITEMS_MAX),
61
- ...(run.reportArtifactId ? { reportArtifactId: run.reportArtifactId } : {}),
62
- };
63
- if (encodedBytes(base) > DEEP_RESEARCH_CLIENT_PROGRESS_MAX_BYTES) {
64
- throw new Error('Deep Research client progress cannot fit its required fields');
65
- }
66
- if (run.status !== 'completed')
67
- return base;
68
- return fitImplementationPrompt(base, buildDeepResearchImplementationPrompt(run));
69
- }
70
- function labeledBlocker(label, reason) {
71
- const separator = ': ';
72
- const reasonBudget = Math.floor(DEEP_RESEARCH_CLIENT_TEXT_MAX_BYTES * 0.75);
73
- const boundedReason = truncateUtf8(reason, reasonBudget);
74
- const titleBudget = DEEP_RESEARCH_CLIENT_TEXT_MAX_BYTES - utf8Bytes(separator) - utf8Bytes(boundedReason);
75
- return `${truncateUtf8(label, titleBudget)}${separator}${boundedReason}`;
76
- }
77
- function fitImplementationPrompt(base, prompt) {
78
- const bounded = truncateUtf8(prompt, DEEP_RESEARCH_CLIENT_IMPLEMENTATION_PROMPT_MAX_BYTES);
79
- const full = { ...base, implementationPrompt: bounded };
80
- if (encodedBytes(full) <= DEEP_RESEARCH_CLIENT_PROGRESS_MAX_BYTES)
81
- return full;
82
- const characters = Array.from(bounded);
83
- let low = 1;
84
- let high = characters.length;
85
- let best = base;
86
- while (low <= high) {
87
- const midpoint = Math.floor((low + high) / 2);
88
- const candidate = {
89
- ...base,
90
- implementationPrompt: truncateCharacters(bounded, midpoint),
91
- };
92
- if (encodedBytes(candidate) <= DEEP_RESEARCH_CLIENT_PROGRESS_MAX_BYTES) {
93
- best = candidate;
94
- low = midpoint + 1;
95
- }
96
- else {
97
- high = midpoint - 1;
98
- }
99
- }
100
- return best;
101
- }
102
- function truncateCharacters(value, maxCharacters) {
103
- const characters = Array.from(value);
104
- if (characters.length <= maxCharacters)
105
- return value;
106
- if (maxCharacters === 1)
107
- return characters[0] ?? '…';
108
- return `${characters.slice(0, maxCharacters - 1).join('')}…`;
109
- }
110
- function encodedBytes(value) {
111
- return new TextEncoder().encode(JSON.stringify(value)).byteLength;
112
- }
113
- function utf8Bytes(value) {
114
- return new TextEncoder().encode(value).byteLength;
115
- }
116
- function truncateUtf8(value, maxBytes) {
117
- const encoder = new TextEncoder();
118
- if (encoder.encode(value).byteLength <= maxBytes)
119
- return value;
120
- const marker = '…';
121
- const markerBytes = encoder.encode(marker).byteLength;
122
- let bytes = 0;
123
- let output = '';
124
- for (const character of value) {
125
- const characterBytes = encoder.encode(character).byteLength;
126
- if (bytes + characterBytes + markerBytes > maxBytes)
127
- break;
128
- output += character;
129
- bytes += characterBytes;
130
- }
131
- return `${output}${marker}`;
132
- }