talentos 1.4.21 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +82 -7
  2. package/dist/agent/adapters.js +12 -2
  3. package/dist/agent/codex-policy.js +13 -0
  4. package/dist/agent/codex-probe.js +3 -1
  5. package/dist/agent/native/codex-fence.js +1 -1
  6. package/dist/agent/native/codex-launch.js +1 -3
  7. package/dist/agent/native/gate.js +11 -3
  8. package/dist/agent/native/hook-entry.js +8 -1
  9. package/dist/agent/native/touch.js +15 -6
  10. package/dist/agent/serve.js +4 -2
  11. package/dist/agent/talentos-content.js +33 -0
  12. package/dist/args.js +10 -1
  13. package/dist/claude-plugin.js +82 -0
  14. package/dist/client.js +17 -4
  15. package/dist/commands/doctor.js +371 -0
  16. package/dist/commands/init.js +59 -8
  17. package/dist/commands/login.js +10 -1
  18. package/dist/commands/mcp.js +16 -1
  19. package/dist/commands/skills-sync.js +174 -0
  20. package/dist/commands/skills.js +24 -4
  21. package/dist/commands/task.js +77 -0
  22. package/dist/commands/tools.js +56 -0
  23. package/dist/config.js +34 -0
  24. package/dist/download-file.js +75 -0
  25. package/dist/format.js +12 -0
  26. package/dist/index.js +102 -19
  27. package/dist/install.js +55 -36
  28. package/dist/mcp-proxy.js +18 -0
  29. package/dist/memory-wire.js +22 -0
  30. package/dist/output.js +107 -0
  31. package/dist/setup.generated.js +120 -0
  32. package/dist/skill-files.js +1 -1
  33. package/dist/skill-sync-state.js +38 -0
  34. package/dist/watch.js +39 -0
  35. package/package.json +3 -2
  36. package/plugin/.claude-plugin/marketplace.json +12 -0
  37. package/plugin/plugins/talentos/.claude-plugin/plugin.json +9 -0
  38. package/plugin/plugins/talentos/.mcp.json +8 -0
  39. package/plugin/plugins/talentos/commands/ask-talent.md +20 -0
  40. package/plugin/plugins/talentos/commands/catch-up.md +16 -0
  41. package/plugin/plugins/talentos/commands/remember.md +15 -0
  42. package/plugin/plugins/talentos/hooks/hooks.json +17 -0
  43. package/plugin/plugins/talentos/scripts/session-start.mjs +177 -0
@@ -0,0 +1,120 @@
1
+ export const OAUTH_NEXT = {
2
+ claude: "Claude Code: run /mcp, pick talentos, choose Authenticate.",
3
+ codex: "Codex: run `codex mcp login talentos`.",
4
+ };
5
+ export function setupEntry(url, key) {
6
+ return {
7
+ mcpServers: {
8
+ talentos: { url, headers: { Authorization: `Bearer ${key}` } },
9
+ },
10
+ };
11
+ }
12
+ export function setupSnippet(client, mode, connection) {
13
+ const { apiUrl, key, url } = connection;
14
+ switch (client) {
15
+ case "claude":
16
+ return `claude mcp add --scope user --transport http talentos ${url}${mode === "key" ? ` --header "Authorization: Bearer ${key}"` : ""}`;
17
+ case "codex":
18
+ return [
19
+ "[mcp_servers.talentos]",
20
+ ...(mode === "oauth"
21
+ ? [`url = ${JSON.stringify(url)}`]
22
+ : [
23
+ 'command = "npx"',
24
+ 'args = ["-y", "talentos@1", "mcp"]',
25
+ connection.inheritKey
26
+ ? 'env_vars = ["TALENTOS_API_KEY", "TALENTOS_API_URL"]'
27
+ : `env = { TALENTOS_API_KEY = ${JSON.stringify(key)}, TALENTOS_API_URL = ${JSON.stringify(apiUrl)} }`,
28
+ ]),
29
+ ].join("\n");
30
+ case "cursor":
31
+ return JSON.stringify(setupEntry(url, key), null, 2);
32
+ case "gemini":
33
+ return JSON.stringify({
34
+ mcpServers: {
35
+ talentos: {
36
+ httpUrl: url,
37
+ headers: { Authorization: `Bearer ${key}` },
38
+ },
39
+ },
40
+ }, null, 2);
41
+ default:
42
+ throw new Error(`Unknown setup client: ${client}`);
43
+ }
44
+ }
45
+ export function renderStartGuide(origin, apiOrigin = origin) {
46
+ const url = `${origin}/mcp`;
47
+ const connection = {
48
+ apiUrl: apiOrigin,
49
+ // biome-ignore lint/suspicious/noTemplateCurlyInString: the client expands this environment placeholder.
50
+ key: "${TALENTOS_API_KEY}",
51
+ url,
52
+ inheritKey: true,
53
+ };
54
+ const snippet = (client, mode) => setupSnippet(client, mode, connection);
55
+ return `# Connect your agent to TalentOS
56
+
57
+ Act as the member who asked you to connect. Ask them to complete browser sign-in and consent; never approve for them. Use only the tools their connection offers. Work in your own session unless they explicitly ask you to delegate to their Talent (which uses their AI credits).
58
+
59
+ MCP server (Streamable HTTP): ${url}
60
+
61
+ ## 1. Connect once
62
+
63
+ Prefer OAuth below when enabled for this workspace. If sign-in is unavailable, use the key fallback. Node 22.23.4 or newer supported Node 24 is needed for the CLI.
64
+
65
+ **Claude Code** — run:
66
+ \`\`\`sh
67
+ ${snippet("claude", "oauth")}
68
+ \`\`\`
69
+ ${OAUTH_NEXT.claude} Restart the session if needed.
70
+
71
+ **Codex** — add this to ~/.codex/config.toml (keep other servers):
72
+ \`\`\`toml
73
+ ${snippet("codex", "oauth")}
74
+ \`\`\`
75
+ Then run \`codex mcp login talentos\`. In a remote terminal use \`codex mcp login talentos --no-browser\` and follow its browser instructions.
76
+
77
+ **ChatGPT** — in Settings → Apps → Advanced settings enable Developer mode (if your plan/workspace permits it). Create a custom app with MCP server URL \`${url}\` and OAuth, then Connect. Select TalentOS in the chat's tools. If custom apps are unavailable, use a supported terminal client.
78
+
79
+ **Claude.ai** — Settings → Connectors → Add custom connector: name TalentOS, Remote MCP server URL \`${url}\`. Add, then Connect and finish OAuth. Enable the connector in your chat. Your plan or workspace may require an admin to allow custom connectors.
80
+
81
+ **Cursor** — native OAuth is not supported by TalentOS for Cursor yet. Use the key fallback below and merge this into ~/.cursor/mcp.json, replacing the placeholder with the member's key in that private file:
82
+ \`\`\`json
83
+ ${snippet("cursor", "key")}
84
+ \`\`\`
85
+ Reload Cursor and enable talentos in MCP settings.
86
+
87
+ **Gemini CLI** — native OAuth is not supported by TalentOS for Gemini yet. Use the key fallback and merge into ~/.gemini/settings.json:
88
+ \`\`\`json
89
+ ${snippet("gemini", "key")}
90
+ \`\`\`
91
+ Gemini expands the environment variable; restart Gemini with it set and check \`/mcp\`.
92
+
93
+ ### Key fallback: headless / CI
94
+
95
+ The member creates a personal key in TalentOS Settings → Agents → Advanced keys. Supply TALENTOS_API_KEY through your secret manager; never paste it into chat, a repository, or logs. Set the matching endpoint:
96
+ \`\`\`sh
97
+ export TALENTOS_API_URL='${apiOrigin}'
98
+ export MCP_PUBLIC_ORIGIN='${origin}'
99
+ npx -y talentos@1 whoami
100
+ \`\`\`
101
+ For Claude Code, remove an existing OAuth entry first (only if present), then add the key entry with the secret in the environment:
102
+ \`\`\`sh
103
+ claude mcp remove --scope user talentos
104
+ \`\`\`
105
+ \`\`\`sh
106
+ ${snippet("claude", "key")}
107
+ \`\`\`
108
+ For Codex, pass the secret through its environment. Replace the existing [mcp_servers.talentos] section in ~/.codex/config.toml (do not append a duplicate), then restart Codex with the variables above set:
109
+ \`\`\`toml
110
+ ${snippet("codex", "key")}
111
+ \`\`\`
112
+ Other stdio-only clients launch \`npx -y talentos@1 mcp\` with those variables. ChatGPT and Claude.ai use browser OAuth; do not put a key in their chats.
113
+
114
+ The CLI can configure Claude Code, Codex and Cursor together: \`npx -y talentos@1 init --oauth --no-pull --api-url ${apiOrigin}\`. This also asks the member to authorize the CLI; each OAuth client signs in separately. Omit --oauth for key-based setup.
115
+
116
+ ## 2. Verify before working
117
+
118
+ Call the connected server's \`whoami\` tool with \`{}\`. Confirm the returned member and company with the user before any write. CLI fallback: \`npx -y talentos@1 whoami\`. If it fails, run \`npx -y talentos@1 doctor --api-url ${apiOrigin}\` and follow its next step. Reconnect after changing company or revoking a key.
119
+ `;
120
+ }
@@ -46,7 +46,7 @@ export async function writeSkillPackage(dir, slug, files) {
46
46
  * and a Windows drive or UNC path, none of which need a `..` segment to land
47
47
  * outside the folder — while a name like `..notes.md` is perfectly legitimate.
48
48
  */
49
- function escapesRoot(root, path) {
49
+ export function escapesRoot(root, path) {
50
50
  if (isAbsolute(path) || win32.isAbsolute(path)) {
51
51
  return true;
52
52
  }
@@ -0,0 +1,38 @@
1
+ import { createHash } from "node:crypto";
2
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+ /** Lives next to the skill folders it describes; delete it to start over. */
5
+ export const SYNC_MANIFEST = ".talentos-sync.json";
6
+ export function hashFiles(files) {
7
+ return Object.fromEntries(files.map((file) => [file.path, sha(file.text)]));
8
+ }
9
+ export function sha(text) {
10
+ return createHash("sha256").update(text).digest("hex");
11
+ }
12
+ export async function readText(path) {
13
+ try {
14
+ return await readFile(path, "utf8");
15
+ }
16
+ catch {
17
+ return;
18
+ }
19
+ }
20
+ export async function readManifest(dir) {
21
+ const raw = await readText(join(dir, SYNC_MANIFEST));
22
+ if (raw === undefined) {
23
+ return {};
24
+ }
25
+ try {
26
+ const parsed = JSON.parse(raw);
27
+ return parsed && typeof parsed === "object" ? parsed : {};
28
+ }
29
+ catch {
30
+ // An unreadable manifest means nothing is known to be ours: every existing
31
+ // folder is then "differs", never overwritten.
32
+ return {};
33
+ }
34
+ }
35
+ export async function writeManifest(dir, manifest) {
36
+ await mkdir(dir, { recursive: true });
37
+ await writeFile(join(dir, SYNC_MANIFEST), `${JSON.stringify(manifest, null, 2)}\n`, "utf8");
38
+ }
package/dist/watch.js ADDED
@@ -0,0 +1,39 @@
1
+ const DEFAULT_WAIT_SECONDS = 40;
2
+ const DEFAULT_WATCH_MS = 10 * 60_000;
3
+ /** Follows existing work; a server read is never retried or replaced by a write. */
4
+ export async function watch(options) {
5
+ const deadline = options.deadline ?? Date.now() + DEFAULT_WATCH_MS;
6
+ const controller = new AbortController();
7
+ const interrupt = () => controller.abort();
8
+ const timeout = setTimeout(interrupt, Math.max(0, deadline - Date.now()));
9
+ timeout.unref();
10
+ process.once("SIGINT", interrupt);
11
+ try {
12
+ let current = await options.read(undefined, 0, controller.signal);
13
+ options.onChange(current);
14
+ while (options.isRunning(current) &&
15
+ !controller.signal.aborted &&
16
+ Date.now() < deadline) {
17
+ const remainingSeconds = Math.ceil((deadline - Date.now()) / 1000);
18
+ let next;
19
+ try {
20
+ next = await options.read(current, Math.min(options.waitSeconds ?? DEFAULT_WAIT_SECONDS, remainingSeconds), controller.signal);
21
+ }
22
+ catch (error) {
23
+ if (controller.signal.aborted) {
24
+ return current;
25
+ }
26
+ throw error;
27
+ }
28
+ if (options.version(next) !== options.version(current)) {
29
+ options.onChange(next);
30
+ }
31
+ current = next;
32
+ }
33
+ return current;
34
+ }
35
+ finally {
36
+ clearTimeout(timeout);
37
+ process.removeListener("SIGINT", interrupt);
38
+ }
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "talentos",
3
- "version": "1.4.21",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "description": "TalentOS CLI: push and pull skills, read and write team memory, and delegate work to your Talent from any agent.",
6
6
  "repository": {
@@ -12,7 +12,8 @@
12
12
  "talentos": "./dist/index.js"
13
13
  },
14
14
  "files": [
15
- "dist"
15
+ "dist",
16
+ "plugin"
16
17
  ],
17
18
  "engines": {
18
19
  "node": ">=22.23.4 <23 || >=24.22.1 <25"
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "talentos",
3
+ "owner": { "name": "TalentOS", "url": "https://talentos.so" },
4
+ "description": "TalentOS for Claude Code: your company's memory, Skills and Talent.",
5
+ "plugins": [
6
+ {
7
+ "name": "talentos",
8
+ "source": "./plugins/talentos",
9
+ "description": "Connect Claude Code to your company's TalentOS: sign in once in the browser, then use shared memory, Skills, Routines and your Talent."
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "talentos",
3
+ "displayName": "TalentOS",
4
+ "version": "0.1.0",
5
+ "description": "Connect Claude Code to your company's TalentOS: sign in once in the browser, then use shared memory, Skills, Routines and your Talent.",
6
+ "author": { "name": "TalentOS", "url": "https://talentos.so" },
7
+ "homepage": "https://talentos.so",
8
+ "keywords": ["talentos", "memory", "skills", "mcp"]
9
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "talentos": {
4
+ "type": "http",
5
+ "url": "https://woozy-oyster-769.convex.site/mcp"
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Explicitly hand a task to your TalentOS Talent (you do the rest yourself)
3
+ argument-hint: "<what you want your Talent to do>"
4
+ ---
5
+
6
+ The user asked you to hand this to their TalentOS Talent: $ARGUMENTS
7
+
8
+ This command is for explicit delegation only. For anything the user did not ask
9
+ to hand over, do the work yourself with the tools you have and use TalentOS only
10
+ for company context.
11
+
12
+ - If the `talentos` MCP server offers `start_task`, call it with the request and
13
+ then poll `get_task` until it finishes or needs the user's answer
14
+ (`answer_task`).
15
+ - Otherwise call `ask_talent` with the request, then poll `get_thread` for the
16
+ reply. Stop polling after about two minutes and give the user the thread link:
17
+ the Talent keeps working and delivers the result in TalentOS.
18
+ - Say what you handed over, in one line.
19
+ - If the tool is not available in this connection, say so plainly and suggest
20
+ `npx talentos@1 ask "<message>"`.
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: What changed at your company since you last looked
3
+ argument-hint: "[topic]"
4
+ ---
5
+
6
+ Catch me up on my company using TalentOS for context. $ARGUMENTS
7
+
8
+ 1. If the `talentos` MCP server offers a `catch_up` tool, call it and summarise
9
+ the result in a few short bullets.
10
+ 2. Otherwise call `whoami`, then `list_threads` and `search_memory` (scope
11
+ `all`) for anything recent that matches my topic, and summarise what you find.
12
+ 3. Name what needs a decision from me first. Keep it under ten lines.
13
+
14
+ If the `talentos` server asks you to sign in, tell me to run `/mcp`, pick
15
+ `talentos` and choose Authenticate. Do not guess at company facts: say so when
16
+ TalentOS has nothing on a point.
@@ -0,0 +1,15 @@
1
+ ---
2
+ description: Save one fact to your Talent's memory (or propose it to the company)
3
+ argument-hint: "<fact> [--company]"
4
+ ---
5
+
6
+ Save this to TalentOS memory: $ARGUMENTS
7
+
8
+ - Call the `remember` tool with one short, declarative sentence as `content`.
9
+ - `scope` is `personal` unless I wrote `--company` or said it is for the whole
10
+ team. Company facts from a member are proposed for review, not saved at once:
11
+ tell me which happened.
12
+ - Never save secrets, passwords or keys. If my text has one, leave it out and
13
+ say so.
14
+ - If `remember` is not available in this connection, say so plainly and suggest
15
+ `npx talentos@1 memory add "<fact>"` instead.
@@ -0,0 +1,17 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "startup|resume|clear|compact",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node",
10
+ "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/session-start.mjs"],
11
+ "timeout": 2
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
17
+ }
@@ -0,0 +1,177 @@
1
+ // SessionStart hook of the TalentOS Claude Code plugin. Prints a short
2
+ // company-context primer for Claude. Dependency-free and fast: the whole run
3
+ // stays inside 2 s, and anything that goes wrong prints nothing and exits 0,
4
+ // so a session never waits on, or is told about, TalentOS being offline.
5
+ //
6
+ // A hook cannot use the OAuth sign-in Claude Code holds for the plugin's MCP
7
+ // server, so the live line (who you are, your Talent, counts) needs the key
8
+ // `npx talentos@1 init` stored on this machine. Without a key it prints the
9
+ // static primer and makes no network call. The key only ever goes to the url
10
+ // it was stored with.
11
+ import { spawn } from "node:child_process";
12
+ import { readFileSync, statSync, utimesSync, writeFileSync } from "node:fs";
13
+ import { homedir, tmpdir } from "node:os";
14
+ import { join } from "node:path";
15
+ import { pathToFileURL } from "node:url";
16
+
17
+ const BUDGET_MS = 1900;
18
+ const FETCH_MS = 1500;
19
+ const SYNC_EVERY_MS = 6 * 60 * 60 * 1000;
20
+ const FIELD_MAX = 80;
21
+ const TRAILING_SLASHES = /\/+$/u;
22
+
23
+ export const STATIC_PRIMER = [
24
+ "TalentOS is connected to this session through the `talentos` MCP server (if it asks you to sign in, run /mcp, pick talentos, choose Authenticate).",
25
+ "It holds the company's shared memory, Skills, Routines and people, and the user's Talent.",
26
+ "You do the user's work yourself; use TalentOS for company context (call `search_memory` before answering how this team works or what the user prefers) and hand work to their Talent only when the user explicitly asks.",
27
+ "Slash commands: /talentos:catch-up, /talentos:remember, /talentos:ask-talent.",
28
+ ].join(" ");
29
+
30
+ /** One line of the primer from a `whoami` result; undefined when it is not one. */
31
+ export function livePrimer(who) {
32
+ const member = clean(who?.member?.name) || clean(who?.member?.email);
33
+ const organization = clean(who?.organization?.name);
34
+ if (!(member && organization)) {
35
+ return;
36
+ }
37
+ const talent = clean(who?.talent?.name);
38
+ const counts = who?.counts ?? {};
39
+ return [
40
+ `TalentOS: signed in as ${member} at ${organization}.`,
41
+ talent ? `Their Talent is ${talent}.` : undefined,
42
+ typeof counts.companySkills === "number" &&
43
+ typeof counts.mySkills === "number"
44
+ ? `${counts.companySkills} company and ${counts.mySkills} personal Skills.`
45
+ : undefined,
46
+ typeof counts.routines === "number"
47
+ ? `${counts.routines} Routines.`
48
+ : undefined,
49
+ STATIC_PRIMER,
50
+ ]
51
+ .filter(Boolean)
52
+ .join(" ");
53
+ }
54
+
55
+ /** One line, control characters (newlines included) turned into spaces. */
56
+ function clean(value) {
57
+ if (typeof value !== "string") {
58
+ return "";
59
+ }
60
+ return Array.from(value.slice(0, FIELD_MAX * 4), (char) => {
61
+ const code = char.charCodeAt(0);
62
+ return code < 32 || code === 127 ? " " : char;
63
+ })
64
+ .join("")
65
+ .trim()
66
+ .slice(0, FIELD_MAX);
67
+ }
68
+
69
+ export function readCredentials(env, read = readFileSync) {
70
+ const stored = (() => {
71
+ try {
72
+ const root =
73
+ env.XDG_CONFIG_HOME || join(env.HOME || homedir(), ".config");
74
+ return JSON.parse(read(join(root, "talentos", "config.json"), "utf8"));
75
+ } catch {
76
+ return {};
77
+ }
78
+ })();
79
+ const apiKey = env.TALENTOS_API_KEY || stored.apiKey;
80
+ const apiUrl = env.TALENTOS_API_URL || stored.apiUrl;
81
+ if (typeof apiKey !== "string" || typeof apiUrl !== "string" || !apiKey) {
82
+ return;
83
+ }
84
+ return { apiKey, apiUrl: apiUrl.trim().replace(TRAILING_SLASHES, "") };
85
+ }
86
+
87
+ async function fetchWhoami({ apiKey, apiUrl }) {
88
+ const response = await fetch(`${apiUrl}/mcp`, {
89
+ body: JSON.stringify({
90
+ id: 1,
91
+ jsonrpc: "2.0",
92
+ method: "tools/call",
93
+ params: { arguments: {}, name: "whoami" },
94
+ }),
95
+ headers: {
96
+ Accept: "application/json, text/event-stream",
97
+ Authorization: `Bearer ${apiKey}`,
98
+ "Content-Type": "application/json",
99
+ },
100
+ method: "POST",
101
+ signal: AbortSignal.timeout(FETCH_MS),
102
+ });
103
+ if (!response.ok) {
104
+ return;
105
+ }
106
+ const body = await response.json();
107
+ return body?.result?.isError ? undefined : body?.result?.structuredContent;
108
+ }
109
+
110
+ /** Fire-and-forget Skills sync, opt-in and at most once per SYNC_EVERY_MS. */
111
+ function startSkillsSync(env) {
112
+ const stamp = join(
113
+ tmpdir(),
114
+ `talentos-skills-sync-${process.getuid?.() ?? 0}`
115
+ );
116
+ try {
117
+ if (Date.now() - statSync(stamp).mtimeMs < SYNC_EVERY_MS) {
118
+ return;
119
+ }
120
+ utimesSync(stamp, new Date(), new Date());
121
+ } catch {
122
+ writeFileSync(stamp, "");
123
+ }
124
+ spawn(
125
+ "npx",
126
+ [
127
+ "-y",
128
+ "talentos@1",
129
+ "skills",
130
+ "sync",
131
+ "--for",
132
+ "claude",
133
+ "--global",
134
+ "--company",
135
+ "--quiet",
136
+ ],
137
+ {
138
+ detached: true,
139
+ env,
140
+ shell: process.platform === "win32",
141
+ stdio: "ignore",
142
+ windowsHide: true,
143
+ }
144
+ ).unref();
145
+ }
146
+
147
+ async function main(env) {
148
+ setTimeout(() => process.exit(0), BUDGET_MS).unref();
149
+ const credentials = readCredentials(env);
150
+ let primer = STATIC_PRIMER;
151
+ if (credentials) {
152
+ try {
153
+ primer = livePrimer(await fetchWhoami(credentials));
154
+ } catch {
155
+ primer = undefined;
156
+ }
157
+ if (env.TALENTOS_SKILLS_SYNC === "1" && primer) {
158
+ try {
159
+ startSkillsSync(env);
160
+ } catch {
161
+ // Sync is a courtesy; the primer matters more.
162
+ }
163
+ }
164
+ }
165
+ if (primer) {
166
+ process.stdout.write(
167
+ `${JSON.stringify({ hookSpecificOutput: { additionalContext: primer, hookEventName: "SessionStart" } })}\n`
168
+ );
169
+ }
170
+ }
171
+
172
+ if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
173
+ main(process.env).then(
174
+ () => process.exit(0),
175
+ () => process.exit(0)
176
+ );
177
+ }