osborn 0.9.291 → 0.9.293
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/.claude/skills/browser-apply/SKILL.md +5 -4
- package/.claude/skills/browser-apply/candidate.example.env +4 -1
- package/.claude/skills/browser-apply/fill.mjs +13 -2
- package/.claude/skills/meetings/SKILL.md +26 -7
- package/.env.example +6 -0
- package/dist/agent-store.d.ts +6 -0
- package/dist/agent-store.js +36 -6
- package/dist/approval-policy.d.ts +99 -0
- package/dist/approval-policy.js +196 -0
- package/dist/claude-llm.d.ts +3 -2
- package/dist/claude-llm.js +49 -19
- package/dist/config.d.ts +12 -16
- package/dist/config.js +80 -22
- package/dist/content/compaction-lens-worker.d.ts +5 -0
- package/dist/content/compaction-lens-worker.js +78 -7
- package/dist/content/content-llm.d.ts +14 -3
- package/dist/content/content-llm.js +33 -142
- package/dist/content/lens-db.d.ts +16 -5
- package/dist/content/lens-db.js +58 -11
- package/dist/content/lens-ingest.d.ts +1 -0
- package/dist/content/lens-ingest.js +1 -1
- package/dist/content/lens-launch.d.ts +42 -1
- package/dist/content/lens-launch.js +202 -40
- package/dist/content/lens-library-digest.d.ts +85 -0
- package/dist/content/lens-library-digest.js +305 -0
- package/dist/content/lens-library-index.d.ts +14 -3
- package/dist/content/lens-library-index.js +35 -8
- package/dist/content/lens-library-select.d.ts +1 -1
- package/dist/content/lens-library-select.js +1 -1
- package/dist/content/lens-library-sweep.d.ts +36 -0
- package/dist/content/lens-library-sweep.js +331 -0
- package/dist/content/lens-library.d.ts +29 -0
- package/dist/content/lens-library.js +130 -20
- package/dist/content/lens-model.d.ts +4 -0
- package/dist/content/lens-model.js +5 -0
- package/dist/content/lens-paths.d.ts +72 -0
- package/dist/content/lens-paths.js +248 -5
- package/dist/content/period-run.js +2 -2
- package/dist/content/secret-rules.d.ts +51 -0
- package/dist/content/secret-rules.js +185 -0
- package/dist/content/transcript-sanitizer.d.ts +1 -41
- package/dist/content/transcript-sanitizer.js +4 -171
- package/dist/data-sender-auth.d.ts +43 -6
- package/dist/data-sender-auth.js +61 -45
- package/dist/env-keys.d.ts +10 -2
- package/dist/env-keys.js +26 -5
- package/dist/index.js +499 -106
- package/dist/phone-code.d.ts +76 -0
- package/dist/phone-code.js +124 -0
- package/dist/phone-voice-actions.d.ts +132 -0
- package/dist/phone-voice-actions.js +223 -0
- package/dist/pipeline-direct-llm.d.ts +7 -1
- package/dist/pipeline-direct-llm.js +12 -1
- package/dist/prompts/library-digest.md +11 -0
- package/dist/prompts.js +2 -2
- package/dist/pushover.d.ts +2 -1
- package/dist/pushover.js +7 -6
- package/dist/risk-tier.d.ts +14 -0
- package/dist/risk-tier.js +140 -0
- package/dist/session-store.d.ts +1 -0
- package/dist/session-store.js +3 -2
- package/dist/session-switch.d.ts +22 -7
- package/dist/session-switch.js +58 -24
- package/dist/steward-verdict.d.ts +16 -3
- package/dist/steward-verdict.js +37 -18
- package/dist/watch-gateway.js +3 -1
- package/package.json +1 -1
- package/dist/bridge-llm.d.ts +0 -22
- package/dist/bridge-llm.js +0 -39
- package/dist/codex-handler.d.ts +0 -38
- package/dist/codex-handler.js +0 -83
- package/dist/codex-llm.d.ts +0 -40
- package/dist/codex-llm.js +0 -144
- package/dist/fast-brain.d.ts +0 -176
- package/dist/fast-brain.js +0 -1887
- package/dist/index-3-2-26-legacy.d.ts +0 -1
- package/dist/index-3-2-26-legacy.js +0 -2233
- package/dist/leagcyprompts2.d.ts +0 -0
- package/dist/leagcyprompts2.js +0 -573
- package/dist/prompts-2-25-26.d.ts +0 -0
- package/dist/prompts-2-25-26.js +0 -518
- package/dist/prompts-3-2-26.d.ts +0 -78
- package/dist/prompts-3-2-26.js +0 -1319
- package/dist/summary-index.d.ts +0 -90
- package/dist/summary-index.js +0 -585
|
@@ -35,177 +35,10 @@
|
|
|
35
35
|
*/
|
|
36
36
|
import { readFileSync } from 'node:fs';
|
|
37
37
|
import { stripInjected } from './lens-strip.js';
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
* values via a negative lookahead).
|
|
43
|
-
*/
|
|
44
|
-
export const SECRET_RULES = [
|
|
45
|
-
// npm registry auth line (contains an npm_ token; redact the whole value).
|
|
46
|
-
{
|
|
47
|
-
kind: 'NPM-AUTH',
|
|
48
|
-
re: /\/\/registry\.npmjs\.org\/:_authToken=[^\s"'`]+/g,
|
|
49
|
-
replace: '//registry.npmjs.org/:_authToken=[REDACTED-NPM-AUTH]',
|
|
50
|
-
},
|
|
51
|
-
// npm granular/automation token: npm_ + 36 base62 chars.
|
|
52
|
-
{ kind: 'NPM-TOKEN', re: /npm_[A-Za-z0-9]{36}/g, replace: '[REDACTED-NPM-TOKEN]' },
|
|
53
|
-
// Fly.io macaroon tokens. A real token is a COMMA-SEPARATED list of
|
|
54
|
-
// segments ("FlyV1 fm2_<a>,fm2_<b>,fm2_<c>"); redact the WHOLE list, not just
|
|
55
|
-
// the first segment (the segment char class has no comma, so the old rule
|
|
56
|
-
// stopped at the first "," and leaked the rest).
|
|
57
|
-
{
|
|
58
|
-
kind: 'FLY-TOKEN',
|
|
59
|
-
re: /FlyV1\s+fm[12]_[A-Za-z0-9/+_=-]+(?:\s*,\s*fm[12]_[A-Za-z0-9/+_=-]+)*/g,
|
|
60
|
-
replace: '[REDACTED-FLY-TOKEN]',
|
|
61
|
-
},
|
|
62
|
-
// Standalone Fly macaroon segment without the FlyV1 prefix (floor skips bare
|
|
63
|
-
// "fm2_" word mentions).
|
|
64
|
-
{
|
|
65
|
-
kind: 'FLY-TOKEN',
|
|
66
|
-
re: /(?<![A-Za-z0-9])fm[12]_[A-Za-z0-9/+_=-]{20,}/g,
|
|
67
|
-
replace: '[REDACTED-FLY-TOKEN]',
|
|
68
|
-
},
|
|
69
|
-
// Fly GraphQL fo1_ token (floor skips bare "fo1_" word mentions).
|
|
70
|
-
{ kind: 'FLY-TOKEN', re: /fo1_[A-Za-z0-9/+_=-]{20,}/g, replace: '[REDACTED-FLY-TOKEN]' },
|
|
71
|
-
// Supabase personal access token (real = 40 hex; floor skips "sbp_/" prose).
|
|
72
|
-
{ kind: 'SUPABASE-PAT', re: /sbp_[A-Za-z0-9]{20,}/g, replace: '[REDACTED-SUPABASE-PAT]' },
|
|
73
|
-
// PEM private key blocks (multiline). Terminated block first, then a
|
|
74
|
-
// truncated/unterminated block (header + base64 body, literal "\n" allowed).
|
|
75
|
-
{
|
|
76
|
-
kind: 'PEM-PRIVATE-KEY',
|
|
77
|
-
re: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,
|
|
78
|
-
replace: '[REDACTED-PEM-PRIVATE-KEY]',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
kind: 'PEM-PRIVATE-KEY',
|
|
82
|
-
re: /-----BEGIN [A-Z ]*PRIVATE KEY-----(?:[\sA-Za-z0-9+/=]|\\n)*/g,
|
|
83
|
-
replace: '[REDACTED-PEM-PRIVATE-KEY]',
|
|
84
|
-
},
|
|
85
|
-
// Anthropic keys: sk-ant-api03-…, sk-ant-oat01-… (MUST run before OPENAI-KEY).
|
|
86
|
-
{ kind: 'ANTHROPIC-KEY', re: /sk-ant-[A-Za-z0-9_-]{20,}/g, replace: '[REDACTED-ANTHROPIC-KEY]' },
|
|
87
|
-
// OpenRouter / OpenAI prefixed keys whose body contains _ or - (sk-or-v1-, sk-proj-, sk-svcacct-).
|
|
88
|
-
{
|
|
89
|
-
kind: 'OPENAI-KEY',
|
|
90
|
-
re: /\bsk-(?:or-v1-|or-|proj-|svcacct-)[A-Za-z0-9_-]{20,}/g,
|
|
91
|
-
replace: '[REDACTED-OPENAI-KEY]',
|
|
92
|
-
},
|
|
93
|
-
// OpenAI / OpenRouter keys (sk-, sk-or-, sk-proj-). Floor skips "task-budgets".
|
|
94
|
-
{ kind: 'OPENAI-KEY', re: /sk-(?:or-|proj-)?[A-Za-z0-9]{20,}/g, replace: '[REDACTED-OPENAI-KEY]' },
|
|
95
|
-
// GitHub tokens: ghp_/gho_/ghu_/ghs_/ghr_ (+ fine-grained github_pat_).
|
|
96
|
-
{ kind: 'GITHUB-TOKEN', re: /\bgh[pousr]_[A-Za-z0-9]{30,}/g, replace: '[REDACTED-GITHUB-TOKEN]' },
|
|
97
|
-
{ kind: 'GITHUB-TOKEN', re: /\bgithub_pat_[A-Za-z0-9_]{30,}/g, replace: '[REDACTED-GITHUB-TOKEN]' },
|
|
98
|
-
// Google API key.
|
|
99
|
-
{ kind: 'GOOGLE-API-KEY', re: /AIza[0-9A-Za-z_-]{35}/g, replace: '[REDACTED-GOOGLE-API-KEY]' },
|
|
100
|
-
// Fireworks AI key: fw_ + ~24 base62 chars. Floor of 20 pure alphanumerics
|
|
101
|
-
// skips snake_case identifiers like "fw_key" / "fw_test_script".
|
|
102
|
-
{
|
|
103
|
-
kind: 'FIREWORKS-KEY',
|
|
104
|
-
re: /(?<![A-Za-z0-9_])fw_[A-Za-z0-9]{20,}/g,
|
|
105
|
-
replace: '[REDACTED-FIREWORKS-KEY]',
|
|
106
|
-
},
|
|
107
|
-
// Soniox project key: snx_proj_ + key body (floor skips bare prefix mentions).
|
|
108
|
-
{
|
|
109
|
-
kind: 'SONIOX-KEY',
|
|
110
|
-
re: /(?<![A-Za-z0-9_])snx_proj_[A-Za-z0-9_-]{20,}/g,
|
|
111
|
-
replace: '[REDACTED-SONIOX-KEY]',
|
|
112
|
-
},
|
|
113
|
-
// Bare Soniox key (snx_<body>, no proj_ segment); the 16-char floor skips prefix mentions.
|
|
114
|
-
{
|
|
115
|
-
kind: 'SONIOX-KEY',
|
|
116
|
-
re: /(?<![A-Za-z0-9_])snx_(?!proj_)[A-Za-z0-9]{16,}/g,
|
|
117
|
-
replace: '[REDACTED-SONIOX-KEY]',
|
|
118
|
-
},
|
|
119
|
-
// JWTs (header.payload.signature, base64url).
|
|
120
|
-
{
|
|
121
|
-
kind: 'JWT',
|
|
122
|
-
re: /eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g,
|
|
123
|
-
replace: '[REDACTED-JWT]',
|
|
124
|
-
},
|
|
125
|
-
// API-key headers: x-api-key, x-goog-api-key (Gemini REST), and generic api-key
|
|
126
|
-
// (Azure etc.) — curl -H, JSON headers, raw HTTP. Keeps the header name, masks
|
|
127
|
-
// the value. Floor of 8 skips prose like "x-api-key: header".
|
|
128
|
-
{
|
|
129
|
-
kind: 'X-API-KEY',
|
|
130
|
-
// (?!\$) skips $VAR / ${var} references — not secrets, just noise.
|
|
131
|
-
re: /(\b(?:x-goog-|x-)?api-key["'`]?\s*[:=]\s*["'`]?)(?!\[REDACTED|\$)[^\s"'`,;}]{8,}/gi,
|
|
132
|
-
replace: '$1[REDACTED-API-KEY]',
|
|
133
|
-
},
|
|
134
|
-
// Authorization header (optional Bearer/Basic/Token scheme). Keeps name +
|
|
135
|
-
// scheme, masks the credential.
|
|
136
|
-
{
|
|
137
|
-
kind: 'AUTH-HEADER',
|
|
138
|
-
re: /(Authorization["'`]?\s*:\s*["'`]?(?:(?:Bearer|Basic|Token)\s+)?)(?!\[REDACTED|\$)[^\s"'`,;}]{8,}/gi,
|
|
139
|
-
replace: '$1[REDACTED-AUTH]',
|
|
140
|
-
},
|
|
141
|
-
// Slack tokens xoxb-/xoxa-/xoxp-/xoxr-/xoxs- (floor skips "xox/" prose).
|
|
142
|
-
{ kind: 'SLACK-TOKEN', re: /xox[baprs]-[A-Za-z0-9-]{10,}/g, replace: '[REDACTED-SLACK-TOKEN]' },
|
|
143
|
-
// AWS access key id.
|
|
144
|
-
{ kind: 'AWS-KEY', re: /\bAKIA[0-9A-Z]{16}\b/g, replace: '[REDACTED-AWS-KEY]' },
|
|
145
|
-
// Generic Bearer token (keep the word "Bearer"; floor skips "Bearer patterns").
|
|
146
|
-
{ kind: 'BEARER', re: /Bearer\s+[A-Za-z0-9._\-+/=]{20,}/g, replace: 'Bearer [REDACTED-TOKEN]' },
|
|
147
|
-
// Generic *_API_KEY= / *_SECRET= / *_TOKEN= / *_ACCESS_KEY= / *_PASSWORD= assignments.
|
|
148
|
-
// Keeps NAME= and any surrounding quote; masks only the value. Skips values
|
|
149
|
-
// already replaced by a specific rule above (negative lookahead on [REDACTED).
|
|
150
|
-
{
|
|
151
|
-
kind: 'ENV-SECRET',
|
|
152
|
-
re: /\b([A-Za-z0-9_]*(?:API_KEY|SECRET|ACCESS_KEY|PASSWORD|TOKEN))(\s*=\s*)(["'`“”]?)(?!\[REDACTED)([^\s"'`“”]{6,})\3/g,
|
|
153
|
-
replace: '$1$2$3[REDACTED-ENV-SECRET]$3',
|
|
154
|
-
},
|
|
155
|
-
];
|
|
156
|
-
/**
|
|
157
|
-
* Conservative high-entropy fallback, applied to ASSISTANT records only (the
|
|
158
|
-
* assistant echoes tool output, so unknown-vendor keys can leak there). Matches
|
|
159
|
-
* a standalone 32+ char token of [A-Za-z0-9_+=-] that has at least one
|
|
160
|
-
* uppercase, one lowercase, and four digits. Mixed-case + digit floor skips
|
|
161
|
-
* git SHAs / sha256 hex / UUIDs (lowercase) and CONSTANT_NAMES (no lowercase);
|
|
162
|
-
* the "/" and "." boundaries skip paths and dotted identifiers. Measured 0 hits
|
|
163
|
-
* across 2508 real assistant records in session c97588f4 (no false positives).
|
|
164
|
-
*/
|
|
165
|
-
export const HIGH_ENTROPY_RULE = {
|
|
166
|
-
kind: 'HIGH-ENTROPY',
|
|
167
|
-
re: /(?<![A-Za-z0-9_+=\/.\[-])(?=[A-Za-z0-9_+=-]*[A-Z])(?=[A-Za-z0-9_+=-]*[a-z])(?=(?:[A-Za-z0-9_+=-]*\d){4})[A-Za-z0-9_+=-]{32,}(?![A-Za-z0-9_+=\/.\]-])/g,
|
|
168
|
-
replace: '[REDACTED-HIGH-ENTROPY]',
|
|
169
|
-
};
|
|
170
|
-
function rulesFor(opts = {}) {
|
|
171
|
-
return opts.assistant ? [...SECRET_RULES, HIGH_ENTROPY_RULE] : SECRET_RULES;
|
|
172
|
-
}
|
|
173
|
-
/** Mask every secret-shaped substring in `text`. Pure. */
|
|
174
|
-
export function redactSecrets(text, opts = {}) {
|
|
175
|
-
let out = text;
|
|
176
|
-
for (const rule of rulesFor(opts)) {
|
|
177
|
-
out = out.replace(rule.re, rule.replace);
|
|
178
|
-
}
|
|
179
|
-
return out;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Detector used by the verification harness: returns the list of secret KINDs
|
|
183
|
-
* that STILL match `text`. The authoritative "no secret survives" invariant is
|
|
184
|
-
* `detectSecrets(output).length === 0`. This is precise (uses the same shapes
|
|
185
|
-
* as redaction) rather than a naive substring scan, which would false-positive
|
|
186
|
-
* on benign prose like "task-budgets" or "fo1_/sbp_/xox/Bearer patterns".
|
|
187
|
-
*/
|
|
188
|
-
export function detectSecrets(text, opts = {}) {
|
|
189
|
-
const hits = [];
|
|
190
|
-
for (const rule of rulesFor(opts)) {
|
|
191
|
-
// Fresh regex so lastIndex state never leaks between calls.
|
|
192
|
-
const re = new RegExp(rule.re.source, rule.re.flags);
|
|
193
|
-
let m;
|
|
194
|
-
while ((m = re.exec(text)) !== null) {
|
|
195
|
-
// The ENV-SECRET rule legitimately leaves a "NAME=[REDACTED-...]" shell;
|
|
196
|
-
// that is NOT a surviving secret, so ignore matches whose value is already redacted.
|
|
197
|
-
if (m[0].includes('[REDACTED')) {
|
|
198
|
-
if (m.index === re.lastIndex)
|
|
199
|
-
re.lastIndex++;
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
hits.push({ kind: rule.kind, match: m[0] });
|
|
203
|
-
if (m.index === re.lastIndex)
|
|
204
|
-
re.lastIndex++;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return hits;
|
|
208
|
-
}
|
|
38
|
+
import { redactSecrets } from './secret-rules.js';
|
|
39
|
+
// Secret redaction lives in ./secret-rules.ts (no node imports, so the frontend's
|
|
40
|
+
// parity test can load it); re-exported here for existing callers.
|
|
41
|
+
export { redactSecrets, detectSecrets } from './secret-rules.js';
|
|
209
42
|
// ============================================================================
|
|
210
43
|
// VERIFIED STRIP / UNWRAP RULESET (source-independent, pure)
|
|
211
44
|
// Grounded in real analysis of session c97588f4. Anchors confirmed against
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* gate_send_anyway, stop_dispatch, join_meeting, leave_meeting,
|
|
21
21
|
* mute_participant, start_ide, stop_ide, spawn_background_session,
|
|
22
22
|
* dispatch_background, stop_background_session, list_slots, list_processes,
|
|
23
|
-
* favorite_changed
|
|
23
|
+
* favorite_changed, set_approval_mode
|
|
24
24
|
* Open (read-only, listed in READ_ONLY_MESSAGE_TYPES):
|
|
25
25
|
* get_current_session, get_session_artifacts, get_plan_file,
|
|
26
26
|
* get_research_artifact, get_mcp_status, get_skills, skill_get, get_busy
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
* become the controller. With no owner configured (single-tenant / local
|
|
35
35
|
* mode) the newest joiner becomes the controller, as before.
|
|
36
36
|
*/
|
|
37
|
+
import type { PermissionAnswer } from './approval-policy.js';
|
|
37
38
|
/**
|
|
38
39
|
* Known gated types. Informational and for tests: the gate itself is "not
|
|
39
40
|
* read-only", so types missing from this list are still gated.
|
|
@@ -41,6 +42,13 @@
|
|
|
41
42
|
export declare const CONTROL_MESSAGE_TYPES: ReadonlySet<string>;
|
|
42
43
|
/** Read-only queries any participant may send. Everything else is gated. */
|
|
43
44
|
export declare const READ_ONLY_MESSAGE_TYPES: ReadonlySet<string>;
|
|
45
|
+
/**
|
|
46
|
+
* App commands a phone caller's voice actions (#367) may run through
|
|
47
|
+
* dispatchAction (index.ts): the same code the app's buttons use. Anything
|
|
48
|
+
* else is refused there. There is deliberately no HTTP route to these: the
|
|
49
|
+
* agent's own tools must never be able to loosen or answer its approvals.
|
|
50
|
+
*/
|
|
51
|
+
export declare const PHONE_ACTION_TYPES: ReadonlySet<string>;
|
|
44
52
|
/** Identity prefix /api/token gives every user participant. */
|
|
45
53
|
export declare const USER_IDENTITY_PREFIX = "user-";
|
|
46
54
|
/**
|
|
@@ -63,8 +71,11 @@ export declare function checkControlSender(type: string, senderIdentity: string
|
|
|
63
71
|
export declare function canBecomeController(participantUserId: string | undefined | null, ownerUserId: string | undefined | null): boolean;
|
|
64
72
|
/** A room name POST /connect-room may join for a phone call. */
|
|
65
73
|
export declare function isPhoneRoomName(name: unknown): name is string;
|
|
66
|
-
/**
|
|
67
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Keypad answer to a pending approval on a phone call (#363): 1 allows, 2
|
|
76
|
+
* denies, 3 always allows (the browser's "Always"); anything else is ignored.
|
|
77
|
+
*/
|
|
78
|
+
export declare function keypadAnswer(digit: string | undefined | null): PermissionAnswer | null;
|
|
68
79
|
/**
|
|
69
80
|
* Keypad approvals on a phone call. Off: caller ID alone is not proof enough
|
|
70
81
|
* to approve a tool, so every permission raised while a phone caller holds the
|
|
@@ -80,8 +91,28 @@ export declare const PHONE_KEYPAD_APPROVALS_ENABLED = false;
|
|
|
80
91
|
* the caller.
|
|
81
92
|
*/
|
|
82
93
|
export declare const PHONE_TOOLS_ENABLED = false;
|
|
94
|
+
/**
|
|
95
|
+
* Emailed code on a phone call (#362). On: a caller is not adopted (no voice
|
|
96
|
+
* session, no voice actions, no tools) until they type the 6-digit code the
|
|
97
|
+
* frontend emails to the account (phone-code.ts). Off: caller ID alone admits
|
|
98
|
+
* the call, as before. /connect-room tells the frontend to send the code.
|
|
99
|
+
*/
|
|
100
|
+
export declare const PHONE_EMAIL_CODE_ENABLED = false;
|
|
83
101
|
/** What happens to a permission raised during a phone call: denied unless keypad approvals are on. */
|
|
84
102
|
export declare function phonePermissionPolicy(inPhoneCall: boolean, approvalsEnabled?: boolean): 'deny' | 'ask';
|
|
103
|
+
/**
|
|
104
|
+
* How a permission request is handled when its brain belongs to a phone call:
|
|
105
|
+
* the live call, or a brain parked after "keep working" on a call that no
|
|
106
|
+
* browser or app session has re-attached yet.
|
|
107
|
+
* - 'deny': keypad approvals off (phonePermissionPolicy) — denied at once.
|
|
108
|
+
* - 'hold': parked from a call — left pending for a person; never answered by
|
|
109
|
+
* the saved approval mode or the call's always-allow list.
|
|
110
|
+
* - 'normal': anything else (the live call with keypad approvals on, or no call).
|
|
111
|
+
*/
|
|
112
|
+
export declare function phoneRequestRoute(s: {
|
|
113
|
+
liveCall: boolean;
|
|
114
|
+
parkedFromCall: boolean;
|
|
115
|
+
}, approvalsEnabled?: boolean): 'deny' | 'hold' | 'normal';
|
|
85
116
|
/** What happens to any tool call during a phone call: denied unless phone tools are on. */
|
|
86
117
|
export declare function phoneToolPolicy(inPhoneCall: boolean, toolsEnabled?: boolean): 'deny' | 'allow';
|
|
87
118
|
/**
|
|
@@ -105,16 +136,22 @@ export declare function planConnectRoom(s: {
|
|
|
105
136
|
phoneCallLive: boolean;
|
|
106
137
|
phoneRoom?: string;
|
|
107
138
|
}): 'fresh' | 'reuse' | 'busy';
|
|
139
|
+
/**
|
|
140
|
+
* May a phone caller give this answer (keypad or a spoken yes/no, #367)? A
|
|
141
|
+
* deny always; an allow only once keypad approvals are on.
|
|
142
|
+
*/
|
|
143
|
+
export declare function phoneAnswerAllowed(answer: PermissionAnswer, approvalsEnabled?: boolean): boolean;
|
|
108
144
|
/**
|
|
109
145
|
* Handles one keypad press (index.ts DtmfReceived). Only the SIP caller in an
|
|
110
|
-
* authorised phone room counts; with approvals off a 1 settles nothing
|
|
111
|
-
* still denies).
|
|
146
|
+
* authorised phone room counts; with approvals off a 1 or 3 settles nothing
|
|
147
|
+
* (a 2 still denies). The answer goes to the same settle path the browser
|
|
148
|
+
* and watch use; the model never decides it. Returns what was done.
|
|
112
149
|
*/
|
|
113
150
|
export declare function handlePhoneKeypad(press: {
|
|
114
151
|
sip: boolean;
|
|
115
152
|
inPhoneRoom: boolean;
|
|
116
153
|
digit: string | undefined | null;
|
|
117
|
-
}, settle: (
|
|
154
|
+
}, settle: (answer: PermissionAnswer) => boolean, approvalsEnabled?: boolean): 'ignored' | 'approved' | 'always allowed' | 'denied' | 'no pending permission';
|
|
118
155
|
/** Most bytes POST /connect-room reads; its body is only `{ roomName }`. */
|
|
119
156
|
export declare const CONNECT_ROOM_MAX_BODY = 4096;
|
|
120
157
|
/**
|
package/dist/data-sender-auth.js
CHANGED
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* data-sender-auth.ts — who may send data-channel commands, and who may become
|
|
3
|
-
* the controller.
|
|
4
|
-
*
|
|
5
|
-
* Every message on topic 'user-input' is handled by handleDataReceived in
|
|
6
|
-
* index.ts. All of them EXCEPT the read-only queries in READ_ONLY_MESSAGE_TYPES
|
|
7
|
-
* must come from the controlling user participant: the `user-*` identity
|
|
8
|
-
* minted by the frontend /api/token (auth-gated, checks room ownership) that
|
|
9
|
-
* the agent adopted as its voice user. Canvas, bots and other identities are
|
|
10
|
-
* dropped. The gate FAILS CLOSED: a type that is not on the read-only list
|
|
11
|
-
* (including any new type added to index.ts later) requires the controller.
|
|
12
|
-
*
|
|
13
|
-
* Full set of types handleDataReceived handles (2026-11-07):
|
|
14
|
-
* Gated (state-changing or leaks session/process ids):
|
|
15
|
-
* user_text, claude_auth_code, permission_response, list_sessions,
|
|
16
|
-
* resume_session, continue_session, switch_session, session_selected,
|
|
17
|
-
* cancel_session_switch,
|
|
18
|
-
* mcp_toggle, set_agents, skill_add, skill_fork, skill_remove,
|
|
19
|
-
* get_agent_prompt, noise_cancel,
|
|
20
|
-
* gate_send_anyway, stop_dispatch, join_meeting, leave_meeting,
|
|
21
|
-
* mute_participant, start_ide, stop_ide, spawn_background_session,
|
|
22
|
-
* dispatch_background, stop_background_session, list_slots, list_processes,
|
|
23
|
-
* favorite_changed
|
|
24
|
-
* Open (read-only, listed in READ_ONLY_MESSAGE_TYPES):
|
|
25
|
-
* get_current_session, get_session_artifacts, get_plan_file,
|
|
26
|
-
* get_research_artifact, get_mcp_status, get_skills, skill_get, get_busy
|
|
27
|
-
* list_sessions / list_slots / list_processes are read-only but return session
|
|
28
|
-
* and process ids that the gated commands (dispatch_background etc.) take as
|
|
29
|
-
* targets, so they are gated too.
|
|
30
|
-
*
|
|
31
|
-
* Controller binding (canBecomeController): when the machine has an owner
|
|
32
|
-
* (OSBORN_OWNER_USER_ID, baked into machine env by the frontend provisioning),
|
|
33
|
-
* only a participant whose SIGNED token metadata userId equals the owner can
|
|
34
|
-
* become the controller. With no owner configured (single-tenant / local
|
|
35
|
-
* mode) the newest joiner becomes the controller, as before.
|
|
36
|
-
*/
|
|
37
1
|
/**
|
|
38
2
|
* Known gated types. Informational and for tests: the gate itself is "not
|
|
39
3
|
* read-only", so types missing from this list are still gated.
|
|
@@ -74,6 +38,8 @@ export const CONTROL_MESSAGE_TYPES = new Set([
|
|
|
74
38
|
'list_processes',
|
|
75
39
|
// Feeds hidden context into the next turn (UI#21), so controller-only.
|
|
76
40
|
'favorite_changed',
|
|
41
|
+
// Changes which tool requests are approved without asking (#364).
|
|
42
|
+
'set_approval_mode',
|
|
77
43
|
]);
|
|
78
44
|
/** Read-only queries any participant may send. Everything else is gated. */
|
|
79
45
|
export const READ_ONLY_MESSAGE_TYPES = new Set([
|
|
@@ -87,6 +53,22 @@ export const READ_ONLY_MESSAGE_TYPES = new Set([
|
|
|
87
53
|
// End asks whether the agent is mid-task before offering keep-working.
|
|
88
54
|
'get_busy',
|
|
89
55
|
]);
|
|
56
|
+
/**
|
|
57
|
+
* App commands a phone caller's voice actions (#367) may run through
|
|
58
|
+
* dispatchAction (index.ts): the same code the app's buttons use. Anything
|
|
59
|
+
* else is refused there. There is deliberately no HTTP route to these: the
|
|
60
|
+
* agent's own tools must never be able to loosen or answer its approvals.
|
|
61
|
+
*/
|
|
62
|
+
export const PHONE_ACTION_TYPES = new Set([
|
|
63
|
+
'permission_response',
|
|
64
|
+
'set_approval_mode',
|
|
65
|
+
'get_busy',
|
|
66
|
+
'stop_dispatch',
|
|
67
|
+
'list_sessions',
|
|
68
|
+
'switch_session',
|
|
69
|
+
'get_session_artifacts',
|
|
70
|
+
'keep_working',
|
|
71
|
+
]);
|
|
90
72
|
/** Identity prefix /api/token gives every user participant. */
|
|
91
73
|
export const USER_IDENTITY_PREFIX = 'user-';
|
|
92
74
|
/**
|
|
@@ -136,12 +118,17 @@ export function isPhoneRoomName(name) {
|
|
|
136
118
|
&& name.startsWith(PHONE_ROOM_PREFIX)
|
|
137
119
|
&& /^[A-Za-z0-9_+\-]+$/.test(name);
|
|
138
120
|
}
|
|
139
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Keypad answer to a pending approval on a phone call (#363): 1 allows, 2
|
|
123
|
+
* denies, 3 always allows (the browser's "Always"); anything else is ignored.
|
|
124
|
+
*/
|
|
140
125
|
export function keypadAnswer(digit) {
|
|
141
126
|
if (digit === '1')
|
|
142
|
-
return
|
|
127
|
+
return 'allow';
|
|
143
128
|
if (digit === '2')
|
|
144
|
-
return
|
|
129
|
+
return 'deny';
|
|
130
|
+
if (digit === '3')
|
|
131
|
+
return 'always_allow';
|
|
145
132
|
return null;
|
|
146
133
|
}
|
|
147
134
|
/**
|
|
@@ -159,10 +146,31 @@ export const PHONE_KEYPAD_APPROVALS_ENABLED = false;
|
|
|
159
146
|
* the caller.
|
|
160
147
|
*/
|
|
161
148
|
export const PHONE_TOOLS_ENABLED = false;
|
|
149
|
+
/**
|
|
150
|
+
* Emailed code on a phone call (#362). On: a caller is not adopted (no voice
|
|
151
|
+
* session, no voice actions, no tools) until they type the 6-digit code the
|
|
152
|
+
* frontend emails to the account (phone-code.ts). Off: caller ID alone admits
|
|
153
|
+
* the call, as before. /connect-room tells the frontend to send the code.
|
|
154
|
+
*/
|
|
155
|
+
export const PHONE_EMAIL_CODE_ENABLED = false;
|
|
162
156
|
/** What happens to a permission raised during a phone call: denied unless keypad approvals are on. */
|
|
163
157
|
export function phonePermissionPolicy(inPhoneCall, approvalsEnabled = PHONE_KEYPAD_APPROVALS_ENABLED) {
|
|
164
158
|
return inPhoneCall && !approvalsEnabled ? 'deny' : 'ask';
|
|
165
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* How a permission request is handled when its brain belongs to a phone call:
|
|
162
|
+
* the live call, or a brain parked after "keep working" on a call that no
|
|
163
|
+
* browser or app session has re-attached yet.
|
|
164
|
+
* - 'deny': keypad approvals off (phonePermissionPolicy) — denied at once.
|
|
165
|
+
* - 'hold': parked from a call — left pending for a person; never answered by
|
|
166
|
+
* the saved approval mode or the call's always-allow list.
|
|
167
|
+
* - 'normal': anything else (the live call with keypad approvals on, or no call).
|
|
168
|
+
*/
|
|
169
|
+
export function phoneRequestRoute(s, approvalsEnabled = PHONE_KEYPAD_APPROVALS_ENABLED) {
|
|
170
|
+
if (phonePermissionPolicy(s.liveCall || s.parkedFromCall, approvalsEnabled) === 'deny')
|
|
171
|
+
return 'deny';
|
|
172
|
+
return s.parkedFromCall && !s.liveCall ? 'hold' : 'normal';
|
|
173
|
+
}
|
|
166
174
|
/** What happens to any tool call during a phone call: denied unless phone tools are on. */
|
|
167
175
|
export function phoneToolPolicy(inPhoneCall, toolsEnabled = PHONE_TOOLS_ENABLED) {
|
|
168
176
|
return inPhoneCall && !toolsEnabled ? 'deny' : 'allow';
|
|
@@ -191,20 +199,28 @@ export function planConnectRoom(s) {
|
|
|
191
199
|
return s.activeRoomName === s.phoneRoom ? 'reuse' : 'busy';
|
|
192
200
|
return s.phoneCallLive ? 'busy' : 'reuse';
|
|
193
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* May a phone caller give this answer (keypad or a spoken yes/no, #367)? A
|
|
204
|
+
* deny always; an allow only once keypad approvals are on.
|
|
205
|
+
*/
|
|
206
|
+
export function phoneAnswerAllowed(answer, approvalsEnabled = PHONE_KEYPAD_APPROVALS_ENABLED) {
|
|
207
|
+
return answer === 'deny' || approvalsEnabled;
|
|
208
|
+
}
|
|
194
209
|
/**
|
|
195
210
|
* Handles one keypad press (index.ts DtmfReceived). Only the SIP caller in an
|
|
196
|
-
* authorised phone room counts; with approvals off a 1 settles nothing
|
|
197
|
-
* still denies).
|
|
211
|
+
* authorised phone room counts; with approvals off a 1 or 3 settles nothing
|
|
212
|
+
* (a 2 still denies). The answer goes to the same settle path the browser
|
|
213
|
+
* and watch use; the model never decides it. Returns what was done.
|
|
198
214
|
*/
|
|
199
215
|
export function handlePhoneKeypad(press, settle, approvalsEnabled = PHONE_KEYPAD_APPROVALS_ENABLED) {
|
|
200
216
|
if (!press.sip || !press.inPhoneRoom)
|
|
201
217
|
return 'ignored';
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
218
|
+
const answer = keypadAnswer(press.digit);
|
|
219
|
+
if (answer === null || !phoneAnswerAllowed(answer, approvalsEnabled))
|
|
204
220
|
return 'ignored';
|
|
205
|
-
if (!settle(
|
|
221
|
+
if (!settle(answer))
|
|
206
222
|
return 'no pending permission';
|
|
207
|
-
return allow ? 'approved' : 'denied';
|
|
223
|
+
return answer === 'allow' ? 'approved' : answer === 'always_allow' ? 'always allowed' : 'denied';
|
|
208
224
|
}
|
|
209
225
|
/** Most bytes POST /connect-room reads; its body is only `{ roomName }`. */
|
|
210
226
|
export const CONNECT_ROOM_MAX_BODY = 4096;
|
package/dist/env-keys.d.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Keep in sync with frontend/src/lib/platform-env.ts (PLATFORM_ENV_SPEC).
|
|
14
14
|
*/
|
|
15
|
+
import type { STTProvider, TTSProvider } from './config.js';
|
|
15
16
|
export interface AgentEnvKey {
|
|
16
17
|
key: string;
|
|
17
18
|
required: boolean;
|
|
@@ -23,8 +24,15 @@ export interface AgentEnvKey {
|
|
|
23
24
|
export declare const AGENT_ENV_KEYS: AgentEnvKey[];
|
|
24
25
|
/** Keys the agent treats as required — absence should be surfaced at startup. */
|
|
25
26
|
export declare const REQUIRED_AGENT_ENV_KEYS: string[];
|
|
26
|
-
/**
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Return the required keys that are missing from the given env (default process.env).
|
|
29
|
+
* With `voice` (the resolved getDirectConfig providers), the STT/TTS key follows the providers in
|
|
30
|
+
* use instead of the Soniox default, so an OSBORN_STT_PROVIDER=deepgram machine asks for Deepgram.
|
|
31
|
+
*/
|
|
32
|
+
export declare function missingRequiredEnv(env?: NodeJS.ProcessEnv, voice?: {
|
|
33
|
+
stt: STTProvider;
|
|
34
|
+
tts: TTSProvider;
|
|
35
|
+
}): string[];
|
|
28
36
|
/**
|
|
29
37
|
* Keys a user may add/rotate live (mid-session, no reboot) via the /secrets
|
|
30
38
|
* endpoint. These are read by osborn's OWN code (not baked into a plugin SDK at
|
package/dist/env-keys.js
CHANGED
|
@@ -18,8 +18,8 @@ export const AGENT_ENV_KEYS = [
|
|
|
18
18
|
{ key: 'LIVEKIT_API_KEY', required: true, explicit: true, description: 'LiveKit API key.' },
|
|
19
19
|
{ key: 'LIVEKIT_API_SECRET', required: true, explicit: true, description: 'LiveKit API secret.' },
|
|
20
20
|
// STT / inference (plugin-consumed unless noted)
|
|
21
|
-
{ key: '
|
|
22
|
-
{ key: '
|
|
21
|
+
{ key: 'SONIOX_API_KEY', required: true, explicit: false, description: 'Soniox STT and TTS, the default voice pipeline (config.ts DEFAULT_CONFIG; LiveKit plugin) and meeting TTS.' },
|
|
22
|
+
{ key: 'DEEPGRAM_API_KEY', required: false, explicit: false, description: 'Deepgram STT/TTS (LiveKit plugin); needed only when OSBORN_STT_PROVIDER or OSBORN_TTS_PROVIDER selects deepgram.' },
|
|
23
23
|
{ key: 'GROQ_API_KEY', required: false, explicit: true, description: 'Groq fast-brain inference.' },
|
|
24
24
|
{ key: 'FIREWORKS_API_KEY', required: false, explicit: true, description: 'Fireworks AI — fast-brain inference + embeddings (preferred over OpenRouter when set).' },
|
|
25
25
|
{ key: 'OPENAI_API_KEY', required: true, explicit: true, description: 'OpenAI realtime + pipeline.' },
|
|
@@ -54,9 +54,30 @@ export const AGENT_ENV_KEYS = [
|
|
|
54
54
|
export const REQUIRED_AGENT_ENV_KEYS = AGENT_ENV_KEYS
|
|
55
55
|
.filter((k) => k.required)
|
|
56
56
|
.map((k) => k.key);
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
/** The key each voice provider (voice-io.ts) reads, for providers this manifest lists. */
|
|
58
|
+
const VOICE_PROVIDER_KEYS = {
|
|
59
|
+
'soniox': 'SONIOX_API_KEY',
|
|
60
|
+
'deepgram': 'DEEPGRAM_API_KEY',
|
|
61
|
+
'deepgram-flux': 'DEEPGRAM_API_KEY',
|
|
62
|
+
'groq-whisper': 'GROQ_API_KEY',
|
|
63
|
+
'groq-orpheus': 'GROQ_API_KEY',
|
|
64
|
+
'openai': 'OPENAI_API_KEY',
|
|
65
|
+
'openai-whisper': 'OPENAI_API_KEY',
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Return the required keys that are missing from the given env (default process.env).
|
|
69
|
+
* With `voice` (the resolved getDirectConfig providers), the STT/TTS key follows the providers in
|
|
70
|
+
* use instead of the Soniox default, so an OSBORN_STT_PROVIDER=deepgram machine asks for Deepgram.
|
|
71
|
+
*/
|
|
72
|
+
export function missingRequiredEnv(env = process.env, voice) {
|
|
73
|
+
const keys = new Set(REQUIRED_AGENT_ENV_KEYS);
|
|
74
|
+
if (voice) {
|
|
75
|
+
keys.delete('SONIOX_API_KEY');
|
|
76
|
+
for (const p of [voice.stt, voice.tts])
|
|
77
|
+
if (VOICE_PROVIDER_KEYS[p])
|
|
78
|
+
keys.add(VOICE_PROVIDER_KEYS[p]);
|
|
79
|
+
}
|
|
80
|
+
return [...keys].filter((k) => !env[k]);
|
|
60
81
|
}
|
|
61
82
|
/**
|
|
62
83
|
* Keys a user may add/rotate live (mid-session, no reboot) via the /secrets
|