pendingyou 0.44.1 → 0.45.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.
- package/CHANGELOG.md +22 -0
- package/README.md +50 -2
- package/dist/apps/antigravity-hooks.js +326 -0
- package/dist/apps/antigravity.js +700 -0
- package/dist/apps/codex-wake.js +2 -0
- package/dist/apps/ids.js +2 -1
- package/dist/apps/registry.js +2 -1
- package/dist/args.js +7 -4
- package/dist/asked.js +1 -1
- package/dist/environment.js +4 -1
- package/dist/herdr.js +1 -0
- package/dist/hold.js +21 -6
- package/dist/init.js +6 -4
- package/dist/main.js +6 -0
- package/dist/pickup.js +5 -4
- package/dist/presence.js +23 -16
- package/dist/setup.js +4 -1
- package/dist/shim.js +2 -0
- package/dist/stopcheck.js +13 -4
- package/dist/version.js +1 -1
- package/package.json +3 -2
package/dist/apps/codex-wake.js
CHANGED
|
@@ -34,6 +34,7 @@ const CARD_TOOLS = {
|
|
|
34
34
|
codex: MCP_CARD_TOOL,
|
|
35
35
|
opencode: /^([A-Za-z0-9_-]*pendingyou[A-Za-z0-9_-]*)_(post_request|post_answer|update_request|reply_in_thread|cancel_request|answer_delegated|hand_back)$/i,
|
|
36
36
|
pi: MCP_CARD_TOOL,
|
|
37
|
+
antigravity: MCP_CARD_TOOL,
|
|
37
38
|
};
|
|
38
39
|
const HELPER_CALLS = new Set(['answer_delegated', 'hand_back']);
|
|
39
40
|
const MCP_NAMED_TOOL = /^mcp__([A-Za-z0-9_]*pendingyou[A-Za-z0-9_]*)__(whoami|list_pending|get_request)$/i;
|
|
@@ -41,6 +42,7 @@ const NAMED_TOOLS = {
|
|
|
41
42
|
codex: MCP_NAMED_TOOL,
|
|
42
43
|
opencode: /^([A-Za-z0-9_-]*pendingyou[A-Za-z0-9_-]*)_(whoami|list_pending|get_request)$/i,
|
|
43
44
|
pi: MCP_NAMED_TOOL,
|
|
45
|
+
antigravity: MCP_NAMED_TOOL,
|
|
44
46
|
};
|
|
45
47
|
export function cardTool(app, name) {
|
|
46
48
|
const pattern = CARD_TOOLS[app];
|
package/dist/apps/ids.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export const APP_IDS = ['claude-code', 'codex', 'opencode', 'pi'];
|
|
1
|
+
export const APP_IDS = ['claude-code', 'codex', 'opencode', 'pi', 'antigravity'];
|
|
2
2
|
export const APP_NAMES = {
|
|
3
3
|
'claude-code': 'Claude Code',
|
|
4
4
|
codex: 'Codex',
|
|
5
5
|
opencode: 'OpenCode',
|
|
6
6
|
pi: 'Pi',
|
|
7
|
+
antigravity: 'Antigravity',
|
|
7
8
|
};
|
|
8
9
|
export const DEFAULT_APP = 'claude-code';
|
|
9
10
|
export const isAppId = (text) => APP_IDS.includes(text);
|
package/dist/apps/registry.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { antigravity } from "./antigravity.js";
|
|
1
2
|
import { claudeCode } from "./claude-code.js";
|
|
2
3
|
import { codex } from "./codex.js";
|
|
3
4
|
import { opencode } from "./opencode.js";
|
|
4
5
|
import { pi } from "./pi.js";
|
|
5
6
|
export { atLeast } from "../mod.js";
|
|
6
|
-
export const APPS = [claudeCode, codex, opencode, pi];
|
|
7
|
+
export const APPS = [claudeCode, codex, opencode, pi, antigravity];
|
|
7
8
|
export function appModule(id) {
|
|
8
9
|
const found = APPS.find((app) => app.id === id);
|
|
9
10
|
if (!found)
|
package/dist/args.js
CHANGED
|
@@ -682,7 +682,7 @@ function appCommandOf(origin, positional, flags, machine, device) {
|
|
|
682
682
|
browser: !flags.has('no-browser'),
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
|
-
export const USAGE = `pendingyou: Pending You for your coding agents (Claude Code, Codex, OpenCode and
|
|
685
|
+
export const USAGE = `pendingyou: Pending You for your coding agents (Claude Code, Codex, OpenCode, Pi and Antigravity)
|
|
686
686
|
|
|
687
687
|
npx -y pendingyou@latest init
|
|
688
688
|
Set up every agent on this computer: its MCP server, signed in through
|
|
@@ -691,10 +691,13 @@ export const USAGE = `pendingyou: Pending You for your coding agents (Claude Cod
|
|
|
691
691
|
connects them all: your browser opens on Pending You, or over SSH you
|
|
692
692
|
approve a code on your phone. Claude Code 2.1.287 or later also gets the
|
|
693
693
|
wake mod; Codex is woken by codex queue; OpenCode gets a plugin and Pi
|
|
694
|
-
an extension that do all of that. --app limits it to some
|
|
694
|
+
an extension that do all of that. --app limits it to some.
|
|
695
|
+
Antigravity is set up only when named (--app antigravity), as a
|
|
696
|
+
first version to try: a plugin, and, if you say yes, its OK to run
|
|
697
|
+
Pending You's tools and hold without asking
|
|
695
698
|
npx pendingyou hold <req_…> Wait in the background until the answer to a request is ready,
|
|
696
|
-
print it, and exit (which wakes Claude Code); with
|
|
697
|
-
the mod answers it and nothing runs
|
|
699
|
+
print it, and exit (which wakes Claude Code, or Antigravity); with
|
|
700
|
+
the wake mod, the mod answers it and nothing runs
|
|
698
701
|
npx pendingyou status What's set up for each agent, and whether it hears answers right away
|
|
699
702
|
npx pendingyou login [--app <app>] | logout
|
|
700
703
|
Sign an agent in again (Claude Code's when none is named), or out
|
package/dist/asked.js
CHANGED
|
@@ -40,7 +40,7 @@ function spoken(text) {
|
|
|
40
40
|
return kept.join('\n');
|
|
41
41
|
}
|
|
42
42
|
const FILLER = /^(?:(?:pending\s*(?:you|new|view)|hey|hi|hello|yo|ok(?:ay)?|so|um+|uh+|well|alright|all right|right|oh|and|also|now|please|quick question)\b[\s,.:;!?-]*)+/i;
|
|
43
|
-
const ASSISTANT = /^(?:claude|codex|opencode|pi|cursor|grok|chatgpt|gemini)\b[\s,.:;!-]*/i;
|
|
43
|
+
const ASSISTANT = /^(?:claude|codex|opencode|pi|cursor|grok|chatgpt|gemini|antigravity)\b[\s,.:;!-]*/i;
|
|
44
44
|
const NAMED = /^[A-Z][\p{L}’'-]*,\s+/u;
|
|
45
45
|
function opening(sentence) {
|
|
46
46
|
let text = sentence.trim();
|
package/dist/environment.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
|
+
import { antigravityServerUrl } from "./apps/antigravity.js";
|
|
2
3
|
import { codexServer } from "./apps/codex.js";
|
|
3
4
|
import { DEFAULT_APP } from "./apps/ids.js";
|
|
4
5
|
import { opencodeServer } from "./apps/opencode.js";
|
|
@@ -75,7 +76,9 @@ export async function environmentWarning(io, folder, origin, app = DEFAULT_APP)
|
|
|
75
76
|
? await opencodeServer(io).then((url) => (url ? { url, scope: 'user' } : null))
|
|
76
77
|
: app === 'pi'
|
|
77
78
|
? await piServerUrl(io).then((url) => (url ? { url, scope: 'user' } : null))
|
|
78
|
-
:
|
|
79
|
+
: app === 'antigravity'
|
|
80
|
+
? await antigravityServerUrl(io).then((url) => (url ? { url, scope: 'user' } : null))
|
|
81
|
+
: await serverForFolder(io, folder);
|
|
79
82
|
return differs(server, origin) ? mismatchLine(server, origin) : null;
|
|
80
83
|
}
|
|
81
84
|
catch {
|
package/dist/herdr.js
CHANGED
package/dist/hold.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { getJson, SignInNeeded, Unavailable } from "./api.js";
|
|
2
|
-
import { DEFAULT_APP } from "./apps/ids.js";
|
|
2
|
+
import { APP_NAMES, DEFAULT_APP } from "./apps/ids.js";
|
|
3
3
|
import { readPiManifest } from "./apps/pi.js";
|
|
4
4
|
import { DEFAULT_ORIGIN, DEFAULT_TIMEOUT_MS } from "./args.js";
|
|
5
5
|
import { readCredential } from "./credentials.js";
|
|
6
|
+
import { configDir, readJson } from "./files.js";
|
|
6
7
|
import { describe } from "./format.js";
|
|
7
8
|
import { linkSoon } from "./link.js";
|
|
9
|
+
import { agentProcess } from "./presence.js";
|
|
8
10
|
import { markHanded, momentOf } from "./state.js";
|
|
9
11
|
export const LONG_POLL_SECONDS = 25;
|
|
10
12
|
const PATIENT_AFTER_MS = 30 * 60 * 1000;
|
|
@@ -37,12 +39,25 @@ export const inPi = (env) => env.AI_AGENT === 'pi' || (!env.AI_AGENT && env.PI_C
|
|
|
37
39
|
export const piHoldReply = (requestId, extension) => extension
|
|
38
40
|
? `Pending You: no hold is needed in Pi, and Pi’s shell would wait on it. Pending You’s extension wakes this session when your person answers ${requestId}, writes to you on it, or its fallback runs, even while it’s idle. Nothing is running in the background: keep working, or end your turn.`
|
|
39
41
|
: `Pending You: Pi’s shell waits for a command to end, so a hold would stop this session for hours. While you’re blocked on ${requestId}, call get_request every pollAfterSeconds; otherwise list_pending at breakpoints.`;
|
|
42
|
+
const AGY_DEPTH = 10;
|
|
43
|
+
export async function holdApp(io) {
|
|
44
|
+
try {
|
|
45
|
+
const manifest = await readJson(`${configDir(io)}/antigravity.json`).catch(() => null);
|
|
46
|
+
if (manifest === null)
|
|
47
|
+
return DEFAULT_APP;
|
|
48
|
+
return (await agentProcess(io, 'antigravity', AGY_DEPTH)) ? 'antigravity' : DEFAULT_APP;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return DEFAULT_APP;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
40
54
|
export async function hold(io, options) {
|
|
41
55
|
const { origin, requestId } = options;
|
|
42
56
|
if (inPi(io.env)) {
|
|
43
57
|
io.out(`${piHoldReply(requestId, (await readPiManifest(io)) !== null)}\n`);
|
|
44
58
|
return 0;
|
|
45
59
|
}
|
|
60
|
+
const app = await holdApp(io);
|
|
46
61
|
const again = holdCommand(requestId, origin, options.timeoutMs);
|
|
47
62
|
const started = io.now();
|
|
48
63
|
const deadline = started + options.timeoutMs;
|
|
@@ -52,11 +67,11 @@ export async function hold(io, options) {
|
|
|
52
67
|
ended
|
|
53
68
|
? `Pending You: this computer’s pendingyou sign-in has ended, so I can’t wait on ${requestId}.`
|
|
54
69
|
: `Pending You: the pendingyou command isn’t signed in on this computer, so I can’t wait on ${requestId}.`,
|
|
55
|
-
|
|
70
|
+
`Ask your person to run \`npx pendingyou login${app === DEFAULT_APP ? '' : ` --app ${app}`}\`. Until then, call get_request at breakpoints.`,
|
|
56
71
|
]);
|
|
57
72
|
return 1;
|
|
58
73
|
};
|
|
59
|
-
if (!(await readCredential(io, origin)))
|
|
74
|
+
if (!(await readCredential(io, origin, app)))
|
|
60
75
|
return signInNeeded(false);
|
|
61
76
|
await linkSoon(io, origin);
|
|
62
77
|
let failures = 0;
|
|
@@ -79,7 +94,7 @@ export async function hold(io, options) {
|
|
|
79
94
|
const wait = Math.max(1, Math.min(LONG_POLL_SECONDS, Math.floor(left / 1000)));
|
|
80
95
|
let result;
|
|
81
96
|
try {
|
|
82
|
-
result = await getJson(io, origin, `/mcp/cli/requests/${encodeURIComponent(requestId)}?wait=${wait}&source=${
|
|
97
|
+
result = await getJson(io, origin, `/mcp/cli/requests/${encodeURIComponent(requestId)}?wait=${wait}&source=${app}`, (wait + 20) * 1000, io.signal, { app });
|
|
83
98
|
}
|
|
84
99
|
catch (error) {
|
|
85
100
|
if (io.signal.aborted)
|
|
@@ -96,8 +111,8 @@ export async function hold(io, options) {
|
|
|
96
111
|
failures = 0;
|
|
97
112
|
if (result.status === 404) {
|
|
98
113
|
print([
|
|
99
|
-
`Pending You: can’t find ${requestId} among your person’s
|
|
100
|
-
|
|
114
|
+
`Pending You: can’t find ${requestId} among your person’s ${APP_NAMES[app]} questions on ${origin}.`,
|
|
115
|
+
`Check the id from post_request. If this ${APP_NAMES[app]} signed in to Pending You as someone else, use get_request instead.`,
|
|
101
116
|
]);
|
|
102
117
|
return 1;
|
|
103
118
|
}
|
package/dist/init.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_APP, namesOf } from "./apps/ids.js";
|
|
2
2
|
import { opencodePluginPath, pluginCopyVersion } from "./apps/opencode.js";
|
|
3
3
|
import { APPS, appModule, atLeast } from "./apps/registry.js";
|
|
4
4
|
import { bridgeCommand, removeBridge, writeBridge } from "./bridge.js";
|
|
@@ -21,7 +21,7 @@ async function findApps(io, wanted) {
|
|
|
21
21
|
const found = [];
|
|
22
22
|
const problems = [];
|
|
23
23
|
for (const app of APPS) {
|
|
24
|
-
if (wanted
|
|
24
|
+
if (wanted ? !wanted.includes(app.id) : app.optIn)
|
|
25
25
|
continue;
|
|
26
26
|
const detected = await app.detect(io);
|
|
27
27
|
if (!detected) {
|
|
@@ -123,7 +123,9 @@ export async function init(io, options) {
|
|
|
123
123
|
if (found.length === 0) {
|
|
124
124
|
for (const problem of problems)
|
|
125
125
|
io.out(`${problem}\n`);
|
|
126
|
-
io.out(`Didn’t find ${namesOf(
|
|
126
|
+
io.out(`Didn’t find ${namesOf(APPS.filter((app) => !app.optIn).map((app) => app.id), 'or')} on this computer’s PATH. Install one, then run: npx -y pendingyou@latest init${flag}\n`);
|
|
127
|
+
for (const app of APPS.filter((each) => each.optIn))
|
|
128
|
+
io.out(`${app.name} is set up only when you name it: npx -y pendingyou@latest init --app ${app.id}${flag}\n`);
|
|
127
129
|
return 1;
|
|
128
130
|
}
|
|
129
131
|
const versions = found.map(({ app, detected }) => `${app.name} ${detected.version}${detected.from ? ` (${detected.from})` : ''}`);
|
|
@@ -235,7 +237,7 @@ async function coveredApps(io, wanted) {
|
|
|
235
237
|
return installed;
|
|
236
238
|
const found = [];
|
|
237
239
|
for (const app of APPS)
|
|
238
|
-
if (await app.detect(io))
|
|
240
|
+
if (!app.optIn && (await app.detect(io)))
|
|
239
241
|
found.push(app);
|
|
240
242
|
return found.length ? found : [appModule(DEFAULT_APP)];
|
|
241
243
|
}
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HOOK_DEADLINE_MS, refreshInBackground, SignInNeeded, Unavailable } from "./api.js";
|
|
2
|
+
import { antigravityHook, isAgyHook } from "./apps/antigravity-hooks.js";
|
|
2
3
|
import { setAnswerWait } from "./apps/codex.js";
|
|
3
4
|
import { heardHook } from "./apps/codex-midturn.js";
|
|
4
5
|
import { listen, listenHanded, posted } from "./apps/codex-wake.js";
|
|
@@ -177,6 +178,7 @@ export const isHook = (argv) => {
|
|
|
177
178
|
return false;
|
|
178
179
|
return HOOK_COMMANDS.has(command);
|
|
179
180
|
};
|
|
181
|
+
const forAntigravity = (argv) => argv.some((arg, index) => arg === '--app=antigravity' || (arg === '--app' && argv[index + 1] === 'antigravity'));
|
|
180
182
|
export async function main(argv, io) {
|
|
181
183
|
const hook = isHook(argv);
|
|
182
184
|
let command;
|
|
@@ -187,6 +189,8 @@ export async function main(argv, io) {
|
|
|
187
189
|
if (hook) {
|
|
188
190
|
const message = error instanceof UsageError ? error.message : 'Something went wrong.';
|
|
189
191
|
io.err(`pendingyou: ${message} Skipped this hook; run npx pendingyou@latest init to repair it.\n`);
|
|
192
|
+
if (forAntigravity(argv))
|
|
193
|
+
io.out('{}\n');
|
|
190
194
|
return 0;
|
|
191
195
|
}
|
|
192
196
|
if (error instanceof UsageError) {
|
|
@@ -198,6 +202,8 @@ export async function main(argv, io) {
|
|
|
198
202
|
if (hook && !HOOK_COMMANDS.has(command.name))
|
|
199
203
|
return 0;
|
|
200
204
|
try {
|
|
205
|
+
if (hook && 'app' in command && command.app === 'antigravity' && isAgyHook(command.name))
|
|
206
|
+
return await antigravityHook(io, command.name, command.origin, (agyIo) => runHook(agyIo, command));
|
|
201
207
|
return hook ? await runHook(io, command) : await run(io, command);
|
|
202
208
|
}
|
|
203
209
|
catch (error) {
|
package/dist/pickup.js
CHANGED
|
@@ -71,6 +71,7 @@ async function hookInput(io) {
|
|
|
71
71
|
transcript: string(input.transcript_path),
|
|
72
72
|
prompt: string(input.prompt),
|
|
73
73
|
turn: string(input.turn_id),
|
|
74
|
+
woken: input.woken === true,
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
async function takesHanded(io, context, heard, delegated) {
|
|
@@ -193,8 +194,8 @@ export async function pickup(io, options, hook = { fallback: '' }) {
|
|
|
193
194
|
: (known ??
|
|
194
195
|
(await readSaid(io, app).catch(() => ({})))[input.session])?.fork
|
|
195
196
|
: undefined;
|
|
196
|
-
if (app === 'codex')
|
|
197
|
-
await keepPresent(io, origin, input.session, input.given ? cwd : null);
|
|
197
|
+
if (app === 'codex' || app === 'antigravity')
|
|
198
|
+
await keepPresent(io, origin, input.session, input.given ? cwd : null, app);
|
|
198
199
|
else if (app === DEFAULT_APP && (mode === 'pickup' || input.session))
|
|
199
200
|
await announce(io, origin, app, {
|
|
200
201
|
state: 'live',
|
|
@@ -242,7 +243,7 @@ export async function pickup(io, options, hook = { fallback: '' }) {
|
|
|
242
243
|
transcript: input.transcript,
|
|
243
244
|
name: named ?? null,
|
|
244
245
|
});
|
|
245
|
-
if (mode === 'handoff' && readsAnswers(asker, input.prompt, io.now()))
|
|
246
|
+
if (mode === 'handoff' && !input.woken && readsAnswers(asker, input.prompt, io.now()))
|
|
246
247
|
reading = readHere(io, origin, app, cwd, asker);
|
|
247
248
|
const query = new URLSearchParams([
|
|
248
249
|
...folderForms(cwd, io.home).map((form) => ['cwd', form]),
|
|
@@ -320,7 +321,7 @@ export async function pickup(io, options, hook = { fallback: '' }) {
|
|
|
320
321
|
await releaseHanded(io, origin, heard.requestId, momentOf(heard)).catch(() => { });
|
|
321
322
|
return 0;
|
|
322
323
|
}
|
|
323
|
-
const again = (id) => app === DEFAULT_APP
|
|
324
|
+
const again = (id) => app === DEFAULT_APP || app === 'antigravity'
|
|
324
325
|
? `run \`${holdCommand(id, origin)}\` in the background`
|
|
325
326
|
: `carry on: Pending You wakes this ${app === 'codex' ? 'thread' : 'session'} when they write back`;
|
|
326
327
|
io.out(`${[
|
package/dist/presence.js
CHANGED
|
@@ -21,6 +21,11 @@ const REOPEN_PAUSE_MS = 1500;
|
|
|
21
21
|
const FORGET_MS = 2 * 24 * 60 * 60_000;
|
|
22
22
|
const SESSION = /^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/;
|
|
23
23
|
const ANCESTORS = 6;
|
|
24
|
+
export const AGENT_PROGRAMS = {
|
|
25
|
+
codex: /^codex/i,
|
|
26
|
+
antigravity: /^agy$/i,
|
|
27
|
+
};
|
|
28
|
+
const isKept = (app) => app === 'codex' || app === 'antigravity';
|
|
24
29
|
export function presenceCwd(cwd, home) {
|
|
25
30
|
if (!cwd)
|
|
26
31
|
return null;
|
|
@@ -238,40 +243,41 @@ async function processOf(io, pid) {
|
|
|
238
243
|
const match = /^\s*(\d+)\s+(.+?)\s*$/m.exec(result.stdout);
|
|
239
244
|
return match ? { ppid: Number(match[1]), command: match[2] } : null;
|
|
240
245
|
}
|
|
241
|
-
const
|
|
242
|
-
export async function
|
|
246
|
+
const isProgram = (app, command) => AGENT_PROGRAMS[app].test(command.split('/').at(-1) ?? '');
|
|
247
|
+
export async function agentProcess(io, app, depth = ANCESTORS) {
|
|
243
248
|
let pid = io.ppid;
|
|
244
|
-
for (let step = 0; step <
|
|
249
|
+
for (let step = 0; step < depth && pid && pid > 1; step++) {
|
|
245
250
|
const found = await processOf(io, pid);
|
|
246
251
|
if (!found)
|
|
247
252
|
return null;
|
|
248
|
-
if (
|
|
253
|
+
if (isProgram(app, found.command))
|
|
249
254
|
return pid;
|
|
250
255
|
pid = found.ppid;
|
|
251
256
|
}
|
|
252
257
|
return null;
|
|
253
258
|
}
|
|
254
|
-
|
|
259
|
+
export const codexProcess = (io) => agentProcess(io, 'codex');
|
|
260
|
+
async function stillRuns(io, app, pid) {
|
|
255
261
|
const result = await io.run('ps', ['-o', 'comm=', '-p', String(pid)], 2000);
|
|
256
|
-
return result.code === 0 &&
|
|
262
|
+
return result.code === 0 && isProgram(app, result.stdout.trim());
|
|
257
263
|
}
|
|
258
264
|
async function keeping(io, app, session) {
|
|
259
265
|
return stat(leasePath(io, app, session)).then((info) => Date.now() - info.mtimeMs < LEASE_STALE_MS, () => false);
|
|
260
266
|
}
|
|
261
|
-
export async function keepPresent(io, origin, session, cwd) {
|
|
267
|
+
export async function keepPresent(io, origin, session, cwd, app = 'codex') {
|
|
262
268
|
try {
|
|
263
269
|
if (!session || !SESSION.test(session) || io.platform === 'win32')
|
|
264
270
|
return;
|
|
265
|
-
if (!(await connected(io, origin,
|
|
271
|
+
if (!(await connected(io, origin, app)) && !(await herdrTarget(io)))
|
|
266
272
|
return;
|
|
267
|
-
if (await keeping(io,
|
|
273
|
+
if (await keeping(io, app, session))
|
|
268
274
|
return;
|
|
269
|
-
const pid = await
|
|
275
|
+
const pid = await agentProcess(io, app);
|
|
270
276
|
if (!pid) {
|
|
271
|
-
await announce(io, origin,
|
|
277
|
+
await announce(io, origin, app, { state: 'live', session, cwd, again: true });
|
|
272
278
|
return;
|
|
273
279
|
}
|
|
274
|
-
io.background(presenceArgs(origin,
|
|
280
|
+
io.background(presenceArgs(origin, app, { state: 'live', session, cwd, keep: true, pid, at: io.now() }));
|
|
275
281
|
}
|
|
276
282
|
catch { }
|
|
277
283
|
}
|
|
@@ -321,7 +327,7 @@ async function keep(io, command) {
|
|
|
321
327
|
taken = held === 'taken';
|
|
322
328
|
return;
|
|
323
329
|
}
|
|
324
|
-
if (!(await stillRuns(io, pid))) {
|
|
330
|
+
if (!(await stillRuns(io, app, pid))) {
|
|
325
331
|
if (speaking)
|
|
326
332
|
await sendOnce(io, { ...command, state: 'closed', at: io.now() });
|
|
327
333
|
return;
|
|
@@ -331,7 +337,7 @@ async function keep(io, command) {
|
|
|
331
337
|
const outcome = await sendOnce(io, { ...command, state: 'live', at: io.now() });
|
|
332
338
|
if (outcome && GIVE_UP.has(outcome))
|
|
333
339
|
speaking = false;
|
|
334
|
-
else
|
|
340
|
+
else if (app === 'codex')
|
|
335
341
|
await keepListening(io, command.origin, session);
|
|
336
342
|
}
|
|
337
343
|
if (badges)
|
|
@@ -383,8 +389,9 @@ export async function presence(io, command) {
|
|
|
383
389
|
const { session } = command;
|
|
384
390
|
if (!session || !SESSION.test(session))
|
|
385
391
|
return 0;
|
|
386
|
-
|
|
387
|
-
|
|
392
|
+
const { app } = command;
|
|
393
|
+
if (command.keep && command.pid && isKept(app) && command.state === 'live') {
|
|
394
|
+
await keep(io, { ...command, app, session, pid: command.pid });
|
|
388
395
|
return 0;
|
|
389
396
|
}
|
|
390
397
|
if (command.app !== 'claude-code')
|
package/dist/setup.js
CHANGED
|
@@ -39,7 +39,10 @@ export function setupOf(heard) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
export function setupCalls(app, stopFirst) {
|
|
42
|
-
|
|
42
|
+
const third = app === 'antigravity'
|
|
43
|
+
? '3. post_request a short test question in that testAreaId, start its hold in the background as your rules say (npx pendingyou hold with its requestId), tell your person it’s on its way, and end your turn: the hold wakes you when they answer, so don’t ask them to type anything.'
|
|
44
|
+
: '3. post_request a short test question in that testAreaId, tell your person it’s on its way, and end your turn: you’re woken when they answer, so don’t ask them to type anything.';
|
|
45
|
+
return `Three calls, nothing to install or approve: 1. whoami with your name.${stopFirst ? ' If it says app.setUp is true, another session did this: stop.' : ''} 2. report_setup with source ${app}, your name, skillSaved true, hears instant, and skillVersion set to whoami’s skill.latest. Its answer has a testAreaId. ${third}`;
|
|
43
46
|
}
|
|
44
47
|
export function setupLine(app, heard, setup) {
|
|
45
48
|
if (setup.verified)
|
package/dist/shim.js
CHANGED
|
@@ -36,6 +36,8 @@ if [ ! -x "$node" ]; then
|
|
|
36
36
|
fi
|
|
37
37
|
if [ -z "$node" ] || [ ! -r "$cli" ]; then
|
|
38
38
|
echo "pendingyou: its Node or its copy of pendingyou is gone. Run: npx -y pendingyou@latest init" >&2
|
|
39
|
+
# Antigravity reads a hook's output as a JSON object, always.
|
|
40
|
+
case " $* " in *" --app antigravity "*) echo '{}' ;; esac
|
|
39
41
|
exit 0
|
|
40
42
|
fi
|
|
41
43
|
exec "$node" "$cli" "$@"
|
package/dist/stopcheck.js
CHANGED
|
@@ -380,9 +380,10 @@ function opencodeTurn(input) {
|
|
|
380
380
|
const text = final.join('\n').trim();
|
|
381
381
|
return text ? { text, posted, cards, handed, asked } : null;
|
|
382
382
|
}
|
|
383
|
-
async function
|
|
383
|
+
export async function openCards(io, origin, cwd, app, session, unlisted = 'unknown') {
|
|
384
384
|
try {
|
|
385
|
-
const name =
|
|
385
|
+
const name = session.name ??
|
|
386
|
+
(app === 'claude-code' ? await sessionName(session.transcript ?? undefined) : undefined);
|
|
386
387
|
const query = new URLSearchParams([
|
|
387
388
|
...folderForms(cwd, io.home).map((form) => ['cwd', form]),
|
|
388
389
|
['limit', '0'],
|
|
@@ -396,17 +397,25 @@ async function openTitles(io, origin, cwd, app, session, unlisted = 'unknown') {
|
|
|
396
397
|
const requests = body.open?.requests;
|
|
397
398
|
if (!Array.isArray(requests))
|
|
398
399
|
return unlisted === 'none' ? [] : null;
|
|
399
|
-
return requests.flatMap((card) => typeof card?.title === 'string'
|
|
400
|
+
return requests.flatMap((card) => typeof card?.title === 'string'
|
|
401
|
+
? [
|
|
402
|
+
{
|
|
403
|
+
requestId: typeof card.requestId === 'string' ? card.requestId : null,
|
|
404
|
+
title: card.title,
|
|
405
|
+
},
|
|
406
|
+
]
|
|
407
|
+
: []);
|
|
400
408
|
}
|
|
401
409
|
catch {
|
|
402
410
|
return null;
|
|
403
411
|
}
|
|
404
412
|
}
|
|
413
|
+
const openTitles = async (...args) => (await openCards(...args))?.map((card) => card.title) ?? null;
|
|
405
414
|
async function turnOf(io, input, app) {
|
|
406
415
|
const final = typeof input.last_assistant_message === 'string' && input.last_assistant_message.trim()
|
|
407
416
|
? input.last_assistant_message
|
|
408
417
|
: '';
|
|
409
|
-
if (app === 'codex' || app === 'pi') {
|
|
418
|
+
if (app === 'codex' || app === 'pi' || app === 'antigravity') {
|
|
410
419
|
if (typeof input.turn_id !== 'string' || !input.turn_id || !final)
|
|
411
420
|
return null;
|
|
412
421
|
const record = await turnRecord(io, input.turn_id, app);
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.45.0';
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pendingyou",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Pending You for your coding agents: one command sets up Claude Code, Codex, OpenCode and
|
|
3
|
+
"version": "0.45.0",
|
|
4
|
+
"description": "Pending You for your coding agents: one command sets up Claude Code, Codex, OpenCode, Pi and Antigravity to ask you through Pending You and hear your answers, even while they sit idle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pendingyou",
|
|
7
7
|
"claude-code",
|
|
8
8
|
"codex",
|
|
9
9
|
"opencode",
|
|
10
10
|
"pi",
|
|
11
|
+
"antigravity",
|
|
11
12
|
"mcp",
|
|
12
13
|
"human-in-the-loop",
|
|
13
14
|
"ai-agents"
|