@synap-core/cli 1.13.0 → 1.13.1-next.20261102.3a66eb1
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/README.md +13 -3
- package/dist/build-info.json +2 -3
- package/dist/commands/agents.js +12 -2
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/capability.d.ts +86 -0
- package/dist/commands/capability.js +117 -30
- package/dist/commands/capability.js.map +1 -1
- package/dist/commands/context.js +2 -1
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/data-extra.d.ts +13 -0
- package/dist/commands/data-extra.js +23 -2
- package/dist/commands/data-extra.js.map +1 -1
- package/dist/commands/doctor.d.ts +18 -0
- package/dist/commands/doctor.js +28 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.js +4 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/keys-request.d.ts +48 -0
- package/dist/commands/keys-request.js +236 -0
- package/dist/commands/keys-request.js.map +1 -0
- package/dist/commands/keys-request.test.d.ts +1 -0
- package/dist/commands/keys-request.test.js +176 -0
- package/dist/commands/keys-request.test.js.map +1 -0
- package/dist/commands/knowledge.d.ts +42 -5
- package/dist/commands/knowledge.js +90 -27
- package/dist/commands/knowledge.js.map +1 -1
- package/dist/commands/market.d.ts +89 -31
- package/dist/commands/market.js +215 -222
- package/dist/commands/market.js.map +1 -1
- package/dist/commands/mcp.d.ts +1 -1
- package/dist/commands/mcp.js +14 -9
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/pods.js +6 -2
- package/dist/commands/pods.js.map +1 -1
- package/dist/commands/proposals-actions.js +7 -1
- package/dist/commands/proposals-actions.js.map +1 -1
- package/dist/commands/providers.d.ts +22 -6
- package/dist/commands/providers.js +39 -32
- package/dist/commands/providers.js.map +1 -1
- package/dist/commands/raycast.d.ts +15 -0
- package/dist/commands/raycast.js +36 -10
- package/dist/commands/raycast.js.map +1 -1
- package/dist/commands/status.js +12 -6
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/statusline.backoff.test.js +13 -3
- package/dist/commands/statusline.backoff.test.js.map +1 -1
- package/dist/commands/statusline.d.ts +104 -9
- package/dist/commands/statusline.js +392 -148
- package/dist/commands/statusline.js.map +1 -1
- package/dist/commands/statusline.line2.test.d.ts +15 -0
- package/dist/commands/statusline.line2.test.js +226 -0
- package/dist/commands/statusline.line2.test.js.map +1 -0
- package/dist/commands/statusline.needs-you.test.d.ts +1 -0
- package/dist/commands/statusline.needs-you.test.js +17 -0
- package/dist/commands/statusline.needs-you.test.js.map +1 -0
- package/dist/commands/statusline.now.test.d.ts +10 -0
- package/dist/commands/statusline.now.test.js +250 -0
- package/dist/commands/statusline.now.test.js.map +1 -0
- package/dist/commands/tracks.d.ts +1 -0
- package/dist/commands/tracks.js +4 -0
- package/dist/commands/tracks.js.map +1 -1
- package/dist/commands/upload.js +12 -0
- package/dist/commands/upload.js.map +1 -1
- package/dist/commands/wait.d.ts +124 -0
- package/dist/commands/wait.js +384 -0
- package/dist/commands/wait.js.map +1 -0
- package/dist/commands/wait.test.d.ts +8 -0
- package/dist/commands/wait.test.js +308 -0
- package/dist/commands/wait.test.js.map +1 -0
- package/dist/commands/worker-github-app.d.ts +63 -0
- package/dist/commands/worker-github-app.js +161 -0
- package/dist/commands/worker-github-app.js.map +1 -0
- package/dist/commands/worker-github-app.test.d.ts +1 -0
- package/dist/commands/worker-github-app.test.js +102 -0
- package/dist/commands/worker-github-app.test.js.map +1 -0
- package/dist/commands/worker-github-broker.d.ts +39 -0
- package/dist/commands/worker-github-broker.js +106 -0
- package/dist/commands/worker-github-broker.js.map +1 -0
- package/dist/commands/worker-github-broker.test.d.ts +1 -0
- package/dist/commands/worker-github-broker.test.js +90 -0
- package/dist/commands/worker-github-broker.test.js.map +1 -0
- package/dist/commands/worker-runs.test.d.ts +1 -0
- package/dist/commands/worker-runs.test.js +150 -0
- package/dist/commands/worker-runs.test.js.map +1 -0
- package/dist/commands/worker-worktrees.d.ts +34 -0
- package/dist/commands/worker-worktrees.js +87 -0
- package/dist/commands/worker-worktrees.js.map +1 -0
- package/dist/commands/worker.d.ts +207 -5
- package/dist/commands/worker.js +540 -46
- package/dist/commands/worker.js.map +1 -1
- package/dist/commands/worker.test.js +269 -3
- package/dist/commands/worker.test.js.map +1 -1
- package/dist/index.js +60 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/agents-config.d.ts +9 -0
- package/dist/lib/agents-config.js +20 -0
- package/dist/lib/agents-config.js.map +1 -1
- package/dist/lib/atomic-file.d.ts +20 -1
- package/dist/lib/atomic-file.js +100 -2
- package/dist/lib/atomic-file.js.map +1 -1
- package/dist/lib/auth.d.ts +25 -0
- package/dist/lib/auth.js +49 -9
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/box/job-server.js +4 -0
- package/dist/lib/box/job-server.js.map +1 -1
- package/dist/lib/bridge-invocation.test.d.ts +1 -0
- package/dist/lib/bridge-invocation.test.js +75 -0
- package/dist/lib/bridge-invocation.test.js.map +1 -0
- package/dist/lib/bridge-status.d.ts +144 -0
- package/dist/lib/bridge-status.js +227 -0
- package/dist/lib/bridge-status.js.map +1 -0
- package/dist/lib/bridge-status.test.d.ts +6 -0
- package/dist/lib/bridge-status.test.js +197 -0
- package/dist/lib/bridge-status.test.js.map +1 -0
- package/dist/lib/client-header.test.js +19 -1
- package/dist/lib/client-header.test.js.map +1 -1
- package/dist/lib/conversation-headers.d.ts +67 -2
- package/dist/lib/conversation-headers.js +122 -6
- package/dist/lib/conversation-headers.js.map +1 -1
- package/dist/lib/conversation-headers.test.d.ts +1 -0
- package/dist/lib/conversation-headers.test.js +78 -0
- package/dist/lib/conversation-headers.test.js.map +1 -0
- package/dist/lib/credential-class.d.ts +12 -1
- package/dist/lib/credential-class.js +20 -0
- package/dist/lib/credential-class.js.map +1 -1
- package/dist/lib/device-connect.d.ts +45 -0
- package/dist/lib/device-connect.js +60 -0
- package/dist/lib/device-connect.js.map +1 -1
- package/dist/lib/goal-words.js +6 -3
- package/dist/lib/goal-words.js.map +1 -1
- package/dist/lib/hub-client.d.ts +59 -1
- package/dist/lib/hub-client.js +130 -36
- package/dist/lib/hub-client.js.map +1 -1
- package/dist/lib/key-locations.d.ts +3 -3
- package/dist/lib/key-locations.js +3 -39
- package/dist/lib/key-locations.js.map +1 -1
- package/dist/lib/machine-instance.d.ts +7 -5
- package/dist/lib/machine-instance.js +7 -5
- package/dist/lib/machine-instance.js.map +1 -1
- package/dist/lib/mcp-bridge.d.ts +43 -0
- package/dist/lib/mcp-bridge.js +199 -11
- package/dist/lib/mcp-bridge.js.map +1 -1
- package/dist/lib/mcp-bridge.test.js +194 -2
- package/dist/lib/mcp-bridge.test.js.map +1 -1
- package/dist/lib/mcp-call.d.ts +5 -1
- package/dist/lib/mcp-call.js +7 -6
- package/dist/lib/mcp-call.js.map +1 -1
- package/dist/lib/mcp-connector-url.test.d.ts +1 -0
- package/dist/lib/mcp-connector-url.test.js +13 -0
- package/dist/lib/mcp-connector-url.test.js.map +1 -0
- package/dist/lib/mcp-snippets.d.ts +16 -0
- package/dist/lib/mcp-snippets.js +20 -2
- package/dist/lib/mcp-snippets.js.map +1 -1
- package/dist/lib/now-line.d.ts +66 -0
- package/dist/lib/now-line.js +193 -0
- package/dist/lib/now-line.js.map +1 -0
- package/dist/lib/now-line.test.d.ts +5 -0
- package/dist/lib/now-line.test.js +177 -0
- package/dist/lib/now-line.test.js.map +1 -0
- package/dist/lib/package-updates.d.ts +66 -0
- package/dist/lib/package-updates.js +76 -0
- package/dist/lib/package-updates.js.map +1 -0
- package/dist/lib/pod.d.ts +0 -4
- package/dist/lib/pod.js +0 -7
- package/dist/lib/pod.js.map +1 -1
- package/dist/lib/register-claude-code-mcp.test.js +19 -0
- package/dist/lib/register-claude-code-mcp.test.js.map +1 -1
- package/dist/lib/safe-open.d.ts +5 -3
- package/dist/lib/safe-open.js +9 -8
- package/dist/lib/safe-open.js.map +1 -1
- package/dist/lib/self-host.d.ts +17 -0
- package/dist/lib/self-host.js +24 -0
- package/dist/lib/self-host.js.map +1 -0
- package/dist/lib/targets.d.ts +31 -0
- package/dist/lib/targets.js +100 -104
- package/dist/lib/targets.js.map +1 -1
- package/dist/lib/template-lifecycle.d.ts +0 -31
- package/dist/lib/template-lifecycle.js +0 -74
- package/dist/lib/template-lifecycle.js.map +1 -1
- package/dist/lib/term.d.ts +24 -0
- package/dist/lib/term.js +52 -0
- package/dist/lib/term.js.map +1 -0
- package/dist/lib/term.test.d.ts +1 -0
- package/dist/lib/term.test.js +29 -0
- package/dist/lib/term.test.js.map +1 -0
- package/dist/lib/transcript-index.d.ts +94 -0
- package/dist/lib/transcript-index.js +321 -0
- package/dist/lib/transcript-index.js.map +1 -0
- package/dist/lib/transcript-index.test.d.ts +10 -0
- package/dist/lib/transcript-index.test.js +200 -0
- package/dist/lib/transcript-index.test.js.map +1 -0
- package/dist/lib/wait-help.d.ts +11 -0
- package/dist/lib/wait-help.js +25 -0
- package/dist/lib/wait-help.js.map +1 -0
- package/dist/lib/wait-state.d.ts +57 -0
- package/dist/lib/wait-state.js +114 -0
- package/dist/lib/wait-state.js.map +1 -0
- package/package.json +2 -2
- package/skills/synap/SKILL.md +81 -44
- package/skills/synap/code-skills.md +15 -1
- package/skills/synap/concepts.md +36 -26
- package/skills/synap/document-embeds.md +15 -1
- package/skills/synap/focus-sessions.md +4 -4
- package/skills/synap/from-intent.md +2 -2
- package/skills/synap/governance-rules.md +2 -0
- package/skills/synap/hand-off.md +10 -6
- package/skills/synap/reflexes.md +4 -4
- package/skills/synap/work-model.md +1 -1
- package/skills/synap/writing-titles.md +7 -0
- package/skills/synap-app/SKILL.md +2 -2
- package/skills/synap-app/overview.md +2 -2
- package/skills/synap-market/SKILL.md +1 -1
- package/skills/synap-market/governance-and-catalog.md +1 -1
- package/skills/synap-schema/SKILL.md +4 -1
- package/skills/synap-schema/intent-vocabulary-ssot.md +4 -1
- package/dist/commands/template.d.ts +0 -42
- package/dist/commands/template.js +0 -191
- package/dist/commands/template.js.map +0 -1
- package/dist/lib/browser-auth.d.ts +0 -35
- package/dist/lib/browser-auth.js +0 -170
- package/dist/lib/browser-auth.js.map +0 -1
- package/dist/lib/openclaw.d.ts +0 -32
- package/dist/lib/openclaw.js +0 -165
- package/dist/lib/openclaw.js.map +0 -1
- package/dist/lib/seed.d.ts +0 -13
- package/dist/lib/seed.js +0 -135
- package/dist/lib/seed.js.map +0 -1
package/skills/synap/hand-off.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
The person says "start this on my devbox", "have my Mac's Claude Code do it", "give this session to Codex". You find the agent, hand it the work through a session, follow the session's room, and report back. You never run their machine yourself: an agent they connected there (`synap worker`, Claude Code, Codex) picks the work up.
|
|
4
4
|
|
|
5
|
+
**Words.** A _runner_ is the process on a computer that works the sessions handed to one agent (`synap worker`). It is not a pod _worker_ (`synap_list_workers`, `synap_enable_worker`): that is a playbook's trigger turned on for a goal, which starts runs and runs nothing itself (`concepts`). Say "the agent on your Mac", never just "the worker".
|
|
6
|
+
|
|
7
|
+
**Where work runs.** Each computer takes the work it is for. A pod may hold its own skill naming which of the person's computers takes which work (load it when it exists); follow it over any guess. A runner started with `--protocols work-folder` takes playbook runs only: a code session handed to it is never launched, and it says so in the session's room.
|
|
8
|
+
|
|
5
9
|
**1. Find it — `synap_list_agents`.** One read: `computers[]` (the person's own) and `agents[]`, each with `computer`, `canTakeYourWork` (else `whyNot`), `live`, `paused`, `lastSeenAt`, and `handOff`: what YOUR hand-off would do right now (`direct`, `asks_you`, `blocked` + `handOffReason`). Ready agents come first.
|
|
6
10
|
|
|
7
11
|
- **Match the person's words against computer names first** ("my devbox" → the computer named `devbox`, any case), **then agent names and types** ("Codex", "claude-code"). Take the agents on that computer that can take the work.
|
|
@@ -9,6 +13,8 @@ The person says "start this on my devbox", "have my Mac's Claude Code do it", "g
|
|
|
9
13
|
- **None fits → say so.** "I see no agent on a computer called devbox" plus what you do see. Never hand it to a different machine silently.
|
|
10
14
|
- **`paused: true` → say it is paused** and that a person must resume it (Settings › Agents). Do not hand it off.
|
|
11
15
|
- **`live: false` → say when it was last seen** (`lastSeenAt`) and that it picks the work up the next time it checks in. Hand off only if the person still wants it.
|
|
16
|
+
- **Is a runner serving it? Read `servedAt` and `nobodyRuns`.** `nobodyRuns: false` (a recent `servedAt`): a runner serves it now. `nobodyRuns: true`: nothing on that computer runs it now; say so ("the agent on your Mac has not run since <servedAt>") and hand off only if the person wants the run to wait. `nobodyRuns: null`: the pod cannot tell (no runner ever stamped, or an old CLI); say "I cannot tell whether anything runs it; last seen <lastSeenAt>". `live` says only that its key was used.
|
|
17
|
+
- **No runner online → recommend waiting, never a second path.** The session shows who holds it (nobody, or the agent stopped) until a runner picks it up. Do not do the same job another way; if the computer must be awake, that is the person's step.
|
|
12
18
|
- **`canTakeYourWork: false`** — `whyNot` says why: `not_owned` (another person's agent: it would never see this work), `wrong_reach` (the pod's own agent: it answers in rooms, it never picks work up), `paused`.
|
|
13
19
|
|
|
14
20
|
**2. Hand it — through a session.** The session's roster is how work reaches an agent.
|
|
@@ -19,13 +25,11 @@ The person says "start this on my devbox", "have my Mac's Claude Code do it", "g
|
|
|
19
25
|
- **`asks_you` / `proposed`: the person approves the hand-off first.** Tell them plainly: "approve the hand-off on your phone", with the `reviewUrl` from the reply. It is success, do not retry. Then wait: `synap_get_session` until the agent is on its roster (or `synap_wait_for_answer` if you also asked them something), and go on to step 3.
|
|
20
26
|
- **`blocked` / `denied`: say why, in the reason's words.** Never retry it as is. One case the list cannot predict: your own proposal limit ("Agent proposal limit reached") — the reply carries a link to raise it; pass that to the person.
|
|
21
27
|
|
|
22
|
-
**3. Follow the room.** Everything the agent says lands in the session's room (`session.channelId`). Read it with `synap_get_thread_context { threadId: channelId }`; read the session's outcomes with `synap_get_session`. A `synap worker` on that computer follows
|
|
28
|
+
**3. Follow the room.** Everything the agent says lands in the session's room (`session.channelId`). Read it with `synap_get_thread_context { threadId: channelId }`; read the session's outcomes with `synap_get_session`. A `synap worker` on that computer checks for handed sessions about every 30 seconds (never one its own identity started), starts ONE run of Claude Code per session, and **claims** it in the room in one line. Which protocol the run follows depends on the session:
|
|
23
29
|
|
|
24
|
-
- It
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- It **asks** with a room message starting `QUESTION:`. Kind `update` = you, the orchestrating AI, can answer; kind `question` = a decision only the person can make (the person is notified). It waits up to 30 minutes, reading the room every minute, and takes the FIRST reply posted after its question. No reply: it states its assumption and continues, or stops and says what is blocked.
|
|
28
|
-
- It **reports** in the room (what changed, branch, commit, files) and records deliverables against the session's outcomes. It does not close the session; the owner does.
|
|
30
|
+
- **Code** — a session that runs no playbook, or one with a `repo`/`repos`/`branch` param or a `pull_request`/`branch`/`code` deliverable. It works on a branch (`devbox/<session>-<slug>`, in a git worktree), never pushes to main, never deploys, and may open a DRAFT pull request. It **asks** with a room message starting `QUESTION:`: kind `update` = you, the orchestrating AI, can answer; kind `question` = a decision only the person can make (the person is notified). It waits up to 30 minutes and takes the FIRST reply posted after its question; no reply: it states its assumption and continues, or stops and says what is blocked.
|
|
31
|
+
- **Work-folder** — a playbook run over pod data (a video edit, a CRM list, an interview). It works in a folder of its own (`<work root>/<session id>`), with no git; files every deliverable to the pod and records it on the session's outcomes. It **asks** through a human-owned slot with an ask (what the person sees in Needs you), never a `QUESTION:` line, and waits up to 30 minutes for the answer.
|
|
32
|
+
- Either way it **reports** in the room (what it made and where, the first thing to check) and records deliverables against the session's outcomes. It does not close the session; the owner does.
|
|
29
33
|
- **Any room message posted after its run ended, by anyone but the agent, wakes it again** in the same conversation (up to 20 times). That is how an answer reaches it after it stopped. So post in the room only what you want it to act on.
|
|
30
34
|
|
|
31
35
|
Answer a `QUESTION:` of kind `update` yourself with `synap_post_message` to the room. Leave kind `question` to the person, or ask them and relay their answer.
|
package/skills/synap/reflexes.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
The user's Synap pod: source of truth. Tool names below are stems; your door may prefix them (`pod__ask`).
|
|
6
6
|
|
|
7
|
-
1. **Recall first.**
|
|
8
|
-
2. **Capture
|
|
9
|
-
3. **Orient once.** `orient`: pending review
|
|
7
|
+
1. **Recall first.** `get_*` a known id, else `ask`.
|
|
8
|
+
2. **Capture as you go.** A decision, learning, pain (`finding`), win (`proof-point`), fact or task: `capture` it when it happens; about the user: `remember_fact`.
|
|
9
|
+
3. **Orient once.** `orient`: pending review, open sessions.
|
|
10
10
|
4. **Work in a session.** `start_session` or resume (playbook `templateId`); goal (TRACK): `list_tracks`, else `start_track`; work in it = `start_session` + `trackId`; 2-5 `criteria`; status moves carry `expectedStatus`; person-only: `owner:'human'` slot + `blockedReason` + `ask` (confirm/choose with 1 `recommended`/form/act/provide), then `wait_for_answer` if listed; post progress, questions and results in its room (`post_message` to `session.channelId`); your own chat may repeat them (`Q-<id8>`); chat answer → `relay_answer`, words verbatim; PR = outcome `pr-<repo>-<n>` (`ref.url`); `evaluate_session`, close open asks, `complete_session`.
|
|
11
11
|
5. **Never guess a project**: pin only what the user names (`set_*_focus`).
|
|
12
12
|
6. **`proposed` is success**: keep going, never retry.
|
|
13
|
-
7. **Discover before inventing**: `list_profiles` / `list_capabilities`; **extend
|
|
13
|
+
7. **Discover before inventing**: `list_profiles` / `list_capabilities`; **extend**, never a twin.
|
|
14
14
|
8. **One space per domain**; projects filter it (`file_into_project`, `project_use_workspace`).
|
|
15
15
|
|
|
16
16
|
Depth: `load_skill` `system/synap/concepts`, `work-model`, `focus-sessions`, `from-intent`, `escalation-ladder`, `writes`.
|
|
@@ -53,7 +53,7 @@ A worker is a playbook **activator**, declared on the method and owned by the li
|
|
|
53
53
|
|
|
54
54
|
### Goals (tracks)
|
|
55
55
|
|
|
56
|
-
A goal is a _track_ in every tool and field name (`start_track`, `trackId`) — say "goal" to the person; a session's one-line `goal` is its **Aim**. A goal holds an owner, a direction, instructions, the workers it turns on, and what done means (criteria, or a number measured as transitions into `done`). It has no stages. A goal can stay open as long as it matters, or finish: a person closes it with a verdict once its criteria are met (`set_track_status` `completed` + `verdict`; dropped = `archived`, with a `verdict` saying why). Your close is a proposal; a closed goal comes back only as a new version. Pause it while nobody should work on it. Work in it = `start_session` + `trackId`. A thing may count for two goals. Solo users may never need one: workers can run space-wide. Legacy: `start_stage_session` and `add_track_stage` serve old goals started from a method; never `advance_track` without the user.
|
|
56
|
+
A goal is a _track_ in every tool and field name (`start_track`, `trackId`) — say "goal" to the person; a session's one-line `goal` is its **Aim**. A goal holds an owner, a direction, instructions, the workers it turns on, and what done means (criteria, or a number measured as transitions into `done`). It has no stages. A goal can stay open as long as it matters, or finish: a person closes it with a verdict once its criteria are met (`set_track_status` `completed` + `verdict`; dropped = `archived`, with a `verdict` saying why; every move sends `expectedStatus`, the status you read). Your close is a proposal; a closed goal comes back only as a new version. Pause it while nobody should work on it. Work in it = `start_session` + `trackId`. A thing may count for two goals. Solo users may never need one: workers can run space-wide. Legacy: `start_stage_session` and `add_track_stage` serve old goals started from a method; never `advance_track` without the user.
|
|
57
57
|
|
|
58
58
|
**Keep the pod current (every agent, every session)** — three rules, so the next agent picks your step up from the pod alone:
|
|
59
59
|
|
|
@@ -61,3 +61,10 @@ claim cut off. Everything else goes elsewhere:
|
|
|
61
61
|
|
|
62
62
|
When unsure, ask: "will this still help someone in three months, and is it a
|
|
63
63
|
fact, a pitfall or a rule?" If not, it is not knowledge.
|
|
64
|
+
|
|
65
|
+
### Descriptions of projects, spaces and goals
|
|
66
|
+
|
|
67
|
+
A description says what the thing **is** and who it is for. A decision is
|
|
68
|
+
**linked, never restated**: a restated decision goes stale the day the decision
|
|
69
|
+
changes (the Synap project description repeated the 5 Oct branding split, which
|
|
70
|
+
a 13 Oct decision replaced). Link the `decision` entity; let it carry the rule.
|
|
@@ -65,8 +65,8 @@ Pin `@^1.0.0` on `sdk`/`react` so you never resolve an old, abandoned `0.x`.
|
|
|
65
65
|
needed, fetches the release bundle, checks it against the release manifest's
|
|
66
66
|
sha256 and runs `synap install`); see the backend's `deploy/README.md`. It
|
|
67
67
|
also checks the manifest's signature: by default
|
|
68
|
-
(`SYNAP_RELEASE_VERIFY=
|
|
69
|
-
|
|
68
|
+
(`SYNAP_RELEASE_VERIFY=enforce`) it refuses a release whose signature is
|
|
69
|
+
missing or does not verify; `SYNAP_RELEASE_VERIFY=warn` only warns.
|
|
70
70
|
- **Managed (paid):** sign up at synap.live and provision a pod.
|
|
71
71
|
|
|
72
72
|
You can develop the base app with **no pod at all** using its mock mode
|
|
@@ -42,8 +42,8 @@ Pin `@^1.0.0` on `sdk`/`react` so you never resolve an old, abandoned `0.x`.
|
|
|
42
42
|
needed, fetches the release bundle, checks it against the release manifest's
|
|
43
43
|
sha256 and runs `synap install`); see the backend's `deploy/README.md`. It
|
|
44
44
|
also checks the manifest's signature: by default
|
|
45
|
-
(`SYNAP_RELEASE_VERIFY=
|
|
46
|
-
|
|
45
|
+
(`SYNAP_RELEASE_VERIFY=enforce`) it refuses a release whose signature is
|
|
46
|
+
missing or does not verify; `SYNAP_RELEASE_VERIFY=warn` only warns.
|
|
47
47
|
- **Managed (paid):** sign up at synap.live and provision a pod.
|
|
48
48
|
|
|
49
49
|
You can develop the base app with **no pod at all** using its mock mode
|
|
@@ -622,4 +622,4 @@ wired at every install site). The browser UI is **display-only**: it threads
|
|
|
622
622
|
`requiredTier` through to a "requires <tier>" badge but does NOT hard-block, and
|
|
623
623
|
its lock/upgrade CTA only engages once a host wires a billing destination — so
|
|
624
624
|
don't add a UI-side gate expecting it to enforce anything, and don't rebuild the
|
|
625
|
-
badge thread (it exists). Full current-state:
|
|
625
|
+
badge thread (it exists). Full current-state: the catalog README (`synap-app/packages/workspace-templates/README.md`).
|
|
@@ -60,4 +60,4 @@ wired at every install site). The browser UI is **display-only**: it threads
|
|
|
60
60
|
`requiredTier` through to a "requires <tier>" badge but does NOT hard-block, and
|
|
61
61
|
its lock/upgrade CTA only engages once a host wires a billing destination — so
|
|
62
62
|
don't add a UI-side gate expecting it to enforce anything, and don't rebuild the
|
|
63
|
-
badge thread (it exists). Full current-state:
|
|
63
|
+
badge thread (it exists). Full current-state: the catalog README (`synap-app/packages/workspace-templates/README.md`).
|
|
@@ -404,7 +404,10 @@ a package that consumes nothing would go stale in the one direction that is invi
|
|
|
404
404
|
consumers typecheck against the built `dist/`, so a skipped rebuild makes your gate lie.
|
|
405
405
|
Post-seed rows today: `publish_post` (0284, write), `delegate_agent_task`
|
|
406
406
|
(0314, act — every verb of an external-agent binding, `tools.config.agentBinding`:
|
|
407
|
-
start / send / status / cancel)
|
|
407
|
+
start / send / status / cancel), `read_webpage` (0329, read), `search_web`
|
|
408
|
+
(0360, read) and `edit_video` (0370, act — sends the person's video to an
|
|
409
|
+
outside service; its one input, `{ video }`, is seeded on `input_schema` in
|
|
410
|
+
the same file).
|
|
408
411
|
3. **Add it to mirror 2** — the same two lists in the control plane's
|
|
409
412
|
`capability-intent-vocabulary.ts`.
|
|
410
413
|
4. **Update the arity floors** — `SEED_SLUG_ARITY` / `EXTRA_SLUG_ARITY` in
|
|
@@ -87,7 +87,10 @@ a package that consumes nothing would go stale in the one direction that is invi
|
|
|
87
87
|
consumers typecheck against the built `dist/`, so a skipped rebuild makes your gate lie.
|
|
88
88
|
Post-seed rows today: `publish_post` (0284, write), `delegate_agent_task`
|
|
89
89
|
(0314, act — every verb of an external-agent binding, `tools.config.agentBinding`:
|
|
90
|
-
start / send / status / cancel)
|
|
90
|
+
start / send / status / cancel), `read_webpage` (0329, read), `search_web`
|
|
91
|
+
(0360, read) and `edit_video` (0370, act — sends the person's video to an
|
|
92
|
+
outside service; its one input, `{ video }`, is seeded on `input_schema` in
|
|
93
|
+
the same file).
|
|
91
94
|
3. **Add it to mirror 2** — the same two lists in the control plane's
|
|
92
95
|
`capability-intent-vocabulary.ts`.
|
|
93
96
|
4. **Update the arity floors** — `SEED_SLUG_ARITY` / `EXTRA_SLUG_ARITY` in
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `synap template` — the "one request" template surface (TEMPLATE-ONE-PATH-PLAN §3-4).
|
|
3
|
-
* =====================================================================================
|
|
4
|
-
*
|
|
5
|
-
* The plan names ONE governed write door for adding/updating a workspace template:
|
|
6
|
-
* `synap template publish <file>` → CP `POST /api/packages` (validated server-side).
|
|
7
|
-
* No npm publish, no lockfile-bump, no redeploy. This file is that named surface.
|
|
8
|
-
*
|
|
9
|
-
* synap template publish <file> — validate + upsert to the CP (private by default; --public to share)
|
|
10
|
-
* synap template publish --from-workspace <id> — serialize a LIVE workspace, then publish
|
|
11
|
-
* synap template list — the caller-visible catalog (own private + public), slug/name/vis/version
|
|
12
|
-
* synap template get <slug> — one template's metadata + definition shape
|
|
13
|
-
*
|
|
14
|
-
* REUSE, no reinvention: publish delegates to the existing `marketPublish` (same
|
|
15
|
-
* validator, same CP transport). list/get read through `lib/cp-packages` — the ONE
|
|
16
|
-
* authed CP `/api/packages` client (Bearer from `lib/auth`'s stored login token).
|
|
17
|
-
* No `fetch` is hand-rolled here.
|
|
18
|
-
*
|
|
19
|
-
* NOTE (for the orchestrator): this overlaps `synap market publish/validate/
|
|
20
|
-
* unpublish`, which already ship the same authoring loop. `synap template` is the
|
|
21
|
-
* plan-canonical name; picking one and retiring/aliasing the other is a §4 Wave 2
|
|
22
|
-
* cleanup decision, not made here.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* `synap template publish <file>` — the plan's "one request". A thin alias over
|
|
26
|
-
* the existing `marketPublish` so there is exactly ONE publish implementation
|
|
27
|
-
* (same validator, same CP write door, same `--public`/`--from-workspace`/`--json`).
|
|
28
|
-
*/
|
|
29
|
-
export declare function templatePublish(file: string | undefined, opts: {
|
|
30
|
-
public?: boolean;
|
|
31
|
-
private?: boolean;
|
|
32
|
-
fromWorkspace?: string;
|
|
33
|
-
json?: boolean;
|
|
34
|
-
podUrl?: string;
|
|
35
|
-
apiKey?: string;
|
|
36
|
-
}): Promise<void>;
|
|
37
|
-
export declare function templateList(opts: {
|
|
38
|
-
json?: boolean;
|
|
39
|
-
}): Promise<void>;
|
|
40
|
-
export declare function templateGet(slug: string, opts: {
|
|
41
|
-
json?: boolean;
|
|
42
|
-
}): Promise<void>;
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `synap template` — the "one request" template surface (TEMPLATE-ONE-PATH-PLAN §3-4).
|
|
3
|
-
* =====================================================================================
|
|
4
|
-
*
|
|
5
|
-
* The plan names ONE governed write door for adding/updating a workspace template:
|
|
6
|
-
* `synap template publish <file>` → CP `POST /api/packages` (validated server-side).
|
|
7
|
-
* No npm publish, no lockfile-bump, no redeploy. This file is that named surface.
|
|
8
|
-
*
|
|
9
|
-
* synap template publish <file> — validate + upsert to the CP (private by default; --public to share)
|
|
10
|
-
* synap template publish --from-workspace <id> — serialize a LIVE workspace, then publish
|
|
11
|
-
* synap template list — the caller-visible catalog (own private + public), slug/name/vis/version
|
|
12
|
-
* synap template get <slug> — one template's metadata + definition shape
|
|
13
|
-
*
|
|
14
|
-
* REUSE, no reinvention: publish delegates to the existing `marketPublish` (same
|
|
15
|
-
* validator, same CP transport). list/get read through `lib/cp-packages` — the ONE
|
|
16
|
-
* authed CP `/api/packages` client (Bearer from `lib/auth`'s stored login token).
|
|
17
|
-
* No `fetch` is hand-rolled here.
|
|
18
|
-
*
|
|
19
|
-
* NOTE (for the orchestrator): this overlaps `synap market publish/validate/
|
|
20
|
-
* unpublish`, which already ship the same authoring loop. `synap template` is the
|
|
21
|
-
* plan-canonical name; picking one and retiring/aliasing the other is a §4 Wave 2
|
|
22
|
-
* cleanup decision, not made here.
|
|
23
|
-
*/
|
|
24
|
-
import chalk from "chalk";
|
|
25
|
-
import { log } from "../utils/logger.js";
|
|
26
|
-
import { getStoredToken, isTokenLocallyExpired } from "../lib/auth.js";
|
|
27
|
-
import { fetchMyRows, fetchPublicBrowseRows, fetchPackageDefinition, } from "../lib/cp-packages.js";
|
|
28
|
-
// ─── publish ─────────────────────────────────────────────────────────────────
|
|
29
|
-
/**
|
|
30
|
-
* `synap template publish <file>` — the plan's "one request". A thin alias over
|
|
31
|
-
* the existing `marketPublish` so there is exactly ONE publish implementation
|
|
32
|
-
* (same validator, same CP write door, same `--public`/`--from-workspace`/`--json`).
|
|
33
|
-
*/
|
|
34
|
-
export async function templatePublish(file, opts) {
|
|
35
|
-
const { marketPublish } = await import("./market-authoring.js");
|
|
36
|
-
await marketPublish(file, opts);
|
|
37
|
-
}
|
|
38
|
-
/** private/public/unknown → a short colored label. */
|
|
39
|
-
function visLabel(isPublic) {
|
|
40
|
-
if (isPublic === false)
|
|
41
|
-
return chalk.yellow("private");
|
|
42
|
-
if (isPublic === true)
|
|
43
|
-
return chalk.green("public");
|
|
44
|
-
return chalk.dim("public");
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Fetch the caller-visible catalog: the caller's own rows (incl. private) when
|
|
48
|
-
* logged in, merged with the public browse rows. `/mine` wins a slug tie so the
|
|
49
|
-
* real `isPublic` flag and owned marker survive.
|
|
50
|
-
*/
|
|
51
|
-
async function fetchCatalog() {
|
|
52
|
-
const creds = getStoredToken();
|
|
53
|
-
const loggedIn = !!creds && !isTokenLocallyExpired(creds);
|
|
54
|
-
const filters = { category: "workspace" };
|
|
55
|
-
// Public browse is best-effort — a private catalog that resolves is still useful.
|
|
56
|
-
const publicRows = await fetchPublicBrowseRows(filters).catch(() => []);
|
|
57
|
-
const bySlug = new Map();
|
|
58
|
-
for (const r of publicRows) {
|
|
59
|
-
bySlug.set(r.slug, {
|
|
60
|
-
slug: r.slug,
|
|
61
|
-
displayName: r.displayName,
|
|
62
|
-
description: r.description,
|
|
63
|
-
version: r.version,
|
|
64
|
-
isPublic: true,
|
|
65
|
-
owned: false,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
if (loggedIn) {
|
|
69
|
-
const mineRows = await fetchMyRows(creds.token, filters);
|
|
70
|
-
for (const r of mineRows) {
|
|
71
|
-
bySlug.set(r.slug, {
|
|
72
|
-
slug: r.slug,
|
|
73
|
-
displayName: r.displayName,
|
|
74
|
-
description: r.description,
|
|
75
|
-
version: r.version,
|
|
76
|
-
isPublic: r.isPublic,
|
|
77
|
-
owned: true,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const rows = [...bySlug.values()].sort((a, b) => a.slug.localeCompare(b.slug));
|
|
82
|
-
return { rows, loggedIn };
|
|
83
|
-
}
|
|
84
|
-
export async function templateList(opts) {
|
|
85
|
-
let catalog;
|
|
86
|
-
try {
|
|
87
|
-
catalog = await fetchCatalog();
|
|
88
|
-
}
|
|
89
|
-
catch (e) {
|
|
90
|
-
if (opts.json) {
|
|
91
|
-
console.log(JSON.stringify({ ok: false, error: e.message }, null, 2));
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
log.error(`Could not list templates: ${e.message}`);
|
|
95
|
-
log.hint("Log in for your private templates: synap login");
|
|
96
|
-
}
|
|
97
|
-
process.exit(1);
|
|
98
|
-
}
|
|
99
|
-
if (opts.json) {
|
|
100
|
-
console.log(JSON.stringify({ ok: true, loggedIn: catalog.loggedIn, templates: catalog.rows }, null, 2));
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (catalog.rows.length === 0) {
|
|
104
|
-
log.info("No templates visible.");
|
|
105
|
-
if (!catalog.loggedIn)
|
|
106
|
-
log.hint("Your private templates are hidden until you log in: synap login");
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
log.heading(`Templates (${catalog.rows.length})`);
|
|
110
|
-
if (!catalog.loggedIn)
|
|
111
|
-
log.dim("Logged out — showing public templates only. `synap login` to see your private ones.");
|
|
112
|
-
log.blank();
|
|
113
|
-
for (const r of catalog.rows) {
|
|
114
|
-
const ver = r.version ? chalk.dim(` ${r.version}`) : "";
|
|
115
|
-
const owned = r.owned ? chalk.dim(" (yours)") : "";
|
|
116
|
-
console.log(` ${chalk.bold(r.slug)}${ver} ${visLabel(r.isPublic)}${owned}`);
|
|
117
|
-
console.log(` ${chalk.cyan(r.displayName)}${r.description ? chalk.dim(` ${r.description}`) : ""}`);
|
|
118
|
-
}
|
|
119
|
-
log.blank();
|
|
120
|
-
log.dim("Publish a template: synap template publish <file>");
|
|
121
|
-
log.dim("Inspect one: synap template get <slug>");
|
|
122
|
-
}
|
|
123
|
-
// ─── get ─────────────────────────────────────────────────────────────────────
|
|
124
|
-
export async function templateGet(slug, opts) {
|
|
125
|
-
const creds = getStoredToken();
|
|
126
|
-
const token = creds && !isTokenLocallyExpired(creds) ? creds.token : undefined;
|
|
127
|
-
// Metadata: prefer the caller's own row (carries isPublic + version), else the
|
|
128
|
-
// public browse row for this slug.
|
|
129
|
-
let meta;
|
|
130
|
-
try {
|
|
131
|
-
if (token) {
|
|
132
|
-
const mine = await fetchMyRows(token, { category: "workspace", search: slug });
|
|
133
|
-
const own = mine.find((r) => r.slug === slug);
|
|
134
|
-
if (own) {
|
|
135
|
-
meta = { slug: own.slug, displayName: own.displayName, description: own.description, version: own.version, isPublic: own.isPublic, owned: true };
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
if (!meta) {
|
|
139
|
-
const pub = await fetchPublicBrowseRows({ category: "workspace", search: slug });
|
|
140
|
-
const row = pub.find((r) => r.slug === slug);
|
|
141
|
-
if (row) {
|
|
142
|
-
meta = { slug: row.slug, displayName: row.displayName, description: row.description, version: row.version, isPublic: true, owned: false };
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (e) {
|
|
147
|
-
if (opts.json) {
|
|
148
|
-
console.log(JSON.stringify({ ok: false, slug, error: e.message }, null, 2));
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
log.error(`Could not fetch "${slug}": ${e.message}`);
|
|
152
|
-
}
|
|
153
|
-
process.exit(1);
|
|
154
|
-
}
|
|
155
|
-
// Full definition (the install payload) — authed so a private template resolves.
|
|
156
|
-
const definition = await fetchPackageDefinition(slug, token).catch(() => null);
|
|
157
|
-
if (!meta && !definition) {
|
|
158
|
-
if (opts.json) {
|
|
159
|
-
console.log(JSON.stringify({ ok: false, slug, error: "not found" }, null, 2));
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
log.error(`Template "${slug}" not found or not visible.`);
|
|
163
|
-
if (!token)
|
|
164
|
-
log.hint("If it is private, log in first: synap login");
|
|
165
|
-
}
|
|
166
|
-
process.exit(1);
|
|
167
|
-
}
|
|
168
|
-
if (opts.json) {
|
|
169
|
-
console.log(JSON.stringify({ ok: true, slug, ...meta, definition }, null, 2));
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
const displayName = meta?.displayName ?? slug;
|
|
173
|
-
log.heading(`${displayName} ${chalk.dim(`(${slug})`)}`);
|
|
174
|
-
log.blank();
|
|
175
|
-
if (meta?.description) {
|
|
176
|
-
console.log(` ${meta.description}`);
|
|
177
|
-
log.blank();
|
|
178
|
-
}
|
|
179
|
-
if (meta?.version)
|
|
180
|
-
console.log(` ${chalk.dim("version:")} ${meta.version}`);
|
|
181
|
-
console.log(` ${chalk.dim("visibility:")} ${visLabel(meta?.isPublic)}${meta?.owned ? chalk.dim(" (yours)") : ""}`);
|
|
182
|
-
const def = definition;
|
|
183
|
-
if (def) {
|
|
184
|
-
const count = (v) => (Array.isArray(v) ? v.length : 0);
|
|
185
|
-
console.log(` ${chalk.dim("profiles:")} ${count(def.profiles)}`);
|
|
186
|
-
console.log(` ${chalk.dim("views:")} ${count(def.views)}`);
|
|
187
|
-
}
|
|
188
|
-
log.blank();
|
|
189
|
-
log.dim(`Install it: synap market install ${slug}`);
|
|
190
|
-
}
|
|
191
|
-
//# sourceMappingURL=template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/commands/template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MA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rl}/admin/connect?integration=cli&redirect_uri=http://127.0.0.1:<port>/callback`.
|
|
6
|
-
* 3. Open the user's default browser at that URL.
|
|
7
|
-
* 4. Admin UI authenticates the user (Kratos session), mints a scoped Hub
|
|
8
|
-
* Protocol API key via `trpc.apiKeys.connectIntegration`, and redirects
|
|
9
|
-
* to `http://127.0.0.1:<port>/callback?context={apiKey,podUrl,workspaceId}`.
|
|
10
|
-
* 5. Local server receives the callback, extracts credentials, shuts down.
|
|
11
|
-
*
|
|
12
|
-
* This is the same flow Raycast uses (via a `raycast://` deeplink) — for CLI
|
|
13
|
-
* we just swap the deeplink for a loopback HTTP URL. The admin UI's redirect
|
|
14
|
-
* whitelist accepts both.
|
|
15
|
-
*
|
|
16
|
-
* Security notes:
|
|
17
|
-
* - Loopback only (127.0.0.1) — no external network can intercept.
|
|
18
|
-
* - One-shot: server only handles the first /callback, then exits.
|
|
19
|
-
* - 5-minute timeout.
|
|
20
|
-
* - No CSRF token: single-use, host-local, bound to the process.
|
|
21
|
-
*/
|
|
22
|
-
export interface BrowserAuthResult {
|
|
23
|
-
apiKey: string;
|
|
24
|
-
podUrl: string;
|
|
25
|
-
workspaceId?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface BrowserAuthOptions {
|
|
28
|
-
podUrl: string;
|
|
29
|
-
integration: "cli" | "raycast" | "openclaw" | "custom";
|
|
30
|
-
/** Milliseconds to wait for the callback. Default 5min. */
|
|
31
|
-
timeoutMs?: number;
|
|
32
|
-
/** Hook invoked with the admin-panel URL right before opening the browser. */
|
|
33
|
-
onUrlReady?: (url: string) => void;
|
|
34
|
-
}
|
|
35
|
-
export declare function runBrowserAuth(opts: BrowserAuthOptions): Promise<BrowserAuthResult>;
|
package/dist/lib/browser-auth.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-based connect flow — the recommended provisioning path.
|
|
3
|
-
*
|
|
4
|
-
* 1. Start a local HTTP server on an ephemeral port.
|
|
5
|
-
* 2. Build `{podUrl}/admin/connect?integration=cli&redirect_uri=http://127.0.0.1:<port>/callback`.
|
|
6
|
-
* 3. Open the user's default browser at that URL.
|
|
7
|
-
* 4. Admin UI authenticates the user (Kratos session), mints a scoped Hub
|
|
8
|
-
* Protocol API key via `trpc.apiKeys.connectIntegration`, and redirects
|
|
9
|
-
* to `http://127.0.0.1:<port>/callback?context={apiKey,podUrl,workspaceId}`.
|
|
10
|
-
* 5. Local server receives the callback, extracts credentials, shuts down.
|
|
11
|
-
*
|
|
12
|
-
* This is the same flow Raycast uses (via a `raycast://` deeplink) — for CLI
|
|
13
|
-
* we just swap the deeplink for a loopback HTTP URL. The admin UI's redirect
|
|
14
|
-
* whitelist accepts both.
|
|
15
|
-
*
|
|
16
|
-
* Security notes:
|
|
17
|
-
* - Loopback only (127.0.0.1) — no external network can intercept.
|
|
18
|
-
* - One-shot: server only handles the first /callback, then exits.
|
|
19
|
-
* - 5-minute timeout.
|
|
20
|
-
* - No CSRF token: single-use, host-local, bound to the process.
|
|
21
|
-
*/
|
|
22
|
-
import http from "node:http";
|
|
23
|
-
import { URL } from "node:url";
|
|
24
|
-
import { spawn } from "node:child_process";
|
|
25
|
-
export async function runBrowserAuth(opts) {
|
|
26
|
-
const podUrl = opts.podUrl.replace(/\/$/, "");
|
|
27
|
-
const timeoutMs = opts.timeoutMs ?? 5 * 60_000;
|
|
28
|
-
return new Promise((resolve, reject) => {
|
|
29
|
-
const server = http.createServer();
|
|
30
|
-
let settled = false;
|
|
31
|
-
const settle = (fn) => {
|
|
32
|
-
if (settled)
|
|
33
|
-
return;
|
|
34
|
-
settled = true;
|
|
35
|
-
fn();
|
|
36
|
-
server.close();
|
|
37
|
-
clearTimeout(timeout);
|
|
38
|
-
};
|
|
39
|
-
const timeout = setTimeout(() => {
|
|
40
|
-
settle(() => reject(new Error("Timed out waiting for browser approval. Run again, or use --manual-key.")));
|
|
41
|
-
}, timeoutMs);
|
|
42
|
-
server.on("request", (req, res) => {
|
|
43
|
-
// Only accept GET /callback — reject anything else.
|
|
44
|
-
const reqUrl = new URL(req.url ?? "/", `http://127.0.0.1`);
|
|
45
|
-
if (reqUrl.pathname !== "/callback") {
|
|
46
|
-
res.writeHead(404).end("Not found");
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const raw = reqUrl.searchParams.get("context");
|
|
50
|
-
if (!raw) {
|
|
51
|
-
res.writeHead(400, { "Content-Type": "text/html; charset=utf-8" });
|
|
52
|
-
res.end(errorHtml("No context received — try again."));
|
|
53
|
-
settle(() => reject(new Error("Callback missing `context` parameter")));
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
const parsed = JSON.parse(raw);
|
|
58
|
-
if (!parsed.apiKey || !parsed.podUrl) {
|
|
59
|
-
throw new Error("Callback missing apiKey or podUrl");
|
|
60
|
-
}
|
|
61
|
-
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
62
|
-
res.end(successHtml(opts.integration));
|
|
63
|
-
settle(() => resolve({
|
|
64
|
-
apiKey: parsed.apiKey,
|
|
65
|
-
podUrl: parsed.podUrl,
|
|
66
|
-
workspaceId: parsed.workspaceId ?? undefined,
|
|
67
|
-
}));
|
|
68
|
-
}
|
|
69
|
-
catch (err) {
|
|
70
|
-
res.writeHead(400, { "Content-Type": "text/html; charset=utf-8" });
|
|
71
|
-
res.end(errorHtml("Invalid callback payload."));
|
|
72
|
-
settle(() => reject(err instanceof Error ? err : new Error(String(err))));
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
server.on("error", (err) => {
|
|
76
|
-
settle(() => reject(err));
|
|
77
|
-
});
|
|
78
|
-
server.listen(0, "127.0.0.1", () => {
|
|
79
|
-
const port = server.address().port;
|
|
80
|
-
const redirectUri = `http://127.0.0.1:${port}/callback`;
|
|
81
|
-
const adminUrl = new URL(`${podUrl}/admin/connect`);
|
|
82
|
-
adminUrl.searchParams.set("integration", opts.integration);
|
|
83
|
-
adminUrl.searchParams.set("redirect_uri", redirectUri);
|
|
84
|
-
const fullUrl = adminUrl.toString();
|
|
85
|
-
opts.onUrlReady?.(fullUrl);
|
|
86
|
-
openBrowser(fullUrl).catch(() => {
|
|
87
|
-
// Browser open failure is non-fatal — user can paste the URL themselves.
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Cross-platform browser open. Returns when the launcher has been kicked off,
|
|
94
|
-
* not when the user has actually seen the page.
|
|
95
|
-
*/
|
|
96
|
-
async function openBrowser(url) {
|
|
97
|
-
const platform = process.platform;
|
|
98
|
-
const [command, args] = platform === "darwin"
|
|
99
|
-
? ["open", [url]]
|
|
100
|
-
: platform === "win32"
|
|
101
|
-
? ["cmd", ["/c", "start", "", url]]
|
|
102
|
-
: ["xdg-open", [url]];
|
|
103
|
-
return new Promise((resolve, reject) => {
|
|
104
|
-
const child = spawn(command, args, {
|
|
105
|
-
stdio: "ignore",
|
|
106
|
-
detached: true,
|
|
107
|
-
});
|
|
108
|
-
child.once("error", reject);
|
|
109
|
-
child.once("spawn", () => {
|
|
110
|
-
child.unref();
|
|
111
|
-
resolve();
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
// ─── Page HTML ──────────────────────────────────────────────────────────────
|
|
116
|
-
// Short, no external deps, CLI-tool vibe. Shown once per connect.
|
|
117
|
-
function successHtml(integration) {
|
|
118
|
-
const label = integration.charAt(0).toUpperCase() + integration.slice(1);
|
|
119
|
-
return `<!doctype html>
|
|
120
|
-
<html lang="en">
|
|
121
|
-
<head><meta charset="utf-8"><title>Synap connected</title>
|
|
122
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
123
|
-
<style>
|
|
124
|
-
:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
|
|
125
|
-
body { margin: 0; background: #0A0A0A; color: #FAFAFA; display: grid; place-items: center; min-height: 100vh; }
|
|
126
|
-
.card { max-width: 420px; padding: 32px; text-align: center; }
|
|
127
|
-
.check { width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 9999px; background: rgba(16, 185, 129, 0.12); display: grid; place-items: center; color: #10B981; }
|
|
128
|
-
h1 { font-size: 20px; margin: 0 0 8px; font-weight: 600; letter-spacing: -0.01em; }
|
|
129
|
-
p { margin: 0; color: rgba(250, 250, 250, 0.6); font-size: 14px; line-height: 1.5; }
|
|
130
|
-
code { background: rgba(250, 250, 250, 0.08); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
|
|
131
|
-
</style>
|
|
132
|
-
</head>
|
|
133
|
-
<body>
|
|
134
|
-
<div class="card">
|
|
135
|
-
<div class="check">
|
|
136
|
-
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
|
|
137
|
-
</div>
|
|
138
|
-
<h1>${label} connected</h1>
|
|
139
|
-
<p>You can close this tab and return to your terminal.</p>
|
|
140
|
-
</div>
|
|
141
|
-
<script>setTimeout(() => window.close(), 3000);</script>
|
|
142
|
-
</body>
|
|
143
|
-
</html>`;
|
|
144
|
-
}
|
|
145
|
-
function errorHtml(reason) {
|
|
146
|
-
return `<!doctype html>
|
|
147
|
-
<html lang="en">
|
|
148
|
-
<head><meta charset="utf-8"><title>Synap connect failed</title>
|
|
149
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
150
|
-
<style>
|
|
151
|
-
:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
|
|
152
|
-
body { margin: 0; background: #0A0A0A; color: #FAFAFA; display: grid; place-items: center; min-height: 100vh; }
|
|
153
|
-
.card { max-width: 420px; padding: 32px; text-align: center; }
|
|
154
|
-
.x { width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 9999px; background: rgba(239, 68, 68, 0.12); display: grid; place-items: center; color: #EF4444; }
|
|
155
|
-
h1 { font-size: 20px; margin: 0 0 8px; font-weight: 600; }
|
|
156
|
-
p { margin: 0; color: rgba(250, 250, 250, 0.6); font-size: 14px; line-height: 1.5; }
|
|
157
|
-
</style>
|
|
158
|
-
</head>
|
|
159
|
-
<body>
|
|
160
|
-
<div class="card">
|
|
161
|
-
<div class="x">
|
|
162
|
-
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
|
163
|
-
</div>
|
|
164
|
-
<h1>Connect failed</h1>
|
|
165
|
-
<p>${reason}</p>
|
|
166
|
-
</div>
|
|
167
|
-
</body>
|
|
168
|
-
</html>`;
|
|
169
|
-
}
|
|
170
|
-
//# sourceMappingURL=browser-auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser-auth.js","sourceRoot":"","sources":["../../src/lib/browser-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAkB3C,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,IAAwB;IAExB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,CAAC,GAAG,MAAM,CAAC;IAE/C,OAAO,IAAI,OAAO,CAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACnC,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,MAAM,GAAG,CAAC,EAAc,EAA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