maka-agent 0.2.0-dev.47.20260922 → 0.2.0-dev.49.20260924
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/acp/session-event-mapper.js +1 -4
- package/dist/onboarding-catalog.js +20 -4
- package/dist/pi-transcript.js +0 -8
- package/dist/pi-tui-pickers.js +1 -1
- package/dist/pi-tui-runner.js +6 -4
- package/dist/runtime-host-capability-provider-command.js +25 -6
- package/dist/runtime-host-onboarding.js +5 -3
- package/dist/runtime-host-session-channel.js +9 -3
- 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/events.js +13 -0
- package/node_modules/@maka/core/dist/executor-catalog.js +106 -0
- package/node_modules/@maka/core/dist/llm-connections.js +2 -5
- package/node_modules/@maka/core/dist/mcp.js +4 -1
- package/node_modules/@maka/core/dist/model-facts.js +2 -4
- package/node_modules/@maka/core/dist/model-metadata.generated.js +345 -248
- package/node_modules/@maka/core/dist/model-metadata.js +28 -1
- package/node_modules/@maka/core/dist/model-thinking.js +17 -17
- package/node_modules/@maka/core/dist/model-web-search.js +7 -9
- package/node_modules/@maka/core/dist/models-dev-projection.js +1 -1
- package/node_modules/@maka/core/dist/onboarding.js +1 -4
- package/node_modules/@maka/core/dist/provider-registry.js +60 -86
- package/node_modules/@maka/core/dist/runtime-event-store.js +25 -0
- package/node_modules/@maka/core/dist/runtime-event.js +2 -2
- package/node_modules/@maka/core/dist/runtime-invocation.js +5 -0
- package/node_modules/@maka/core/dist/runtime-policy/connection-catalog-codec.js +28 -16
- 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/runtime-policy.js +1 -1
- package/node_modules/@maka/core/dist/session.js +25 -9
- 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/transcript-search.js +1 -0
- package/node_modules/@maka/core/dist/turn-origin.js +14 -0
- package/node_modules/@maka/core/dist/usage-stats/types.js +1 -0
- package/node_modules/@maka/core/package.json +2 -0
- package/node_modules/@maka/eval/dist/harbor-maka-subject.js +3 -0
- package/node_modules/@maka/eval/dist/maka-subject.js +8 -1
- 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/ai-sdk-backend.js +1 -11
- package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +2 -12
- package/node_modules/@maka/runtime/dist/ai-sdk-turn.js +3 -71
- package/node_modules/@maka/runtime/dist/conversation-copy.js +58 -3
- package/node_modules/@maka/runtime/dist/local-web-fetch.js +23 -11
- package/node_modules/@maka/runtime/dist/mcp-tools.js +9 -2
- package/node_modules/@maka/runtime/dist/model-adapter.js +10 -5
- package/node_modules/@maka/runtime/dist/model-factory.js +33 -30
- package/node_modules/@maka/runtime/dist/model-fetcher.js +4 -1
- package/node_modules/@maka/runtime/dist/model-runtime.js +3 -9
- 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/read-page.js +11 -8
- package/node_modules/@maka/runtime/dist/recovery-resolver.js +47 -20
- package/node_modules/@maka/runtime/dist/runtime-event-backfill.js +1 -0
- package/node_modules/@maka/runtime/dist/runtime-ledger-repair.js +2 -2
- package/node_modules/@maka/runtime/dist/scheduled-task-tools.js +39 -8
- package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +3 -0
- package/node_modules/@maka/runtime/dist/session-manager.js +182 -127
- 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/dist/telemetry/model-pricing.generated.js +141 -134
- package/node_modules/@maka/runtime/dist/tool-result-archive-transition.js +3 -3
- package/node_modules/@maka/runtime/dist/workers/filesystem-worker.js +7 -6
- package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +28 -62
- package/node_modules/@maka/runtime-host/dist/candidate-entry.js +8 -5
- package/node_modules/@maka/runtime-host/dist/client/hosted-execution-target.js +7 -1
- 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/client/session-subscription.js +3 -0
- package/node_modules/@maka/runtime-host/dist/composition-identity.js +19 -0
- package/node_modules/@maka/runtime-host/dist/protocol/connection-effects.js +6 -3
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +14 -2
- package/node_modules/@maka/runtime-host/dist/protocol/operations.js +4 -1
- package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +34 -0
- package/node_modules/@maka/runtime-host/dist/protocol/prompt-suggestions.js +61 -0
- package/node_modules/@maka/runtime-host/dist/protocol/runtime-policy.js +4 -1
- package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +40 -2
- package/node_modules/@maka/runtime-host/dist/protocol/session-continuity.js +2 -1
- 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/connection-effect-coordinator.js +3 -0
- 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 +212 -24
- package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +41 -2
- package/node_modules/@maka/runtime-host/dist/server/extension-bundle.js +4 -0
- package/node_modules/@maka/runtime-host/dist/server/generated-text.js +39 -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 +12 -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/prompt-suggestion.js +179 -0
- package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +93 -14
- 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-continuity-coordinator.js +48 -16
- package/node_modules/@maka/runtime-host/dist/server/session-effect-coordinator.js +12 -6
- package/node_modules/@maka/runtime-host/dist/server/session-title.js +3 -16
- package/node_modules/@maka/runtime-host/dist/server/session-transcript-reader.js +71 -3
- package/node_modules/@maka/runtime-host/dist/server/shared-session-transcript.js +3 -0
- package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-action-gate.js +6 -13
- package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +39 -11
- 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/config-transfer.js +14 -8
- package/node_modules/@maka/storage/dist/execution-stores.js +19 -6
- package/node_modules/@maka/storage/dist/interaction-store.js +13 -0
- 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/connection-catalog-document.js +28 -17
- package/node_modules/@maka/storage/dist/runtime-policy/coordinator.js +9 -3
- package/node_modules/@maka/storage/dist/runtime-policy/credential-vault-document.js +4 -1
- package/node_modules/@maka/storage/dist/runtime-policy/legacy-custom-connection.js +65 -0
- package/node_modules/@maka/storage/dist/runtime-policy/onboarding-transaction.js +10 -5
- package/node_modules/@maka/storage/dist/runtime-policy/policy-document.js +2 -0
- package/node_modules/@maka/storage/dist/session-bundle-policy.js +11 -0
- package/node_modules/@maka/storage/dist/session-store-values.js +16 -4
- package/node_modules/@maka/storage/dist/session-store.js +29 -6
- 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-core-execution-schema.js +3 -0
- package/node_modules/@maka/storage/dist/sqlite-runtime-schema.js +74 -1
- package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +849 -91
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +21 -3
- package/node_modules/@maka/storage/dist/usage-screen.js +138 -108
- 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
|
+
}
|
|
@@ -415,6 +415,19 @@ function attachmentRefsEqual(left, right) {
|
|
|
415
415
|
return right.ref.kind === 'external_file' && left.ref.absolutePath === right.ref.absolutePath;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* Apply a text/thinking delta to a stream that has consumed `currentEnd`
|
|
420
|
+
* source characters. Overlap with consumed text is dropped, so replayed and
|
|
421
|
+
* reseeded deltas are idempotent. A delta that starts past `currentEnd` is a
|
|
422
|
+
* gap and returns `undefined`; one without `startOffset` appends.
|
|
423
|
+
*/
|
|
424
|
+
export function foldAssistantDelta(currentEnd, delta) {
|
|
425
|
+
const startOffset = delta.startOffset ?? currentEnd;
|
|
426
|
+
if (startOffset > currentEnd)
|
|
427
|
+
return undefined;
|
|
428
|
+
const tail = delta.text.slice(currentEnd - startOffset);
|
|
429
|
+
return { tail, endOffset: currentEnd + tail.length };
|
|
430
|
+
}
|
|
418
431
|
const TOOL_STEP_PROGRESS_PATTERN = /^steps:(\d+)\/(\d+)$/;
|
|
419
432
|
export function encodeToolStepProgress(progress) {
|
|
420
433
|
return isValidToolStepProgress(progress)
|
|
@@ -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
|
+
}
|
|
@@ -17,12 +17,9 @@
|
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
19
|
import { CODEX_SUBSCRIPTION_UNSUPPORTED_CHATGPT_MODELS } from './codex-model-compatibility.js';
|
|
20
|
-
import { CATALOG_PROVIDER_TYPES, PROVIDER_REGISTRY, RECOMMENDED_PROVIDER_TYPES, providerDefaultsOf, providerFallbackModelIds, providerMenuLabel, } from './provider-registry.js';
|
|
20
|
+
import { CATALOG_PROVIDER_TYPES, isModelApiProtocol, MODEL_API_PROTOCOL_LABELS, MODEL_API_PROTOCOLS, PROVIDER_REGISTRY, RECOMMENDED_PROVIDER_TYPES, providerDefaultsOf, providerFallbackModelIds, providerMenuLabel, } from './provider-registry.js';
|
|
21
21
|
export { CODEX_SUBSCRIPTION_UNSUPPORTED_CHATGPT_MODELS };
|
|
22
|
-
export { CATALOG_PROVIDER_TYPES, PROVIDER_REGISTRY, RECOMMENDED_PROVIDER_TYPES, providerDefaultsOf, providerFallbackModelIds, providerMenuLabel, };
|
|
23
|
-
export function isRelayProviderType(providerType) {
|
|
24
|
-
return providerType === 'openai-compatible' || providerType === 'openai-responses-compatible';
|
|
25
|
-
}
|
|
22
|
+
export { CATALOG_PROVIDER_TYPES, isModelApiProtocol, MODEL_API_PROTOCOL_LABELS, MODEL_API_PROTOCOLS, PROVIDER_REGISTRY, RECOMMENDED_PROVIDER_TYPES, providerDefaultsOf, providerFallbackModelIds, providerMenuLabel, };
|
|
26
23
|
const MODEL_MODALITIES = ['text', 'image', 'audio', 'pdf', 'video'];
|
|
27
24
|
export function isModelModality(value) {
|
|
28
25
|
return MODEL_MODALITIES.includes(value);
|
|
@@ -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';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* specific language governing permissions and limitations
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
|
-
import { providerDefaultsOf } from './provider-registry.js';
|
|
19
|
+
import { isModelApiProtocol, providerDefaultsOf } from './provider-registry.js';
|
|
20
20
|
import { isModelModality } from './llm-connections.js';
|
|
21
21
|
export const MODEL_FACTS_SCHEMA_VERSION = 1;
|
|
22
22
|
export const MODEL_FACT_KEY_MAX_LENGTH = 512;
|
|
@@ -118,9 +118,7 @@ export function normalizeModelFactOverride(value) {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
if ('apiProtocol' in value) {
|
|
121
|
-
if (value.apiProtocol
|
|
122
|
-
value.apiProtocol !== 'openai-responses' &&
|
|
123
|
-
value.apiProtocol !== 'anthropic-messages')
|
|
121
|
+
if (!isModelApiProtocol(value.apiProtocol))
|
|
124
122
|
throw new Error('Invalid apiProtocol');
|
|
125
123
|
result.apiProtocol = value.apiProtocol;
|
|
126
124
|
}
|