dsh-taskbridge 1.7.1 → 1.8.1
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/CHANGELOG.md +24 -0
- package/LICENSE +21 -21
- package/README.md +733 -877
- package/THIRD_PARTY_NOTICES.txt +23 -23
- package/antigravity/agents/dsh-taskbridge.md +32 -0
- package/antigravity/skills/dsh-taskbridge/SKILL.md +51 -0
- package/codex/dsh-taskbridge.toml +181 -631
- package/cordis.patch.yml +6 -6
- package/docs/INTRODUCTION.md +122 -295
- package/docs/INTRODUCTION.zh.md +134 -279
- package/docs/antigravity-integration.md +42 -0
- package/docs/auth-contract.md +138 -138
- package/docs/claude-code.md +6 -11
- package/docs/codex-integration.md +2 -2
- package/docs/contracts-stage-b.md +443 -443
- package/docs/conversation-placement.md +7 -6
- package/docs/plugin-market.md +30 -30
- package/docs/redaction-contract.md +170 -170
- package/docs/releases/1.7.0.zh.md +11 -11
- package/docs/releases/1.8.0.zh.md +16 -0
- package/docs/releases/1.8.1.zh.md +24 -0
- package/docs/runtime-compatibility.md +1 -1
- package/docs/taskbridge-upgrade.md +28 -28
- package/docs/taskdispatch-upgrade.md +25 -25
- package/docs/workspace-contract.md +538 -538
- package/docs/workspace-grouping.md +126 -126
- package/icon.svg +1 -1
- package/lib/client.d.ts +804 -699
- package/lib/client.js +7 -7
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +150 -144
- package/src/antigravity/installer.js +1068 -0
- package/src/antigravity/seam.js +142 -0
- package/src/auth/fence.js +361 -361
- package/src/auth/grants.js +789 -789
- package/src/client/api.js +266 -3
- package/src/client/index.jsx +224 -11
- package/src/client/sidebar.jsx +862 -862
- package/src/client/styles.js +624 -624
- package/src/client/task-cleanup.js +429 -304
- package/src/client/task-records-table.jsx +217 -217
- package/src/client/task-view.js +307 -307
- package/src/client/workspace-groups.js +482 -482
- package/src/client/workspaces-browser.jsx +770 -770
- package/src/codex/agent-ownership.js +270 -270
- package/src/codex/installer.js +6 -0
- package/src/codex/toml.js +784 -784
- package/src/config/defaults.js +11 -15
- package/src/config/redact.js +245 -245
- package/src/config/store.js +186 -186
- package/src/credentials/seam.js +202 -202
- package/src/http/respond.js +6 -5
- package/src/http/user-plane.js +83 -1
- package/src/index.js +25 -0
- package/src/jobs/diagnostics.js +15 -15
- package/src/jobs/engine.js +1 -0
- package/src/jobs/history.js +1 -1
- package/src/jobs/plan-store.js +1103 -1020
- package/src/jobs/record-cleanup.js +452 -7
- package/src/jobs/review-note.js +63 -63
- package/src/jobs/task-descriptions.js +82 -82
- package/src/jobs/task-display.js +73 -73
- package/src/jobs/task-tree.js +786 -786
- package/src/jobs/title.js +134 -134
- package/src/mcp/continuation.js +317 -317
- package/src/mcp/server.js +34 -27
- package/src/mcp/wait.js +34 -15
- package/src/model/connectivity.js +371 -371
- package/src/model/discovery.js +582 -582
- package/src/model/native-catalog.js +68 -68
- package/src/model/openai-adapter.js +671 -671
- package/src/model/probe.js +264 -264
- package/src/model/providers.js +756 -756
- package/src/model/routing.js +321 -321
- package/src/runtime/agent-runner.js +1 -0
- package/src/runtime/permissions.js +1619 -1619
- package/src/runtime/question-call.js +162 -162
- package/src/runtime/questions.js +909 -909
- package/src/runtime/session-placement.js +36 -1
- package/src/runtime/worker-prompt.js +61 -55
- package/src/workspace/audit.js +775 -775
- package/src/workspace/preflight.js +424 -424
- package/src/workspace/worktrees.js +833 -679
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// The seam the user plane and plugin startup use to reach the Antigravity integration.
|
|
2
|
+
//
|
|
3
|
+
// Mirrors `src/codex/seam.js`: resolves the Antigravity config home per call
|
|
4
|
+
// (`ANTIGRAVITY_CONFIG_DIR` / `GEMINI_CONFIG_DIR` → remembered successful install →
|
|
5
|
+
// default `~/.gemini/config`), pins the active DSH discovery file, keeps `status`
|
|
6
|
+
// strictly read-only, and runs automatic startup refresh only on already-installed
|
|
7
|
+
// managed plugin files.
|
|
8
|
+
|
|
9
|
+
import { readFileSync } from 'node:fs';
|
|
10
|
+
import { homedir } from 'node:os';
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
|
|
13
|
+
import { writeFileAtomic } from '../config/store.js';
|
|
14
|
+
import { inspectDirectory } from '../codex/installer.js';
|
|
15
|
+
import { resolveEndpointDiscoveryPath } from '../runtime/endpoint-discovery.js';
|
|
16
|
+
import {
|
|
17
|
+
ANTIGRAVITY_ENV_VARS,
|
|
18
|
+
readAntigravityStatus,
|
|
19
|
+
refreshManagedAntigravityPlugin,
|
|
20
|
+
requireAntigravityHome,
|
|
21
|
+
resolveAntigravityHome,
|
|
22
|
+
runAntigravityAction,
|
|
23
|
+
} from './installer.js';
|
|
24
|
+
|
|
25
|
+
export function antigravityInstallationRecordPath(env = process.env) {
|
|
26
|
+
const configured = typeof env.DSH_HOME === 'string' ? env.DSH_HOME.trim() : '';
|
|
27
|
+
const dshHome = configured === '' ? join(homedir(), '.dsh') : configured;
|
|
28
|
+
return join(dshHome, 'data', 'dsh-delegate', 'antigravity-installation.json');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function rememberInstalledAntigravityHome(antigravityHome, env = process.env) {
|
|
32
|
+
if (typeof antigravityHome !== 'string' || antigravityHome.trim() === '') return false;
|
|
33
|
+
try {
|
|
34
|
+
const record = { schemaVersion: 1, antigravityHome, recordedAt: new Date().toISOString() };
|
|
35
|
+
await writeFileAtomic(antigravityInstallationRecordPath(env), `${JSON.stringify(record)}\n`);
|
|
36
|
+
return true;
|
|
37
|
+
} catch {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function readInstalledAntigravityHome(env = process.env) {
|
|
43
|
+
try {
|
|
44
|
+
const text = readFileSync(antigravityInstallationRecordPath(env), 'utf8');
|
|
45
|
+
const record = JSON.parse(text);
|
|
46
|
+
if (record === null || typeof record !== 'object' || Array.isArray(record)) return null;
|
|
47
|
+
if (record.schemaVersion !== 1) return null;
|
|
48
|
+
if (typeof record.antigravityHome !== 'string' || record.antigravityHome.trim() === '') return null;
|
|
49
|
+
return requireAntigravityHome(record.antigravityHome);
|
|
50
|
+
} catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function resolveHomePreference({ env, explicitHome = '', homeDirectory = undefined, forAction = false }) {
|
|
56
|
+
if (explicitHome !== '') return { home: requireAntigravityHome(explicitHome), blocked: false, source: 'explicit' };
|
|
57
|
+
for (const key of ANTIGRAVITY_ENV_VARS) {
|
|
58
|
+
const configured = typeof env?.[key] === 'string' ? env[key].trim() : '';
|
|
59
|
+
if (configured !== '') return { home: requireAntigravityHome(configured), blocked: false, source: 'explicit' };
|
|
60
|
+
}
|
|
61
|
+
const remembered = readInstalledAntigravityHome(env);
|
|
62
|
+
if (remembered !== null) {
|
|
63
|
+
const kind = await inspectDirectory(remembered);
|
|
64
|
+
if (kind.kind === 'directory') return { home: remembered, blocked: false, source: 'recorded' };
|
|
65
|
+
}
|
|
66
|
+
const fallback = resolveAntigravityHome({ env, ...(homeDirectory === undefined ? {} : { homeDirectory }) });
|
|
67
|
+
const kind = await inspectDirectory(fallback);
|
|
68
|
+
if (kind.kind === 'missing') {
|
|
69
|
+
return forAction
|
|
70
|
+
? { home: fallback, blocked: false, source: 'default' }
|
|
71
|
+
: { home: null, blocked: false, source: 'none' };
|
|
72
|
+
}
|
|
73
|
+
if (kind.kind === 'directory') return { home: fallback, blocked: false, source: 'default' };
|
|
74
|
+
// A root link is allowed on explicit status/action (the installer pins it to realpath),
|
|
75
|
+
// while startup refresh skips an unrecorded default link.
|
|
76
|
+
if (forAction) return { home: fallback, blocked: false, source: 'default' };
|
|
77
|
+
return { home: fallback, blocked: true, source: 'default' };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function createAntigravitySeam(options = {}) {
|
|
81
|
+
const env = options.env ?? process.env;
|
|
82
|
+
const requestedHome = typeof options.antigravityHome === 'string' && options.antigravityHome.trim() !== ''
|
|
83
|
+
? options.antigravityHome
|
|
84
|
+
: null;
|
|
85
|
+
const requestedDiscovery = typeof options.discoveryFile === 'string' && options.discoveryFile.trim() !== ''
|
|
86
|
+
? options.discoveryFile
|
|
87
|
+
: null;
|
|
88
|
+
const homeDirectory = options.homeDirectory;
|
|
89
|
+
const version = typeof options.version === 'string' ? options.version : null;
|
|
90
|
+
|
|
91
|
+
const discovery = () => (requestedDiscovery !== null ? requestedDiscovery : resolveEndpointDiscoveryPath(env));
|
|
92
|
+
const baseFor = (home) => ({
|
|
93
|
+
antigravityHome: home,
|
|
94
|
+
env,
|
|
95
|
+
...(homeDirectory === undefined ? {} : { homeDirectory }),
|
|
96
|
+
...(options.nodeExecutable === undefined ? {} : { nodeExecutable: options.nodeExecutable }),
|
|
97
|
+
...(options.execPath === undefined ? {} : { execPath: options.execPath }),
|
|
98
|
+
...(options.resourcesPath === undefined ? {} : { resourcesPath: options.resourcesPath }),
|
|
99
|
+
...(options.versions === undefined ? {} : { versions: options.versions }),
|
|
100
|
+
...(options.platform === undefined ? {} : { platform: options.platform }),
|
|
101
|
+
...(discovery() === undefined ? {} : { discoveryFile: discovery() }),
|
|
102
|
+
...(version === null ? {} : { version }),
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
async startupTarget() {
|
|
107
|
+
const resolved = await resolveHomePreference({ env, explicitHome: requestedHome ?? '', homeDirectory, forAction: false });
|
|
108
|
+
const reason = resolved.home === null ? 'no-antigravity-home'
|
|
109
|
+
: (resolved.blocked === true ? 'default-is-link' : null);
|
|
110
|
+
return { home: resolved.blocked ? null : resolved.home, source: resolved.source, reason };
|
|
111
|
+
},
|
|
112
|
+
async refreshManagedIntegration(callOptions = {}) {
|
|
113
|
+
const target = callOptions?.startupTarget ?? await this.startupTarget();
|
|
114
|
+
if (typeof target?.home !== 'string' || target.home === '') {
|
|
115
|
+
return { changed: [], refused: [], status: null };
|
|
116
|
+
}
|
|
117
|
+
return await refreshManagedAntigravityPlugin(baseFor(target.home));
|
|
118
|
+
},
|
|
119
|
+
async status() {
|
|
120
|
+
const resolved = await resolveHomePreference({ env, explicitHome: requestedHome ?? '', homeDirectory, forAction: true });
|
|
121
|
+
return {
|
|
122
|
+
changed: [],
|
|
123
|
+
refused: [],
|
|
124
|
+
status: await readAntigravityStatus(baseFor(resolved.home)),
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
async run(action) {
|
|
128
|
+
const resolved = await resolveHomePreference({ env, explicitHome: requestedHome ?? '', homeDirectory, forAction: true });
|
|
129
|
+
const outcome = await runAntigravityAction(action, baseFor(resolved.home));
|
|
130
|
+
const home = outcome.status?.realAntigravityHome ?? outcome.status?.antigravityHome ?? resolved.home;
|
|
131
|
+
if (action === 'install' && outcome.refused.length === 0 && typeof home === 'string' && home !== '') {
|
|
132
|
+
await rememberInstalledAntigravityHome(home, env);
|
|
133
|
+
}
|
|
134
|
+
return outcome;
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function resolveAntigravityActionSeam(options = {}) {
|
|
140
|
+
if (options.disabled === true) return null;
|
|
141
|
+
return createAntigravitySeam(options);
|
|
142
|
+
}
|