maka-agent 0.2.0-dev.47.20260922 → 0.2.0-dev.48.20260923
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/runtime-host-capability-provider-command.js +25 -6
- package/dist/tui-mcp-control.js +37 -24
- package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
- package/node_modules/@maka/acp-executor-plugin/dist/acp-errors.js +26 -0
- package/node_modules/@maka/acp-executor-plugin/dist/acp-filesystem.js +103 -0
- package/node_modules/@maka/acp-executor-plugin/dist/acp-process.js +119 -0
- package/node_modules/@maka/acp-executor-plugin/dist/acp-projection.js +146 -0
- package/node_modules/@maka/acp-executor-plugin/dist/index.js +653 -0
- package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +24446 -0
- package/node_modules/@maka/acp-executor-plugin/package.json +15 -0
- package/node_modules/@maka/antigravity-acp-plugin/dist/index.js +88 -0
- package/node_modules/@maka/antigravity-acp-plugin/dist/model-presentation.js +53 -0
- package/node_modules/@maka/antigravity-acp-plugin/dist/plugin.mjs +115 -0
- package/node_modules/@maka/antigravity-acp-plugin/package.json +15 -0
- package/node_modules/@maka/core/dist/executor-catalog.js +106 -0
- package/node_modules/@maka/core/dist/mcp.js +4 -1
- package/node_modules/@maka/core/dist/model-metadata.js +28 -1
- package/node_modules/@maka/core/dist/runtime-event-store.js +25 -0
- package/node_modules/@maka/core/dist/runtime-invocation.js +5 -0
- package/node_modules/@maka/core/dist/runtime-policy/credential-vault-codec.js +6 -0
- package/node_modules/@maka/core/dist/runtime-policy/policy-codec.js +21 -0
- package/node_modules/@maka/core/dist/session.js +2 -0
- package/node_modules/@maka/core/dist/settings.js +1 -0
- package/node_modules/@maka/core/dist/tool-ledger-scanner.js +365 -104
- package/node_modules/@maka/core/dist/turn-origin.js +14 -0
- package/node_modules/@maka/core/package.json +2 -0
- package/node_modules/@maka/mcp/dist/credential-coordinator.js +6 -1
- package/node_modules/@maka/mcp/dist/index.js +31 -5
- package/node_modules/@maka/mcp/dist/oauth.js +54 -6
- package/node_modules/@maka/runtime/dist/agent-run-inspect.js +1 -1
- package/node_modules/@maka/runtime/dist/conversation-copy.js +56 -1
- package/node_modules/@maka/runtime/dist/mcp-tools.js +9 -2
- package/node_modules/@maka/runtime/dist/plugin-executor-backend.js +116 -3
- package/node_modules/@maka/runtime/dist/plugin-executor-service.js +212 -16
- package/node_modules/@maka/runtime/dist/runtime-ledger-repair.js +2 -2
- package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +3 -0
- package/node_modules/@maka/runtime/dist/session-manager.js +170 -125
- package/node_modules/@maka/runtime/dist/shell-run-manager.js +3 -0
- package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +29 -4
- package/node_modules/@maka/runtime-host/dist/candidate-entry.js +8 -5
- package/node_modules/@maka/runtime-host/dist/client/index.js +1 -1
- package/node_modules/@maka/runtime-host/dist/client/reconnect-lifecycle.js +8 -1
- package/node_modules/@maka/runtime-host/dist/client/session-catalog-summary.js +6 -1
- package/node_modules/@maka/runtime-host/dist/composition-identity.js +19 -0
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +10 -2
- package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +34 -0
- package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +40 -2
- package/node_modules/@maka/runtime-host/dist/server/builtin-external-agent-plugins.js +188 -0
- package/node_modules/@maka/runtime-host/dist/server/candidate.js +12 -7
- package/node_modules/@maka/runtime-host/dist/server/client-capability-recovery.js +44 -46
- package/node_modules/@maka/runtime-host/dist/server/context-coordinator.js +2 -0
- package/node_modules/@maka/runtime-host/dist/server/execution-composition-factory.js +1 -1
- package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +159 -19
- package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +3 -0
- package/node_modules/@maka/runtime-host/dist/server/extension-bundle.js +4 -0
- package/node_modules/@maka/runtime-host/dist/server/host-composition-source.js +47 -0
- package/node_modules/@maka/runtime-host/dist/server/host-composition.js +1 -29
- package/node_modules/@maka/runtime-host/dist/server/host-kernel.js +2 -9
- package/node_modules/@maka/runtime-host/dist/server/hosted-execution-recovery.js +75 -9
- package/node_modules/@maka/runtime-host/dist/server/hosted-execution-tool-profile.js +4 -0
- package/node_modules/@maka/runtime-host/dist/server/interaction-coordinator.js +45 -0
- package/node_modules/@maka/runtime-host/dist/server/jev-routing-model.js +157 -0
- package/node_modules/@maka/runtime-host/dist/server/listener-set.js +2 -2
- package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +4 -0
- package/node_modules/@maka/runtime-host/dist/server/plugin-platform-coordinator.js +11 -1
- package/node_modules/@maka/runtime-host/dist/server/process-lifecycle.js +1 -1
- package/node_modules/@maka/runtime-host/dist/server/process-termination-error.js +27 -0
- package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +91 -12
- package/node_modules/@maka/runtime-host/dist/server/runtime-policy-coordinator.js +2 -0
- package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +99 -12
- package/node_modules/@maka/runtime-host/dist/server/session-effect-coordinator.js +12 -6
- package/node_modules/@maka/runtime-host/dist/server/session-transcript-reader.js +33 -0
- package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +4 -0
- package/node_modules/@maka/runtime-host/dist/server/workhub-result-coordinator.js +173 -0
- package/node_modules/@maka/runtime-host/dist/server/workhub-result-runtime.js +293 -0
- package/node_modules/@maka/runtime-host/package.json +2 -0
- package/node_modules/@maka/storage/dist/agent-run-store-contract.js +8 -0
- package/node_modules/@maka/storage/dist/execution-stores.js +15 -3
- package/node_modules/@maka/storage/dist/mcp-config-store.js +91 -2
- package/node_modules/@maka/storage/dist/operational-state-store.js +15 -1
- package/node_modules/@maka/storage/dist/plan-authority.js +2 -0
- package/node_modules/@maka/storage/dist/plan-store.js +30 -0
- package/node_modules/@maka/storage/dist/runtime-event-persistence.js +1 -0
- package/node_modules/@maka/storage/dist/runtime-policy/credential-vault-document.js +4 -1
- package/node_modules/@maka/storage/dist/runtime-policy/policy-document.js +2 -0
- package/node_modules/@maka/storage/dist/session-store-values.js +16 -4
- package/node_modules/@maka/storage/dist/shell-run-authority.js +1 -0
- package/node_modules/@maka/storage/dist/shell-run-store.js +15 -0
- package/node_modules/@maka/storage/dist/sqlite-runtime-schema.js +74 -1
- package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +724 -84
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maka/acp-executor-plugin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared ACP runtime service for Maka executor adapter plugins.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js",
|
|
10
|
+
"./plugin": "./dist/plugin.mjs"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@agentclientprotocol/sdk": "1.4.0"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
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 { describeAntigravityModels } from './model-presentation.js';
|
|
20
|
+
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
21
|
+
export const ANTIGRAVITY_ACP_EXECUTOR_ID = 'antigravity-acp';
|
|
22
|
+
/** Antigravity-specific launch and environment policy; ACP mechanics live in the parent service. */
|
|
23
|
+
export const antigravityAcpAdapter = Object.freeze({
|
|
24
|
+
id: ANTIGRAVITY_ACP_EXECUTOR_ID,
|
|
25
|
+
displayName: 'Antigravity',
|
|
26
|
+
clientName: 'maka-antigravity-acp-plugin',
|
|
27
|
+
describeModels: describeAntigravityModels,
|
|
28
|
+
// Verified with official 1.1.1: structured questions use interaction_ ids and choice options.
|
|
29
|
+
permissionKind: (request) => request.toolCall.toolCallId.startsWith('interaction_') && request.toolCall.kind == null
|
|
30
|
+
? 'question'
|
|
31
|
+
: 'permission',
|
|
32
|
+
executionFailed: (text) => text.trimStart().startsWith('Agent execution error:'),
|
|
33
|
+
configure(value) {
|
|
34
|
+
const config = validateConfig(value);
|
|
35
|
+
const helper = config.helper ?? resolve(dirname(config.executable), 'localharness_external');
|
|
36
|
+
return Object.freeze({
|
|
37
|
+
launch: Object.freeze({
|
|
38
|
+
executable: config.executable,
|
|
39
|
+
requiredExecutables: Object.freeze([helper]),
|
|
40
|
+
cwd: dirname(config.executable),
|
|
41
|
+
env: antigravityEnvironment(process.env, helper),
|
|
42
|
+
...(config.model ? { initialConfig: Object.freeze({ model: config.model }) } : {}),
|
|
43
|
+
}),
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
export function validateConfig(value) {
|
|
48
|
+
if (!value || typeof value !== 'object')
|
|
49
|
+
throw new TypeError('ACP Plugin config is required');
|
|
50
|
+
const executable = absolutePath(value.executable, 'executable');
|
|
51
|
+
const helper = value.helper === undefined ? undefined : absolutePath(value.helper, 'helper');
|
|
52
|
+
const model = value.model?.trim();
|
|
53
|
+
if (value.model !== undefined && !model)
|
|
54
|
+
throw new TypeError('ACP Plugin model is invalid');
|
|
55
|
+
return Object.freeze({ executable, ...(helper ? { helper } : {}), ...(model ? { model } : {}) });
|
|
56
|
+
}
|
|
57
|
+
function absolutePath(value, label) {
|
|
58
|
+
if (typeof value !== 'string' || !isAbsolute(value) || /[\0\r\n]/u.test(value))
|
|
59
|
+
throw new TypeError(`ACP Plugin ${label} must be an absolute path`);
|
|
60
|
+
return resolve(value);
|
|
61
|
+
}
|
|
62
|
+
export function antigravityEnvironment(base, helper) {
|
|
63
|
+
const env = {
|
|
64
|
+
...base,
|
|
65
|
+
BROWSER: '/usr/bin/true',
|
|
66
|
+
PYTHONUNBUFFERED: '1',
|
|
67
|
+
ANTIGRAVITY_HARNESS_PATH: helper,
|
|
68
|
+
};
|
|
69
|
+
const bypass = [env.NO_PROXY, env.no_proxy, 'localhost', '127.0.0.1', '::1']
|
|
70
|
+
.flatMap((entry) => entry?.split(',') ?? [])
|
|
71
|
+
.map((entry) => entry.trim())
|
|
72
|
+
.filter((entry, index, entries) => entry.length > 0 && entries.indexOf(entry) === index)
|
|
73
|
+
.join(',');
|
|
74
|
+
env.NO_PROXY = bypass;
|
|
75
|
+
env.no_proxy = bypass;
|
|
76
|
+
return env;
|
|
77
|
+
}
|
|
78
|
+
const host = Object.freeze({
|
|
79
|
+
inject: ['acp'],
|
|
80
|
+
apply(ctx, config) {
|
|
81
|
+
ctx.acp.register(ctx, antigravityAcpAdapter, config);
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
export default Object.freeze({
|
|
85
|
+
packageId: 'antigravity-acp',
|
|
86
|
+
contributions: Object.freeze([{ id: ANTIGRAVITY_ACP_EXECUTOR_ID, kind: 'executor' }]),
|
|
87
|
+
host,
|
|
88
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { THINKING_LEVELS } from '@maka/core/model-thinking';
|
|
20
|
+
/** Official ACP 1.1.1 labels encode intensity; IDs are opaque (e.g. gemini-pro-agent). */
|
|
21
|
+
export function describeAntigravityModels(models) {
|
|
22
|
+
const families = new Map();
|
|
23
|
+
const unrecognized = new Set();
|
|
24
|
+
for (const model of models) {
|
|
25
|
+
const match = /^(Gemini \d+(?:\.\d+)? (?:Flash|Pro)) \((High|Medium|Low)\)$/.exec(model.name);
|
|
26
|
+
if (!match) {
|
|
27
|
+
// A bare or unfamiliar variant of the same family makes grouping ambiguous.
|
|
28
|
+
const family = /^(Gemini \d+(?:\.\d+)? (?:Flash|Pro))(?:$|[ (])/.exec(model.name)?.[1];
|
|
29
|
+
if (family)
|
|
30
|
+
unrecognized.add(family);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const variants = families.get(match[1]) ?? [];
|
|
34
|
+
variants.push({ modelId: model.id, level: match[2].toLowerCase() });
|
|
35
|
+
families.set(match[1], variants);
|
|
36
|
+
}
|
|
37
|
+
const modelGroups = [];
|
|
38
|
+
for (const [name, variants] of families) {
|
|
39
|
+
if (unrecognized.has(name) ||
|
|
40
|
+
variants.length < 2 ||
|
|
41
|
+
new Set(variants.map((v) => v.level)).size !== variants.length)
|
|
42
|
+
continue;
|
|
43
|
+
modelGroups.push({
|
|
44
|
+
id: name,
|
|
45
|
+
name,
|
|
46
|
+
variants: [...variants].sort((a, b) => THINKING_LEVELS.indexOf(a.level) - THINKING_LEVELS.indexOf(b.level)),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
models: models.map((model) => /^Gemini(?: |$)/.test(model.name) ? { ...model, providerType: 'google' } : model),
|
|
51
|
+
modelGroups,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// ../core/dist/model-thinking.js
|
|
2
|
+
var THINKING_LEVELS = [
|
|
3
|
+
"off",
|
|
4
|
+
"minimal",
|
|
5
|
+
"low",
|
|
6
|
+
"medium",
|
|
7
|
+
"high",
|
|
8
|
+
"xhigh",
|
|
9
|
+
"max"
|
|
10
|
+
];
|
|
11
|
+
var DECLARABLE_RELAY_THINKING_LEVELS = THINKING_LEVELS.filter((level) => level !== "off");
|
|
12
|
+
|
|
13
|
+
// src/model-presentation.ts
|
|
14
|
+
function describeAntigravityModels(models) {
|
|
15
|
+
const families = /* @__PURE__ */ new Map();
|
|
16
|
+
const unrecognized = /* @__PURE__ */ new Set();
|
|
17
|
+
for (const model of models) {
|
|
18
|
+
const match = /^(Gemini \d+(?:\.\d+)? (?:Flash|Pro)) \((High|Medium|Low)\)$/.exec(model.name);
|
|
19
|
+
if (!match) {
|
|
20
|
+
const family = /^(Gemini \d+(?:\.\d+)? (?:Flash|Pro))(?:$|[ (])/.exec(model.name)?.[1];
|
|
21
|
+
if (family) unrecognized.add(family);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const variants = families.get(match[1]) ?? [];
|
|
25
|
+
variants.push({ modelId: model.id, level: match[2].toLowerCase() });
|
|
26
|
+
families.set(match[1], variants);
|
|
27
|
+
}
|
|
28
|
+
const modelGroups = [];
|
|
29
|
+
for (const [name, variants] of families) {
|
|
30
|
+
if (unrecognized.has(name) || variants.length < 2 || new Set(variants.map((v) => v.level)).size !== variants.length)
|
|
31
|
+
continue;
|
|
32
|
+
modelGroups.push({
|
|
33
|
+
id: name,
|
|
34
|
+
name,
|
|
35
|
+
variants: [...variants].sort(
|
|
36
|
+
(a, b) => THINKING_LEVELS.indexOf(a.level) - THINKING_LEVELS.indexOf(b.level)
|
|
37
|
+
)
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
models: models.map(
|
|
42
|
+
(model) => /^Gemini(?: |$)/.test(model.name) ? { ...model, providerType: "google" } : model
|
|
43
|
+
),
|
|
44
|
+
modelGroups
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// src/index.ts
|
|
49
|
+
import { dirname, isAbsolute, resolve } from "node:path";
|
|
50
|
+
var ANTIGRAVITY_ACP_EXECUTOR_ID = "antigravity-acp";
|
|
51
|
+
var antigravityAcpAdapter = Object.freeze({
|
|
52
|
+
id: ANTIGRAVITY_ACP_EXECUTOR_ID,
|
|
53
|
+
displayName: "Antigravity",
|
|
54
|
+
clientName: "maka-antigravity-acp-plugin",
|
|
55
|
+
describeModels: describeAntigravityModels,
|
|
56
|
+
// Verified with official 1.1.1: structured questions use interaction_ ids and choice options.
|
|
57
|
+
permissionKind: (request) => request.toolCall.toolCallId.startsWith("interaction_") && request.toolCall.kind == null ? "question" : "permission",
|
|
58
|
+
executionFailed: (text) => text.trimStart().startsWith("Agent execution error:"),
|
|
59
|
+
configure(value) {
|
|
60
|
+
const config = validateConfig(value);
|
|
61
|
+
const helper = config.helper ?? resolve(dirname(config.executable), "localharness_external");
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
launch: Object.freeze({
|
|
64
|
+
executable: config.executable,
|
|
65
|
+
requiredExecutables: Object.freeze([helper]),
|
|
66
|
+
cwd: dirname(config.executable),
|
|
67
|
+
env: antigravityEnvironment(process.env, helper),
|
|
68
|
+
...config.model ? { initialConfig: Object.freeze({ model: config.model }) } : {}
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
function validateConfig(value) {
|
|
74
|
+
if (!value || typeof value !== "object") throw new TypeError("ACP Plugin config is required");
|
|
75
|
+
const executable = absolutePath(value.executable, "executable");
|
|
76
|
+
const helper = value.helper === void 0 ? void 0 : absolutePath(value.helper, "helper");
|
|
77
|
+
const model = value.model?.trim();
|
|
78
|
+
if (value.model !== void 0 && !model) throw new TypeError("ACP Plugin model is invalid");
|
|
79
|
+
return Object.freeze({ executable, ...helper ? { helper } : {}, ...model ? { model } : {} });
|
|
80
|
+
}
|
|
81
|
+
function absolutePath(value, label) {
|
|
82
|
+
if (typeof value !== "string" || !isAbsolute(value) || /[\0\r\n]/u.test(value))
|
|
83
|
+
throw new TypeError(`ACP Plugin ${label} must be an absolute path`);
|
|
84
|
+
return resolve(value);
|
|
85
|
+
}
|
|
86
|
+
function antigravityEnvironment(base, helper) {
|
|
87
|
+
const env = {
|
|
88
|
+
...base,
|
|
89
|
+
BROWSER: "/usr/bin/true",
|
|
90
|
+
PYTHONUNBUFFERED: "1",
|
|
91
|
+
ANTIGRAVITY_HARNESS_PATH: helper
|
|
92
|
+
};
|
|
93
|
+
const bypass = [env.NO_PROXY, env.no_proxy, "localhost", "127.0.0.1", "::1"].flatMap((entry) => entry?.split(",") ?? []).map((entry) => entry.trim()).filter((entry, index, entries) => entry.length > 0 && entries.indexOf(entry) === index).join(",");
|
|
94
|
+
env.NO_PROXY = bypass;
|
|
95
|
+
env.no_proxy = bypass;
|
|
96
|
+
return env;
|
|
97
|
+
}
|
|
98
|
+
var host = Object.freeze({
|
|
99
|
+
inject: ["acp"],
|
|
100
|
+
apply(ctx, config) {
|
|
101
|
+
ctx.acp.register(ctx, antigravityAcpAdapter, config);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
var index_default = Object.freeze({
|
|
105
|
+
packageId: "antigravity-acp",
|
|
106
|
+
contributions: Object.freeze([{ id: ANTIGRAVITY_ACP_EXECUTOR_ID, kind: "executor" }]),
|
|
107
|
+
host
|
|
108
|
+
});
|
|
109
|
+
export {
|
|
110
|
+
ANTIGRAVITY_ACP_EXECUTOR_ID,
|
|
111
|
+
antigravityAcpAdapter,
|
|
112
|
+
antigravityEnvironment,
|
|
113
|
+
index_default as default,
|
|
114
|
+
validateConfig
|
|
115
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maka/antigravity-acp-plugin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Antigravity ACP Session executor packaged for Maka's Host Plugin Platform.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js",
|
|
10
|
+
"./plugin": "./dist/plugin.mjs"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@maka/acp-executor-plugin": "0.1.0"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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 { isExecutorId } from './executor-id.js';
|
|
20
|
+
import { CATALOG_PROVIDER_TYPES } from './provider-registry.js';
|
|
21
|
+
import { isThinkingLevel } from './model-thinking.js';
|
|
22
|
+
export function isExecutorConfiguration(value) {
|
|
23
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
24
|
+
return false;
|
|
25
|
+
const record = value;
|
|
26
|
+
return (Object.keys(record).every((key) => key === 'model') &&
|
|
27
|
+
(record.model === undefined ||
|
|
28
|
+
(typeof record.model === 'string' &&
|
|
29
|
+
record.model.length > 0 &&
|
|
30
|
+
record.model.length <= 1024 &&
|
|
31
|
+
!/[\0\r\n]/u.test(record.model))));
|
|
32
|
+
}
|
|
33
|
+
export function normalizeCatalogEntry(value, id) {
|
|
34
|
+
if (!value ||
|
|
35
|
+
!isExecutorId(id) ||
|
|
36
|
+
value.id !== id ||
|
|
37
|
+
!isCatalogText(value.displayName) ||
|
|
38
|
+
!['ready', 'unavailable', 'authentication_required', 'history_only'].includes(value.readiness) ||
|
|
39
|
+
!Array.isArray(value.models) ||
|
|
40
|
+
value.models.length > 256 ||
|
|
41
|
+
!Array.from(value.models).every((model) => model &&
|
|
42
|
+
isExecutorConfiguration({ model: model.id }) &&
|
|
43
|
+
typeof model.id === 'string' &&
|
|
44
|
+
isCatalogText(model.name) &&
|
|
45
|
+
(model.providerType === undefined || CATALOG_PROVIDER_TYPES.includes(model.providerType))) ||
|
|
46
|
+
new Set(value.models.map((model) => model.id)).size !== value.models.length ||
|
|
47
|
+
!isExecutorConfiguration({ model: value.currentModel }) ||
|
|
48
|
+
typeof value.supportsAttachments !== 'boolean' ||
|
|
49
|
+
typeof value.supportsModelChange !== 'boolean')
|
|
50
|
+
throw new TypeError('Executor catalog is invalid');
|
|
51
|
+
const usedModels = new Set();
|
|
52
|
+
const groupIds = new Set();
|
|
53
|
+
if (value.modelGroups !== undefined &&
|
|
54
|
+
(!Array.isArray(value.modelGroups) ||
|
|
55
|
+
value.modelGroups.length > value.models.length ||
|
|
56
|
+
!value.modelGroups.every((group) => {
|
|
57
|
+
if (!group ||
|
|
58
|
+
!isExecutorConfiguration({ model: group.id }) ||
|
|
59
|
+
typeof group.id !== 'string' ||
|
|
60
|
+
!isCatalogText(group.name) ||
|
|
61
|
+
groupIds.has(group.id) ||
|
|
62
|
+
!Array.isArray(group.variants) ||
|
|
63
|
+
group.variants.length < 2 ||
|
|
64
|
+
group.variants.length > 7)
|
|
65
|
+
return false;
|
|
66
|
+
groupIds.add(group.id);
|
|
67
|
+
const levels = new Set();
|
|
68
|
+
return group.variants.every((variant) => {
|
|
69
|
+
if (!variant ||
|
|
70
|
+
!isThinkingLevel(variant.level) ||
|
|
71
|
+
levels.has(variant.level) ||
|
|
72
|
+
usedModels.has(variant.modelId) ||
|
|
73
|
+
!value.models.some((model) => model.id === variant.modelId))
|
|
74
|
+
return false;
|
|
75
|
+
levels.add(variant.level);
|
|
76
|
+
usedModels.add(variant.modelId);
|
|
77
|
+
return true;
|
|
78
|
+
});
|
|
79
|
+
})))
|
|
80
|
+
throw new TypeError('Executor model groups are invalid');
|
|
81
|
+
return Object.freeze({
|
|
82
|
+
id,
|
|
83
|
+
displayName: value.displayName,
|
|
84
|
+
readiness: value.readiness,
|
|
85
|
+
models: Object.freeze(value.models.map(({ id, name, providerType }) => Object.freeze({
|
|
86
|
+
id,
|
|
87
|
+
name,
|
|
88
|
+
...(providerType !== undefined ? { providerType } : {}),
|
|
89
|
+
}))),
|
|
90
|
+
...(value.modelGroups !== undefined
|
|
91
|
+
? {
|
|
92
|
+
modelGroups: Object.freeze(value.modelGroups.map((group) => Object.freeze({
|
|
93
|
+
id: group.id,
|
|
94
|
+
name: group.name,
|
|
95
|
+
variants: Object.freeze(group.variants.map(({ modelId, level }) => Object.freeze({ modelId, level }))),
|
|
96
|
+
}))),
|
|
97
|
+
}
|
|
98
|
+
: {}),
|
|
99
|
+
...(value.currentModel !== undefined ? { currentModel: value.currentModel } : {}),
|
|
100
|
+
supportsAttachments: value.supportsAttachments,
|
|
101
|
+
supportsModelChange: value.supportsModelChange,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function isCatalogText(value) {
|
|
105
|
+
return typeof value === 'string' && value.length <= 8_192 && !/[\0\r]/u.test(value);
|
|
106
|
+
}
|
|
@@ -213,7 +213,10 @@ export function mcpConfigChangeRetiresCredentials(previous, next) {
|
|
|
213
213
|
const nextStdio = isMcpStdioConfig(next);
|
|
214
214
|
if (previousStdio || nextStdio)
|
|
215
215
|
return previousStdio !== nextStdio;
|
|
216
|
-
return previous.url !== next.url
|
|
216
|
+
return (previous.url !== next.url ||
|
|
217
|
+
previous.oauth?.issuer !== next.oauth?.issuer ||
|
|
218
|
+
previous.oauth?.clientId !== next.oauth?.clientId ||
|
|
219
|
+
previous.oauth?.clientSecret !== next.oauth?.clientSecret);
|
|
217
220
|
}
|
|
218
221
|
export function resolveMcpProtocolPreference(config) {
|
|
219
222
|
return config.protocol ?? 'legacy';
|
|
@@ -140,7 +140,7 @@ export function openAiAdapterApiProtocol(modelId, providerType) {
|
|
|
140
140
|
(providerType === 'opencode-go' && id === 'muse-spark-1.2-contributor') ||
|
|
141
141
|
((providerType === 'alibaba-token-plan-cn' || providerType === 'alibaba-token-plan') &&
|
|
142
142
|
id === 'qwen3.8-max') ||
|
|
143
|
-
/^gpt-
|
|
143
|
+
/^gpt-[56]/i.test(id) ||
|
|
144
144
|
((providerType === 'xai' || providerType === 'xai-oauth') && id === 'grok-4.5')
|
|
145
145
|
? 'openai-responses'
|
|
146
146
|
: 'openai-chat';
|
|
@@ -205,6 +205,24 @@ const GOOGLE_MODEL_OVERRIDES = {
|
|
|
205
205
|
thinkingOptions: { toggle: true, offBehavior: 'google-thinking-budget-zero' },
|
|
206
206
|
},
|
|
207
207
|
};
|
|
208
|
+
// These models are in the live models.dev OpenAI catalog but not yet in the
|
|
209
|
+
// bundled snapshot. The OpenAI Responses SDK accepts only these five GPT-6
|
|
210
|
+
// efforts on both API and Codex OAuth paths. It discards `none` and the Codex
|
|
211
|
+
// model list's `ultra` for Sol, so do not offer them until the request path
|
|
212
|
+
// can send and handle them.
|
|
213
|
+
const OPENAI_GPT6_THINKING_OPTIONS = {
|
|
214
|
+
efforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
215
|
+
};
|
|
216
|
+
const OPENAI_GPT6_MODEL_OVERRIDES = {
|
|
217
|
+
'gpt-6-sol': {
|
|
218
|
+
displayName: 'GPT-6 Sol',
|
|
219
|
+
thinkingOptions: OPENAI_GPT6_THINKING_OPTIONS,
|
|
220
|
+
},
|
|
221
|
+
'gpt-6-luna': {
|
|
222
|
+
displayName: 'GPT-6 Luna',
|
|
223
|
+
thinkingOptions: OPENAI_GPT6_THINKING_OPTIONS,
|
|
224
|
+
},
|
|
225
|
+
};
|
|
208
226
|
// The OAuth path pins its own context windows over whatever the public
|
|
209
227
|
// catalog says. Base facts come from the active table, falling back to the
|
|
210
228
|
// shipped snapshot so a model upstream stops listing keeps a display name.
|
|
@@ -221,6 +239,14 @@ function withoutInputLimit(metadata) {
|
|
|
221
239
|
}
|
|
222
240
|
function openAiOAuthModelMetadata(active) {
|
|
223
241
|
return {
|
|
242
|
+
'gpt-6-sol': {
|
|
243
|
+
...openAiOAuthBase(active, 'gpt-6-sol'),
|
|
244
|
+
...OPENAI_GPT6_MODEL_OVERRIDES['gpt-6-sol'],
|
|
245
|
+
},
|
|
246
|
+
'gpt-6-luna': {
|
|
247
|
+
...openAiOAuthBase(active, 'gpt-6-luna'),
|
|
248
|
+
...OPENAI_GPT6_MODEL_OVERRIDES['gpt-6-luna'],
|
|
249
|
+
},
|
|
224
250
|
'gpt-5.6-sol': {
|
|
225
251
|
...openAiOAuthBase(active, 'gpt-5.6-sol'),
|
|
226
252
|
contextWindow: 372_000,
|
|
@@ -412,6 +438,7 @@ const COMMAND_CODE_MODEL_METADATA = {
|
|
|
412
438
|
function buildStaticModelMetadata(active) {
|
|
413
439
|
return {
|
|
414
440
|
anthropic: ANTHROPIC_MODEL_OVERRIDES,
|
|
441
|
+
openai: OPENAI_GPT6_MODEL_OVERRIDES,
|
|
415
442
|
'claude-subscription': claudeSubscriptionModelMetadata(active),
|
|
416
443
|
// The Command Code Provider-API plan rides the same effort table.
|
|
417
444
|
commandcode: COMMAND_CODE_MODEL_METADATA,
|
|
@@ -16,8 +16,33 @@
|
|
|
16
16
|
* specific language governing permissions and limitations
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
|
+
import { runtimeHandoffPause } from './runtime-handoff.js';
|
|
20
|
+
import { mayBeTranscriptLedgerInvocationId, } from './runtime-invocation.js';
|
|
19
21
|
export const TOOL_RECOVERY_BUNDLE_CAPABILITY_V1 = 'tool_recovery_bundle_v1';
|
|
20
22
|
export const RUNTIME_CONTINUATION_AUTHORITY_V1 = 'runtime_continuation_authority_v1';
|
|
23
|
+
export function runtimeInvocationRecoveryInventoryFromInvocations(invocations) {
|
|
24
|
+
return invocations.map((invocation) => {
|
|
25
|
+
const base = {
|
|
26
|
+
sessionId: invocation.sessionId,
|
|
27
|
+
invocationId: invocation.invocationId,
|
|
28
|
+
};
|
|
29
|
+
if (!invocation.terminalEvent || runtimeHandoffPause(invocation.terminalEvent)) {
|
|
30
|
+
return { ...base, candidate: invocation };
|
|
31
|
+
}
|
|
32
|
+
return mayBeTranscriptLedgerInvocationId(invocation.invocationId)
|
|
33
|
+
? {
|
|
34
|
+
...base,
|
|
35
|
+
identity: {
|
|
36
|
+
sessionId: invocation.sessionId,
|
|
37
|
+
invocationId: invocation.invocationId,
|
|
38
|
+
runId: invocation.runId,
|
|
39
|
+
turnId: invocation.turnId,
|
|
40
|
+
openedAt: invocation.openedAt,
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
: base;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
21
46
|
/**
|
|
22
47
|
* An append arrived after the run's terminal fact was already written. The
|
|
23
48
|
* refusal is the store doing its job: once a run has said it ended, a late
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
19
|
import { isTerminalRuntimeEvent } from './runtime-event.js';
|
|
20
|
+
/** Persisted namespace used only by deterministic legacy-transcript conversion runs. */
|
|
21
|
+
export const TRANSCRIPT_LEDGER_INVOCATION_ID_PREFIX = 'transcript-';
|
|
22
|
+
export function mayBeTranscriptLedgerInvocationId(invocationId) {
|
|
23
|
+
return invocationId.startsWith(TRANSCRIPT_LEDGER_INVOCATION_ID_PREFIX);
|
|
24
|
+
}
|
|
20
25
|
/**
|
|
21
26
|
* Rebuild a Session's invocation inventory from its events alone.
|
|
22
27
|
*
|
|
@@ -22,6 +22,12 @@ import { parseRequestHeaders, RequestCustomizationValidationError, serializeRequ
|
|
|
22
22
|
import { domainError, entityIdValue, exactRecord, integerValue, positiveRevisionValue, } from './domain-codec.js';
|
|
23
23
|
export function decodeCredentialLocator(value) {
|
|
24
24
|
const base = exactRecord(value, 'credential locator', ['scope', 'connectionId', 'provider', 'kind'], ['scope', 'kind']);
|
|
25
|
+
if (base.scope === 'jev') {
|
|
26
|
+
const item = exactRecord(value, 'Jev credential locator', ['scope', 'kind']);
|
|
27
|
+
if (item.kind !== 'api_key')
|
|
28
|
+
throw domainError('Jev credential kind is invalid');
|
|
29
|
+
return { scope: 'jev', kind: 'api_key' };
|
|
30
|
+
}
|
|
25
31
|
if (base.scope === 'connection') {
|
|
26
32
|
const item = exactRecord(value, 'connection credential locator', [
|
|
27
33
|
'scope',
|
|
@@ -137,6 +137,18 @@ function normalizeRuntimePolicy(value) {
|
|
|
137
137
|
'subagents',
|
|
138
138
|
'shell',
|
|
139
139
|
'externalAgents',
|
|
140
|
+
'jev',
|
|
141
|
+
], [
|
|
142
|
+
'networkProxy',
|
|
143
|
+
'personalization',
|
|
144
|
+
'memory',
|
|
145
|
+
'workspaceInstructions',
|
|
146
|
+
'privacy',
|
|
147
|
+
'chatDefaults',
|
|
148
|
+
'webSearch',
|
|
149
|
+
'subagents',
|
|
150
|
+
'shell',
|
|
151
|
+
'externalAgents',
|
|
140
152
|
]);
|
|
141
153
|
return normalizeRuntimePolicyFields(policy, normalizeSubagentSettings(policy.subagents), normalizeShell(policy.shell), normalizeExternalAgents(policy.externalAgents));
|
|
142
154
|
}
|
|
@@ -152,6 +164,7 @@ function normalizeRuntimePolicyFields(policy, subagents, shell, externalAgents =
|
|
|
152
164
|
subagents,
|
|
153
165
|
shell,
|
|
154
166
|
externalAgents,
|
|
167
|
+
...(policy.jev === undefined ? {} : { jev: normalizeJev(policy.jev) }),
|
|
155
168
|
};
|
|
156
169
|
}
|
|
157
170
|
function withoutShell(policy) {
|
|
@@ -160,6 +173,8 @@ function withoutShell(policy) {
|
|
|
160
173
|
}
|
|
161
174
|
function normalizeMutationOperation(operation) {
|
|
162
175
|
switch (operation.kind) {
|
|
176
|
+
case 'set_jev':
|
|
177
|
+
return { kind: operation.kind, value: normalizeJev(operation.value) };
|
|
163
178
|
case 'set_network_proxy':
|
|
164
179
|
return { kind: operation.kind, value: normalizeNetworkProxy(operation.value) };
|
|
165
180
|
case 'set_personalization':
|
|
@@ -374,3 +389,9 @@ function normalizeExternalAgents(value) {
|
|
|
374
389
|
}
|
|
375
390
|
return { antigravity: { executable } };
|
|
376
391
|
}
|
|
392
|
+
function normalizeJev(value) {
|
|
393
|
+
const item = exactRecord(value, 'Jev settings', ['enabled']);
|
|
394
|
+
if (typeof item.enabled !== 'boolean')
|
|
395
|
+
throw domainError('Jev enabled must be boolean');
|
|
396
|
+
return { enabled: item.enabled };
|
|
397
|
+
}
|
|
@@ -463,6 +463,7 @@ const WORKHUB_DELEGATION_ASSIGNED_MESSAGE_SHAPE = defineObjectShape()([
|
|
|
463
463
|
], [
|
|
464
464
|
'attachments',
|
|
465
465
|
'targetAttachments',
|
|
466
|
+
'returnResults',
|
|
466
467
|
'create',
|
|
467
468
|
'steered',
|
|
468
469
|
'replacesActionId',
|
|
@@ -796,6 +797,7 @@ function isWorkHubCoordinationMessage(message) {
|
|
|
796
797
|
typeof message.targetMessageId === 'string' &&
|
|
797
798
|
typeof message.targetSessionName === 'string' &&
|
|
798
799
|
message.targetSessionName.trim().length > 0 &&
|
|
800
|
+
(message.returnResults === undefined || message.returnResults === true) &&
|
|
799
801
|
(message.steered === undefined || message.steered === true) &&
|
|
800
802
|
((message.schemaVersion === WORKHUB_COORDINATION_RECORD_SCHEMA_VERSION &&
|
|
801
803
|
message.replacesActionId === undefined &&
|
|
@@ -363,6 +363,7 @@ export function createDefaultSettings() {
|
|
|
363
363
|
},
|
|
364
364
|
privacy: defaultPrivacySettings(),
|
|
365
365
|
projects: defaultProjectPreferencesSettings(),
|
|
366
|
+
jev: { enabled: false, apiKey: '' },
|
|
366
367
|
chatDefaults: defaultChatDefaultsSettings(),
|
|
367
368
|
notifications: {
|
|
368
369
|
runComplete: true,
|