switchroom 0.15.35 → 0.15.37
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/dist/agent-scheduler/index.js +81 -80
- package/dist/auth-broker/index.js +80 -80
- package/dist/cli/drive-write-pretool.mjs +10 -10
- package/dist/cli/notion-write-pretool.mjs +82 -82
- package/dist/cli/skill-validate-pretool.mjs +72 -72
- package/dist/cli/switchroom.js +721 -689
- package/dist/host-control/main.js +148 -148
- package/dist/vault/approvals/kernel-server.js +82 -82
- package/dist/vault/broker/server.js +83 -83
- package/package.json +1 -1
- package/profiles/_shared/agent-self-service.md.hbs +25 -0
- package/telegram-plugin/bridge/bridge.ts +32 -0
- package/telegram-plugin/dist/bridge/bridge.js +143 -112
- package/telegram-plugin/dist/gateway/gateway.js +813 -378
- package/telegram-plugin/dist/server.js +191 -160
- package/telegram-plugin/gateway/gateway.ts +121 -3
- package/telegram-plugin/gateway/linear-activity.ts +56 -0
- package/telegram-plugin/gateway/linear-auth-watch.ts +102 -0
- package/telegram-plugin/gateway/linear-setup.ts +196 -0
- package/telegram-plugin/tests/linear-agent-activity.test.ts +77 -0
- package/telegram-plugin/tests/linear-agent-setup.test.ts +132 -0
- package/telegram-plugin/tests/linear-auth-watch.test.ts +79 -0
- package/telegram-plugin/tests/linear-create-issue.test.ts +3 -1
package/package.json
CHANGED
|
@@ -168,6 +168,31 @@ When you get such a reaction turn:
|
|
|
168
168
|
|
|
169
169
|
Don't acknowledge with only a reaction or a bare "done" — the operator wants
|
|
170
170
|
the link (or the honest reason it didn't file).
|
|
171
|
+
|
|
172
|
+
### If your Linear auth breaks (a 401 / "can't reach Linear")
|
|
173
|
+
|
|
174
|
+
Linear `actor=app` access tokens expire (~24h) and renew from a stored
|
|
175
|
+
**refresh bundle** (`linear/<you>/oauth`). If that bundle is missing or its
|
|
176
|
+
refresh token was revoked, your Linear calls 401 and the operator gets a
|
|
177
|
+
"🔑 Linear auth needs you" alert. You can re-authorize yourself — it's an
|
|
178
|
+
operator-approved, in-container flow (no host shell needed):
|
|
179
|
+
|
|
180
|
+
1. Ask the operator for the Linear **OAuth app client_id + redirect_uri** (and
|
|
181
|
+
they'll have the client_secret ready for step 3).
|
|
182
|
+
2. Call **`linear_agent_setup`** with `action: "authorize_url"`, the
|
|
183
|
+
`client_id`, and `redirect_uri`. Relay the returned URL — the operator opens
|
|
184
|
+
it, consents, and copies the `code=` value from the redirect.
|
|
185
|
+
3. Call **`linear_agent_setup`** with `action: "complete"` + `client_id`,
|
|
186
|
+
`client_secret`, `redirect_uri`, and that `code`. It exchanges the code and
|
|
187
|
+
stores the access token + refresh bundle via the vault broker.
|
|
188
|
+
- If it returns **vault_request_access** instructions, the keys need a
|
|
189
|
+
write-grant — make those calls, the operator approves, then re-run
|
|
190
|
+
`complete` (re-open the authorize URL first if the code went stale).
|
|
191
|
+
- If it returns **config_propose_edit** guidance (durability/ACL), propose
|
|
192
|
+
that edit so the change survives restarts and auto-refresh keeps working.
|
|
193
|
+
|
|
194
|
+
The client_secret and code are used only for the exchange — never store them in
|
|
195
|
+
config or paste them into a normal message; pass them straight to the tool.
|
|
171
196
|
{{/if}}
|
|
172
197
|
|
|
173
198
|
### Don't lie about scheduling
|
|
@@ -510,6 +510,38 @@ const TOOL_SCHEMAS = [
|
|
|
510
510
|
required: ['title', 'body'],
|
|
511
511
|
},
|
|
512
512
|
},
|
|
513
|
+
{
|
|
514
|
+
name: 'linear_agent_setup',
|
|
515
|
+
description:
|
|
516
|
+
'Provision THIS agent as a Linear app actor (actor=app OAuth) from inside the container — the operator-approved in-container path that replaces the host-only `switchroom linear-agent setup` (which silently no-ops in a sandbox). Two steps. action="authorize_url": pass the OAuth app client_id + redirect_uri; returns the browser URL the operator opens to consent. action="complete": pass client_id, client_secret, redirect_uri, and the code from the redirect; exchanges it and stores the access token (linear/<agent>/token) + the durable refresh bundle (linear/<agent>/oauth) via the vault broker so the token auto-renews. Writing those NEW keys needs a write-grant — if the broker denies, the tool returns the exact vault_request_access calls to make (operator approves), then re-run "complete". After it stores the values, follow the returned guidance to config_propose_edit the linear_agent block + secrets[] ACL (also operator-approved) to make it durable. The client_secret and code are used in-process only — never stored in config or logged.',
|
|
517
|
+
inputSchema: {
|
|
518
|
+
type: 'object',
|
|
519
|
+
properties: {
|
|
520
|
+
action: {
|
|
521
|
+
type: 'string',
|
|
522
|
+
enum: ['authorize_url', 'complete'],
|
|
523
|
+
description: '"authorize_url" to get the browser consent URL; "complete" to exchange the code and store the credentials.',
|
|
524
|
+
},
|
|
525
|
+
client_id: {
|
|
526
|
+
type: 'string',
|
|
527
|
+
description: 'Linear OAuth app client id (from Linear → Settings → API → your agent app).',
|
|
528
|
+
},
|
|
529
|
+
redirect_uri: {
|
|
530
|
+
type: 'string',
|
|
531
|
+
description: 'The redirect URI registered on the Linear OAuth app (e.g. http://localhost:3000/callback). Must match exactly in both steps.',
|
|
532
|
+
},
|
|
533
|
+
client_secret: {
|
|
534
|
+
type: 'string',
|
|
535
|
+
description: 'Linear OAuth app client secret. Required for action="complete"; used in-process for the token exchange, never stored or logged.',
|
|
536
|
+
},
|
|
537
|
+
code: {
|
|
538
|
+
type: 'string',
|
|
539
|
+
description: 'The authorization code from the redirect URL (the `code=` query param). Required for action="complete"; single-use.',
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
required: ['action', 'client_id', 'redirect_uri'],
|
|
543
|
+
},
|
|
544
|
+
},
|
|
513
545
|
]
|
|
514
546
|
|
|
515
547
|
mcp.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOL_SCHEMAS }))
|