dsh-taskbridge 1.8.0 → 1.9.0

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 (50) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +246 -231
  3. package/antigravity/agents/dsh-taskbridge.md +17 -14
  4. package/antigravity/skills/dsh-taskbridge/SKILL.md +40 -27
  5. package/bin/dsh-delegate-codex-agent.js +9 -4
  6. package/codex/skills/dsh-taskbridge/SKILL.md +131 -0
  7. package/codex/skills/dsh-taskbridge/rules-reference-96027c387cb9b7587efa4aa3836235d86db1108068e007dc08196e807ca25e5d.md +114 -0
  8. package/docs/INTRODUCTION.md +148 -119
  9. package/docs/INTRODUCTION.zh.md +151 -134
  10. package/docs/antigravity-integration.md +47 -42
  11. package/docs/assets/taskbridge-workflow.en.svg +72 -0
  12. package/docs/assets/taskbridge-workflow.zh.png +0 -0
  13. package/docs/claude-code.md +18 -18
  14. package/docs/codex-integration.md +139 -113
  15. package/docs/conversation-placement.md +7 -6
  16. package/docs/releases/1.8.0.zh.md +16 -16
  17. package/docs/releases/1.8.1.zh.md +24 -0
  18. package/docs/releases/1.9.0.zh.md +31 -0
  19. package/docs/runtime-compatibility.md +7 -9
  20. package/docs/silent-wait.md +17 -26
  21. package/docs/taskbridge-upgrade.md +4 -4
  22. package/lib/client.d.ts +74 -3
  23. package/lib/client.js +7 -7
  24. package/locale/en.json +7 -7
  25. package/locale/zh.json +7 -7
  26. package/package.json +11 -4
  27. package/src/antigravity/installer.js +1099 -1046
  28. package/src/antigravity/seam.js +142 -142
  29. package/src/client/api.js +258 -16
  30. package/src/client/index.jsx +130 -26
  31. package/src/client/task-cleanup.js +130 -5
  32. package/src/codex/agent-ownership.js +72 -12
  33. package/src/codex/installer.js +691 -268
  34. package/src/config/defaults.js +11 -15
  35. package/src/http/execution-plane.js +17 -0
  36. package/src/http/user-plane.js +17 -1
  37. package/src/index.d.ts +9 -1
  38. package/src/index.js +86 -64
  39. package/src/jobs/engine.js +279 -5
  40. package/src/jobs/history.js +18 -2
  41. package/src/jobs/plan-store.js +83 -0
  42. package/src/jobs/record-cleanup.js +714 -195
  43. package/src/mcp/server.js +271 -38
  44. package/src/mcp/wait.js +34 -15
  45. package/src/runtime/agent-runner.js +1 -0
  46. package/src/runtime/permissions.js +18 -0
  47. package/src/runtime/session-placement.js +36 -1
  48. package/src/runtime/worker-prompt.js +14 -9
  49. package/src/workspace/worktrees.js +155 -1
  50. package/codex/dsh-taskbridge.toml +0 -170
@@ -1,142 +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
- }
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
+ }