run402 4.79.0 → 4.79.2
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/gitvault-surface.json +1 -1
- package/lib/buzz-notifications.mjs +9 -11
- package/lib/harness-context.mjs +9 -3
- package/lib/up.mjs +1 -1
- package/package.json +1 -1
- package/sdk/dist/actions.d.ts +2 -2
- package/sdk/dist/node/client-detect.d.ts +1 -1
- package/sdk/dist/node/client-detect.d.ts.map +1 -1
- package/sdk/dist/node/client-detect.js +3 -0
- package/sdk/dist/node/client-detect.js.map +1 -1
package/gitvault-surface.json
CHANGED
|
@@ -27,9 +27,9 @@ Usage:
|
|
|
27
27
|
--on-call <hex> the Buzz agent (64-hex pubkey) a crash or platform incident pages with a p mention — the tag that wakes a managed Buzz agent
|
|
28
28
|
--on-call-name <name> the @name the page addresses it by (what Buzz renders as a mention chip); omitted, the gateway reads it from the agent's Buzz profile
|
|
29
29
|
run402 buzz notifications on-call <buzzper_id> --agent <hex-pubkey> [--name <display>] | --clear
|
|
30
|
-
set or clear the route's on-call agent (a PATCH at the route's current revision). Prints the
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
set or clear the route's on-call agent (a PATCH at the route's current revision). Prints the ONE pubkey
|
|
31
|
+
the agent must allow: pages are signed by the installation identity, and a managed Buzz agent answers only
|
|
32
|
+
its owner by default — add it to the agent's respond-to allowlist (or set respond-to to anyone).
|
|
33
33
|
run402 buzz notifications status [--org <uuid> | <buzzper_id>]
|
|
34
34
|
run402 buzz notifications test <buzzper_id> [--wait] [--poll-seconds <n>] [--timeout-seconds <n>]
|
|
35
35
|
run402 buzz notifications deliveries <buzzper_id> [--limit <n>] [--cursor <c>] [--delivery <buzzped_id>]
|
|
@@ -169,16 +169,14 @@ async function onCall(args) {
|
|
|
169
169
|
console.error("On-call agent cleared: crashes and incidents on this route page nobody.");
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const bots = Array.isArray(current.bots) ? current.bots.filter((bot) => bot && typeof bot.pubkey === "string") : [];
|
|
175
|
-
console.error("A managed Buzz agent answers only its owner by default and drops a project bot's page before seeing it.");
|
|
176
|
-
if (bots.length) {
|
|
177
|
-
console.error("Add these project-bot pubkeys to the agent's respond-to allowlist (Buzz Desktop agent settings, or --respond-to allowlist --respond-to-allowlist ...), then restart it:");
|
|
178
|
-
for (const bot of bots) console.error(` ${bot.pubkey} (${bot.display_name ?? bot.project_id})`);
|
|
172
|
+
if (updated.on_call_display_name) {
|
|
173
|
+
console.error(`On-call agent set: a crash or platform incident on this route now opens with "@${updated.on_call_display_name} please investigate:" and carries a p tag for ${updated.on_call_buzz_pubkey}.`);
|
|
179
174
|
} else {
|
|
180
|
-
console.error(
|
|
175
|
+
console.error(`On-call agent set: a crash or platform incident on this route carries a p tag for ${updated.on_call_buzz_pubkey}. No display name was found on its Buzz profile, so the page has no @mention text; rerun with --name <display> to add it.`);
|
|
181
176
|
}
|
|
177
|
+
console.error("A managed Buzz agent answers only its owner by default and drops a page before seeing it.");
|
|
178
|
+
console.error("Pages are signed by the installation identity, so allowlist this ONE pubkey on the agent (Buzz Desktop agent settings, or --respond-to allowlist --respond-to-allowlist ...), then restart it:");
|
|
179
|
+
console.error(` ${current.notification_pubkey} (run402 installation identity — one entry covers every routed project)`);
|
|
182
180
|
} catch (err) {
|
|
183
181
|
reportSdkError(err);
|
|
184
182
|
}
|
package/lib/harness-context.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Best-effort session + task identity sourced from the AI harness running
|
|
3
|
-
* this CLI invocation (Claude Code or
|
|
3
|
+
* this CLI invocation (Claude Code, Codex, or Grok) — no network call, every source
|
|
4
4
|
* optional, the chain always terminates. Backs coordination-room presence
|
|
5
5
|
* resumption in rooms-context.mjs (run402-private's
|
|
6
6
|
* presence-naming-ergonomics, tasks 2.2 / 3.1-3.2).
|
|
@@ -39,7 +39,8 @@ function isTruthyEnvValue(raw) {
|
|
|
39
39
|
/**
|
|
40
40
|
* Resolve THIS session's opaque identity as an ordered chain with no network
|
|
41
41
|
* call: explicit override -> Claude Code's own session id -> Codex's own
|
|
42
|
-
* thread id -> a locally generated key persisted
|
|
42
|
+
* thread id -> Grok's own session id -> a locally generated key persisted
|
|
43
|
+
* for this checkout. No
|
|
43
44
|
* source is load-bearing — a harness that sets neither env var, or a
|
|
44
45
|
* filesystem that refuses the write, still yields a usable key for this run.
|
|
45
46
|
*/
|
|
@@ -61,6 +62,9 @@ export function resolveSessionKey({
|
|
|
61
62
|
const codexId = env.CODEX_THREAD_ID?.trim();
|
|
62
63
|
if (codexId) return { key: codexId, source: "codex_thread_id" };
|
|
63
64
|
|
|
65
|
+
const grokId = env.GROK_SESSION_ID?.trim();
|
|
66
|
+
if (grokId) return { key: grokId, source: "grok_session_id" };
|
|
67
|
+
|
|
64
68
|
const keyPath = join(cwd, SESSION_KEY_CACHE_RELATIVE_PATH);
|
|
65
69
|
try {
|
|
66
70
|
if (existsSyncImpl(keyPath)) {
|
|
@@ -91,7 +95,7 @@ export function resolveSessionKey({
|
|
|
91
95
|
* env overrides first (`RUN402_PROGRAM`/`RUN402_MODEL`), then `program`
|
|
92
96
|
* inferred from the SAME harness signals {@link resolveSessionKey} already
|
|
93
97
|
* trusts (`CLAUDE_CODE_SESSION_ID` or `CLAUDECODE` -> `"claude-code"`;
|
|
94
|
-
* `CODEX_THREAD_ID` -> `"codex"`). `model` has no harness-exposed signal to
|
|
98
|
+
* `CODEX_THREAD_ID` -> `"codex"`; `GROK_SESSION_ID` or `GROK_AGENT` -> `"grok"`). `model` has no harness-exposed signal to
|
|
95
99
|
* infer from today (open question in kygit-invite design.md) — it is
|
|
96
100
|
* ALWAYS env-override-or-null, never guessed from `program`. Null stays
|
|
97
101
|
* null in both fields: a placeholder label would be a Faithful breach.
|
|
@@ -105,6 +109,8 @@ export function resolveHarnessLabels({ env = process.env } = {}) {
|
|
|
105
109
|
program = "claude-code";
|
|
106
110
|
} else if (env.CODEX_THREAD_ID?.trim()) {
|
|
107
111
|
program = "codex";
|
|
112
|
+
} else if (env.GROK_SESSION_ID?.trim() || env.GROK_AGENT?.trim()) {
|
|
113
|
+
program = "grok";
|
|
108
114
|
}
|
|
109
115
|
}
|
|
110
116
|
const model = modelOverride || null;
|
package/lib/up.mjs
CHANGED
|
@@ -75,7 +75,7 @@ into a failure, and is reported under result.repo (default apply) or result
|
|
|
75
75
|
|
|
76
76
|
Identity: up makes sure this principal has a display name before the deploy
|
|
77
77
|
that will be credited to it — an existing name is kept, otherwise the
|
|
78
|
-
detected client name (claude-code, codex, cursor, or agent) is set (approved
|
|
78
|
+
detected client name (claude-code, codex, cursor, grok, or agent) is set (approved)
|
|
79
79
|
by -y, or asked once) — and joins the project room under it. Change it any
|
|
80
80
|
time with 'run402 org whoami --set-name <name>'. Reported under
|
|
81
81
|
result.identity.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402",
|
|
3
|
-
"version": "4.79.
|
|
3
|
+
"version": "4.79.2",
|
|
4
4
|
"description": "CLI for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/sdk/dist/actions.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export interface Run402UpActionInput {
|
|
|
71
71
|
noRehearse?: boolean;
|
|
72
72
|
/** Explicit display name to set on the principal when it has none yet.
|
|
73
73
|
* Omitted: `RUN402_AGENT_NAME` when set, else a specifically detected
|
|
74
|
-
* client (`claude-code`, `codex`, `cursor`) reported as `identity.source:
|
|
74
|
+
* client (`claude-code`, `codex`, `cursor`, `grok`) reported as `identity.source:
|
|
75
75
|
* "detected"`; when nothing is known no name is written and the result
|
|
76
76
|
* says `identity.source: "undetected"`. */
|
|
77
77
|
identityName?: string;
|
|
@@ -81,7 +81,7 @@ export interface Run402UpIdentity {
|
|
|
81
81
|
display_name: string | null;
|
|
82
82
|
/** `existing`: already set; `explicit`: set now from `identityName` or
|
|
83
83
|
* `RUN402_AGENT_NAME`; `detected`: set now from a specifically detected
|
|
84
|
-
* client (`claude-code`, `codex`, `cursor`); `undetected`: nothing known
|
|
84
|
+
* client (`claude-code`, `codex`, `cursor`, `grok`); `undetected`: nothing known
|
|
85
85
|
* and nothing persisted — a guess is never written as a name (the room
|
|
86
86
|
* presence is `agent` for coordination only); `unavailable`: could not be
|
|
87
87
|
* read or set (never fails the deploy). */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* persisted as a name. `RUN402_AGENT_NAME` (read by `up` before detection)
|
|
6
6
|
* is the way any runtime names itself with no per-command flag.
|
|
7
7
|
*/
|
|
8
|
-
export type DetectedClientName = "claude-code" | "codex" | "cursor";
|
|
8
|
+
export type DetectedClientName = "claude-code" | "codex" | "cursor" | "grok";
|
|
9
9
|
export declare function detectClientName(env?: NodeJS.ProcessEnv): DetectedClientName | null;
|
|
10
10
|
/** The name an agent runtime declares for itself, if any (`RUN402_AGENT_NAME`, trimmed). */
|
|
11
11
|
export declare function declaredAgentName(env?: NodeJS.ProcessEnv): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-detect.d.ts","sourceRoot":"","sources":["../../src/node/client-detect.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"client-detect.d.ts","sourceRoot":"","sources":["../../src/node/client-detect.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7E,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,kBAAkB,GAAG,IAAI,CAOhG;AAED,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAIrF"}
|
|
@@ -5,6 +5,9 @@ export function detectClientName(env = process.env) {
|
|
|
5
5
|
return "codex";
|
|
6
6
|
if (env.CURSOR_TRACE_ID || env.CURSOR_SESSION_ID || env.CURSOR_AGENT)
|
|
7
7
|
return "cursor";
|
|
8
|
+
// Grok Build / Grok CLI: GROK_AGENT=1 and a per-session GROK_SESSION_ID.
|
|
9
|
+
if (env.GROK_AGENT || env.GROK_SESSION_ID)
|
|
10
|
+
return "grok";
|
|
8
11
|
return null;
|
|
9
12
|
}
|
|
10
13
|
/** The name an agent runtime declares for itself, if any (`RUN402_AGENT_NAME`, trimmed). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-detect.js","sourceRoot":"","sources":["../../src/node/client-detect.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,gBAAgB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACnE,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,sBAAsB,IAAI,GAAG,CAAC,sBAAsB;QAAE,OAAO,aAAa,CAAC;IACxH,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,UAAU;QAAE,OAAO,OAAO,CAAC;IAC5F,IAAI,GAAG,CAAC,eAAe,IAAI,GAAG,CAAC,iBAAiB,IAAI,GAAG,CAAC,YAAY;QAAE,OAAO,QAAQ,CAAC;IACtF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,iBAAiB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACpE,MAAM,GAAG,GAAG,GAAG,CAAC,iBAAiB,CAAC;IAClC,MAAM,IAAI,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC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