talentos 1.5.0 → 1.7.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.
@@ -0,0 +1,145 @@
1
+ import { withClient } from "../client.js";
2
+ import { emit, emitJson } from "../format.js";
3
+ import { CliError, cliContractEnabled, nextActions, withApiUrl, } from "../output.js";
4
+ import { watch } from "../watch.js";
5
+ // `talentos approvals` (ADR 0120): read-only. It lists, reads or follows the
6
+ // approvals the member has not yet decided, and prints the link they open in
7
+ // TalentOS. It has no allow, deny or open-and-approve: an approval is the
8
+ // member's tap on their own device, and anything the CLI could do the AI
9
+ // running beside it could do too.
10
+ const ACTIONS = new Set(["list", "status", "watch"]);
11
+ // approval_status answers at once, so the pause between reads is ours; it grows
12
+ // while nothing changes and resets on a change.
13
+ const POLL_START_SECONDS = 3;
14
+ const POLL_MAX_SECONDS = 15;
15
+ const MS = 1000;
16
+ const TOOL_MISSING = /Tool approval_status not found/i;
17
+ export async function runApprovals(parsed) {
18
+ if (!cliContractEnabled()) {
19
+ throw new CliError("FEATURE_DISABLED", "Approval commands need HEADLESS_CLI_V1=true until release.");
20
+ }
21
+ const action = parsed.action ?? "list";
22
+ const approvalId = parsed.args[0];
23
+ if (!ACTIONS.has(action) ||
24
+ parsed.args.length > 1 ||
25
+ (action === "list" && approvalId !== undefined)) {
26
+ throw new CliError("INVALID_ARGUMENT", "Usage: talentos approvals [list|status|watch] [approvalId] [--json]");
27
+ }
28
+ const id = action === "list" ? undefined : approvalId;
29
+ await withClient(parsed.options["api-url"], async (client) => {
30
+ const read = async (signal) => {
31
+ try {
32
+ return (await client.call("approval_status", id === undefined ? {} : { approvalId: id }, signal ? { signal } : undefined)).data;
33
+ }
34
+ catch (error) {
35
+ // A server without the tool (older, or the flag is off) says so in
36
+ // protocol words; the member gets a plain line.
37
+ if (error instanceof Error && TOOL_MISSING.test(error.message)) {
38
+ throw new Error("Following approvals isn't turned on for your workspace yet.");
39
+ }
40
+ throw error;
41
+ }
42
+ };
43
+ let latest;
44
+ if (action === "watch") {
45
+ const pacer = createPacer();
46
+ latest = await watch({
47
+ isRunning: waiting,
48
+ onChange: (value) => {
49
+ pacer.reset();
50
+ emit(render(value));
51
+ },
52
+ read: async (previous, waitSeconds, signal) => {
53
+ if (previous !== undefined && waitSeconds > 0) {
54
+ await sleep(pacer.next(waitSeconds) * MS, signal);
55
+ }
56
+ return await read(signal);
57
+ },
58
+ version: signature,
59
+ // The helper's wait ceiling (it also caps it at the time left): the
60
+ // pacer starts at POLL_START_SECONDS and grows to it.
61
+ waitSeconds: POLL_MAX_SECONDS,
62
+ });
63
+ }
64
+ else {
65
+ latest = await read();
66
+ }
67
+ const next = nextFor(latest, parsed.options["api-url"], id);
68
+ nextActions(next);
69
+ if (parsed.options.json) {
70
+ emitJson(latest);
71
+ return;
72
+ }
73
+ if (action !== "watch") {
74
+ emit(render(latest));
75
+ }
76
+ for (const action of next) {
77
+ emit(`Next: ${action.command} — ${action.why}`);
78
+ }
79
+ });
80
+ }
81
+ function waiting(value) {
82
+ return value.approvals.some((approval) => approval.status === "awaiting_human");
83
+ }
84
+ function signature(value) {
85
+ return value.approvals
86
+ .map((approval) => `${approval.approvalId}:${approval.status}`)
87
+ .join(",");
88
+ }
89
+ function nextFor(value, apiUrl, approvalId) {
90
+ const pending = value.approvals.filter((approval) => approval.status === "awaiting_human");
91
+ if (pending.length === 0) {
92
+ return [];
93
+ }
94
+ const where = pending.find((approval) => approval.link)?.link;
95
+ return [
96
+ {
97
+ // A watch of one card keeps following that card, so its decline is seen.
98
+ command: withApiUrl(approvalId === undefined
99
+ ? "talentos approvals watch"
100
+ : `talentos approvals watch ${shellQuote(approvalId)}`, apiUrl),
101
+ why: `Only the member can decide, in TalentOS${where ? ` (${where})` : ""}. Watching changes nothing; follow again afterwards.`,
102
+ },
103
+ ];
104
+ }
105
+ function render(value) {
106
+ if (value.approvals.length === 0) {
107
+ return "Nothing of yours is waiting for the member's approval.";
108
+ }
109
+ return value.approvals
110
+ .map((approval) => `${approval.status}: ${approval.what}${approval.link ? `\n Open: ${approval.link}` : ""}`)
111
+ .join("\n");
112
+ }
113
+ /** A pause that ends early, quietly, when the watch is cancelled. */
114
+ function sleep(ms, signal) {
115
+ return new Promise((resolve) => {
116
+ const timer = setTimeout(done, ms);
117
+ function done() {
118
+ clearTimeout(timer);
119
+ signal.removeEventListener("abort", done);
120
+ resolve();
121
+ }
122
+ signal.addEventListener("abort", done, { once: true });
123
+ });
124
+ }
125
+ function shellQuote(value) {
126
+ return `'${value.replaceAll("'", "'\\''")}'`;
127
+ }
128
+ /**
129
+ * The pause between reads: it starts at POLL_START_SECONDS, doubles while
130
+ * nothing changes up to the ceiling the watch passes in, and starts over on a
131
+ * change.
132
+ */
133
+ export function createPacer() {
134
+ let quiet = 0;
135
+ return {
136
+ next(ceilingSeconds) {
137
+ const pause = Math.min(POLL_START_SECONDS * 2 ** quiet, ceilingSeconds);
138
+ quiet += 1;
139
+ return pause;
140
+ },
141
+ reset() {
142
+ quiet = 0;
143
+ },
144
+ };
145
+ }
@@ -28,6 +28,8 @@ export async function diagnose(deps) {
28
28
  checkClaude(deps),
29
29
  await checkCursor(deps),
30
30
  await checkCodex(deps),
31
+ await checkJsonClient(deps, GEMINI_CLIENT),
32
+ await checkJsonClient(deps, ANTIGRAVITY_CLIENT),
31
33
  ],
32
34
  };
33
35
  if (cliContractEnabled()) {
@@ -211,6 +213,60 @@ async function checkCursor(deps) {
211
213
  }
212
214
  : finding;
213
215
  }
216
+ const GEMINI_CLIENT = {
217
+ file: "~/.gemini/settings.json",
218
+ label: "Gemini CLI",
219
+ path: [".gemini", "settings.json"],
220
+ signIn: "Run /mcp auth talentos in Gemini if it asks you to sign in.",
221
+ target: "gemini",
222
+ urlKey: "httpUrl",
223
+ };
224
+ const ANTIGRAVITY_CLIENT = {
225
+ file: "~/.gemini/config/mcp_config.json",
226
+ label: "Antigravity CLI",
227
+ path: [".gemini", "config", "mcp_config.json"],
228
+ signIn: "Open /mcp and authenticate talentos if it asks you to sign in.",
229
+ target: "antigravity",
230
+ urlKey: "serverUrl",
231
+ };
232
+ // Gemini CLI and Antigravity CLI keep TalentOS under `mcpServers.talentos`
233
+ // in a JSON file, with a key header or none (browser sign-in).
234
+ async function checkJsonClient(deps, client) {
235
+ const raw = await readIfPresent(join(deps.home, ...client.path));
236
+ const fix = `${FIX_INIT} --for ${client.target}`;
237
+ if (raw === undefined) {
238
+ return {
239
+ status: "note",
240
+ title: `${client.label}: not found on this machine.`,
241
+ };
242
+ }
243
+ let entry;
244
+ try {
245
+ entry = JSON.parse(raw).mcpServers?.talentos;
246
+ }
247
+ catch {
248
+ return {
249
+ status: "problem",
250
+ title: `${client.label}: ${client.file} is not plain JSON.`,
251
+ // Never "delete it": the file holds the member's other settings.
252
+ fix: `Add the talentos entry by hand, or remove its comments and run \`npx talentos@1 init --for ${client.target}\`.`,
253
+ };
254
+ }
255
+ if (entry === undefined) {
256
+ return {
257
+ status: "problem",
258
+ title: `${client.label} is not set up for TalentOS.`,
259
+ fix,
260
+ };
261
+ }
262
+ return keyedClientFinding(client.label, {
263
+ config: deps.config,
264
+ fix,
265
+ key: entry.headers?.Authorization?.replace(BEARER, ""),
266
+ signIn: client.signIn,
267
+ url: entry[client.urlKey],
268
+ });
269
+ }
214
270
  async function checkCodex(deps) {
215
271
  const raw = await readIfPresent(join(deps.home, ".codex", "config.toml"));
216
272
  const fix = `${FIX_INIT} --for codex`;
@@ -1,9 +1,11 @@
1
1
  import { installClaudePlugin } from "../claude-plugin.js";
2
2
  import { withClient } from "../client.js";
3
3
  import { bold, dim, emit, emitJson } from "../format.js";
4
+ import { hostingSkillDirs, installHostingSkill } from "../hosting-skill.js";
4
5
  import { agentLabel, agentTargetsFor, applyInstall, buildInstallSnippet, defaultProbe, detectAgents, homeDir, oauthNext, pullDirs, setupModeFrom, } from "../install.js";
5
6
  import { machineOutput, nextActions } from "../output.js";
6
7
  import { authorize, currentSession } from "./login.js";
8
+ import { hostingAvailable } from "./publish.js";
7
9
  import { pullInto } from "./skills.js";
8
10
  import { memberLabel } from "./whoami.js";
9
11
  const DONE = "✓";
@@ -19,7 +21,7 @@ export async function runInit(parsed) {
19
21
  const session = await signIn(parsed);
20
22
  const targets = chosenTargets(parsed.options.for);
21
23
  if (targets.length === 0) {
22
- step(false, "No agent found. Re-run with --for claude|cursor|codex.");
24
+ step(false, "No agent found. Re-run with --for claude|cursor|codex|gemini|antigravity.");
23
25
  }
24
26
  const configured = [];
25
27
  for (const target of targets) {
@@ -30,6 +32,9 @@ export async function runInit(parsed) {
30
32
  const pulled = parsed.options["no-pull"]
31
33
  ? undefined
32
34
  : await pullShared(parsed, targets);
35
+ if (!parsed.options["no-pull"]) {
36
+ await installHosting(parsed, targets);
37
+ }
33
38
  emit(summary(configured, pulled, mode));
34
39
  if (machineOutput()) {
35
40
  emitJson({ configured, pulled: pulled ?? null, mode });
@@ -117,6 +122,19 @@ async function pullShared(parsed, targets) {
117
122
  : `${pulled.length} skill(s) → ${dirs.join(", ")}`);
118
123
  return pulled.length;
119
124
  }
125
+ /**
126
+ * The Host on TalentOS skill, at user level so every project has it, only
127
+ * where the workspace has hosting on (the server shows the publish tool).
128
+ */
129
+ async function installHosting(parsed, targets) {
130
+ const available = await withClient(parsed.options["api-url"], (client) => hostingAvailable(client));
131
+ if (!available || targets.length === 0) {
132
+ return;
133
+ }
134
+ const dirs = hostingSkillDirs(homeDir(), targets);
135
+ await installHostingSkill(dirs);
136
+ step(true, `Host on TalentOS skill → ${dirs.join(", ")}`);
137
+ }
120
138
  function summary(configured, pulled, mode) {
121
139
  const agents = configured.length === 0 ? "none" : configured.map(agentLabel).join(", ");
122
140
  return [
@@ -41,7 +41,7 @@ async function runMcpInstall(parsed) {
41
41
  }
42
42
  async function installFor(target, credentials) {
43
43
  if (!isAgentTarget(target)) {
44
- throw new Error("--apply needs a client to write to: claude, cursor or codex.");
44
+ throw new Error("--apply needs a client to write to: claude, cursor, codex, gemini or antigravity.");
45
45
  }
46
46
  const outcome = await applyInstall(target, credentials);
47
47
  if (machineOutput()) {
@@ -0,0 +1,74 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { withClient } from "../client.js";
3
+ import { emit, emitJson, emitLink } from "../format.js";
4
+ import { bundleSite } from "../publish-site.js";
5
+ import { publishedPage, rememberPublishedPage } from "../published-pages.js";
6
+ export const PUBLISH_TOOL = "publish_web_app";
7
+ const SAID = {
8
+ created: (title) => `Published ${title} to your Library. Only you can open it.`,
9
+ unchanged: (title) => `${title} is already up to date.`,
10
+ updated: (title) => `Updated ${title} in your Library.`,
11
+ };
12
+ /** Whether this sign-in may publish: the server shows the tool only where hosting is on. */
13
+ export async function hostingAvailable(client) {
14
+ let cursor;
15
+ do {
16
+ const page = await client.listTools(cursor);
17
+ if (page.tools.some((tool) => tool.name === PUBLISH_TOOL)) {
18
+ return true;
19
+ }
20
+ cursor = page.nextCursor;
21
+ } while (cursor);
22
+ return false;
23
+ }
24
+ export async function runPublish(parsed) {
25
+ if (parsed.args.length > 1) {
26
+ throw new Error("Usage: talentos publish [folder|page.html] [--title <title>] [--replace]");
27
+ }
28
+ const site = await bundleSite(parsed.args[0] ?? ".");
29
+ const named = parsed.options.title?.trim() || undefined;
30
+ const published = await withClient(parsed.options["api-url"], async (client) => {
31
+ if (!(await hostingAvailable(client))) {
32
+ throw new Error("Publishing to TalentOS isn't turned on for your workspace yet.");
33
+ }
34
+ const publish = async (args) => (await client.call(PUBLISH_TOOL, {
35
+ html: site.html,
36
+ requestId: randomUUID(),
37
+ ...args,
38
+ })).data;
39
+ const create = () => publish({ title: named ?? site.title });
40
+ const before = await publishedPage(site.entry, client.apiUrl);
41
+ let result = before
42
+ ? await publish({
43
+ artifactId: before.artifactId,
44
+ baseVersionId: before.versionId,
45
+ ...(named ? { title: named } : {}),
46
+ ...(parsed.options.replace ? { replace: true } : {}),
47
+ })
48
+ : await create();
49
+ if (result.status === "missing") {
50
+ // Deleted from the Library since: this page becomes a new app.
51
+ result = await create();
52
+ }
53
+ if (result.status === "missing") {
54
+ throw new Error("TalentOS did not save the page. Try again.");
55
+ }
56
+ if (result.status !== "changed_in_talentos") {
57
+ await rememberPublishedPage(site.entry, {
58
+ apiUrl: client.apiUrl,
59
+ artifactId: result.artifactId,
60
+ versionId: result.versionId,
61
+ });
62
+ }
63
+ return result;
64
+ });
65
+ if (published.status === "changed_in_talentos") {
66
+ throw new Error(`Someone changed ${published.title} in TalentOS since it was last published from here, so nothing was replaced. To put this version over that change, run publish again with --replace.`);
67
+ }
68
+ if (parsed.options.json) {
69
+ emitJson(published);
70
+ return;
71
+ }
72
+ emit(SAID[published.status](published.title));
73
+ emitLink(published.url);
74
+ }
@@ -0,0 +1,67 @@
1
+ import { pullDirs } from "./install.js";
2
+ import { writeSkillPackage } from "./skill-files.js";
3
+ export const HOSTING_SKILL_SLUG = "host-on-talentos";
4
+ // Written by `talentos init` at user level, so it works in every project. The
5
+ // person is often not technical: the agent asks nothing it can decide itself
6
+ // and says nothing about how hosting works.
7
+ export const HOSTING_SKILL_MD = `---
8
+ name: host-on-talentos
9
+ description: Publish a web page, site, app, game, dashboard or prototype you made to TalentOS and give the person a link. Use when they say host it, publish it, put it online, share it, deploy it or give me a link, or name TalentOS hosting.
10
+ ---
11
+
12
+ # Host on TalentOS
13
+
14
+ The person wants a link to what you made. Get it to them with no questions and
15
+ no technical talk.
16
+
17
+ ## Do
18
+
19
+ 1. Find what to publish yourself: the folder with the \`index.html\` you just
20
+ made or built, or one \`.html\` file. Build it first if it needs a build.
21
+ Ask only when there are several unrelated pages and nothing says which.
22
+ 2. Run \`npx talentos@1 publish <folder or page.html>\`. Add \`--title "<name>"\`
23
+ when the page has no good \`<title>\`.
24
+ 3. Reply with one short line and the link it printed, exactly as printed. For
25
+ example: "Here it is: <link>. Only you can open it for now."
26
+
27
+ To change it later, edit the files and run the same command again. It updates
28
+ the same page at the same link, and TalentOS keeps the earlier versions.
29
+
30
+ ## When it refuses
31
+
32
+ Fix what you can and run it again without asking: copy a missing file into the
33
+ folder, move styles, scripts, images and fonts from other websites into the
34
+ folder, inline a module's imports with a single-file build, or put a second
35
+ page on \`index.html\`.
36
+
37
+ If it still can't be hosted (it needs a server, a database, an API key, or
38
+ calls another website), tell the person in one plain sentence what can't work
39
+ and what to change. Example: "TalentOS can't host the login part, because it
40
+ needs a server; I can publish the page without it."
41
+
42
+ If it says someone changed the page in TalentOS since, ask the person one
43
+ question: should this version replace that change? Run it again with
44
+ \`--replace\` only if they say yes.
45
+
46
+ If it says to sign in or that publishing is off, tell the person in one
47
+ sentence: sign in with \`npx talentos@1 init\`, or ask their TalentOS admin to
48
+ turn hosting on.
49
+
50
+ ## Never
51
+
52
+ - Never ask about rooms, settings, versions or file formats.
53
+ - Never explain bundling, sandboxes, flags or how the link works.
54
+ - Never build or rewrite the link yourself.
55
+ `;
56
+ /** The user-level skill folders of these agents, under `home`. */
57
+ export function hostingSkillDirs(home, targets) {
58
+ const dirs = targets.flatMap((target) => pullDirs({ global: true, home, target }));
59
+ return [...new Set(dirs)];
60
+ }
61
+ export async function installHostingSkill(dirs) {
62
+ for (const dir of dirs) {
63
+ await writeSkillPackage(dir, HOSTING_SKILL_SLUG, [
64
+ { path: "SKILL.md", text: HOSTING_SKILL_MD },
65
+ ]);
66
+ }
67
+ }
package/dist/index.js CHANGED
@@ -21,10 +21,12 @@ Commands:
21
21
  skills <list|get|push|pull|sync|share> Move skills; sharing stays in TalentOS
22
22
  memory <search|add> Read and write personal and company memory
23
23
  ask "<message>" Delegate work to your Talent
24
+ publish [folder|page.html] Publish a web page to your TalentOS Library
24
25
  routines <list|run> See and run your routines
25
26
  tools List the tools this member can use with input schemas
26
27
  call <tool> [--json '<args>'] Call any visible MCP tool
27
28
  task <status|watch> <id> Follow a delegated task without starting work
29
+ approvals [list|status|watch] [id] See what waits for the member's approval (read-only)
28
30
 
29
31
  Options:
30
32
  --json Print one JSON result (HEADLESS_CLI_V1=true); progress goes to stderr
@@ -40,13 +42,20 @@ const GROUP_USAGE = {
40
42
  Forwards one tool call with a JSON object (default {}). The MCP server owns
41
43
  validation, visibility, permissions and approvals. Returns the full MCP result;
42
44
  a tool error exits nonzero. Calls are never retried.`,
45
+ approvals: `talentos approvals [list] [--json]
46
+ talentos approvals status <approvalId> [--json]
47
+ talentos approvals watch [approvalId] [--json]
48
+
49
+ Reads the approvals your AI is waiting on (approval_status) and the TalentOS
50
+ link where the member decides. It cannot approve or decline anything: that is
51
+ the member's own tap. Watch follows changes until none waits, or ten minutes.`,
43
52
  task: `talentos task status <id> [--json]
44
53
  talentos task watch <id> [--json]
45
54
 
46
55
  Read a delegate_task result through get_task. Watch waits for changes on the
47
56
  server, stopping on completion, stale work, or a question for the member.
48
57
  After ten minutes it returns the latest state with a continuation command.`,
49
- agent: `talentos agent link --url <setup-url-with-#token> [--yes] [--name <device>]
58
+ agent: `talentos agent link --url <setup-url-with-#token> [--provider claude_code|codex|gemini_cli] [--yes] [--name <device>]
50
59
  talentos agent status | list [--json] [--agent <id>]
51
60
  talentos agent unlink [name] [--agent <id>]
52
61
  talentos agent logs [--agent <id>]
@@ -72,7 +81,7 @@ Says in plain words whether TalentOS answers with the key on this machine and
72
81
  whether Claude Code, Cursor and Codex are set up, with the one fix for each
73
82
  problem. Changes nothing and never prints a key. Exits 1 when something needs a
74
83
  fix.`,
75
- init: `talentos init [--for claude|cursor|codex|all] [--no-pull] [--oauth] [--name <device>]
84
+ init: `talentos init [--for claude|cursor|codex|gemini|antigravity|all] [--no-pull] [--oauth] [--name <device>]
76
85
 
77
86
  One command: signs you in (skipped when your stored key still works), writes the
78
87
  TalentOS MCP config for every agent on this machine at USER level, and
@@ -97,16 +106,16 @@ key never leaves the machine; only its hash is registered.
97
106
  logout: "talentos logout\n\nRemoves the stored key from this machine.",
98
107
  whoami: "talentos whoami [--json]",
99
108
  mcp: `talentos mcp
100
- talentos mcp install <claude|cursor|codex|json> [--apply]
109
+ talentos mcp install <claude|cursor|codex|gemini|antigravity|json> [--apply]
101
110
 
102
111
  \`mcp\` runs a stdio MCP server that forwards to your TalentOS account.
103
112
  \`mcp install\` prints the config snippet for a client; \`--apply\` writes it to
104
- that client's user-level config (claude, cursor or codex).`,
113
+ that client's user-level config (claude, cursor, codex, gemini or antigravity).`,
105
114
  skills: `talentos skills list [--mine|--company] [-q <query>]
106
115
  talentos skills get <id|slug> [--out <dir>]
107
116
  talentos skills push <SKILL.md|dir> [--id <skillId>]
108
- talentos skills pull [--for claude|cursor|codex|all] [--global] [--to <dir>] [--mine|--company]
109
- talentos skills sync [--for claude|cursor|codex|all] [--global] [--to <dir>] [--mine|--company] [--quiet]
117
+ talentos skills pull [--for claude|cursor|codex|gemini|antigravity|all] [--global] [--to <dir>] [--mine|--company]
118
+ talentos skills sync [--for claude|cursor|codex|gemini|antigravity|all] [--global] [--to <dir>] [--mine|--company] [--quiet]
110
119
  talentos skills share <id> Refuses: Share this Skill from TalentOS.
111
120
 
112
121
  \`pull\` writes to ./.agents/skills by default; \`--for claude\` writes to
@@ -118,6 +127,16 @@ here: a skill you edited stays as it is (and is reported) until you run \`pull\`
118
127
  a folder it did not write is left alone, and it never deletes files you added.`,
119
128
  memory: `talentos memory search "<query>" [--personal|--company]
120
129
  talentos memory add "<fact>" [--company]`,
130
+ publish: `talentos publish [folder|page.html] [--title <title>] [--replace] [--json]
131
+
132
+ Publishes a web page (a folder's index.html, or one .html file) to your
133
+ TalentOS Library and prints its link. Only you can open it until you share it.
134
+ The page's own styles, scripts, images and fonts from the folder go inside the
135
+ page; it loads nothing from other websites. One page per site.
136
+
137
+ Publishing the same page again updates the same app, and TalentOS keeps every
138
+ version. If someone changed the app in TalentOS since, nothing is replaced
139
+ unless you add --replace.`,
121
140
  ask: `talentos ask "<message>" [--thread <id>] [--no-wait]
122
141
 
123
142
  Waits for your Talent's reply (up to 10 minutes) unless --no-wait.`,
@@ -195,11 +214,15 @@ async function dispatch(parsed) {
195
214
  return await (await import("./commands/ask.js")).runAsk(parsed);
196
215
  case "routines":
197
216
  return await (await import("./commands/routines.js")).runRoutines(parsed);
217
+ case "publish":
218
+ return await (await import("./commands/publish.js")).runPublish(parsed);
198
219
  case "tools":
199
220
  case "call":
200
221
  return await (await import("./commands/tools.js")).runTools(parsed);
201
222
  case "task":
202
223
  return await (await import("./commands/task.js")).runTask(parsed);
224
+ case "approvals":
225
+ return await (await import("./commands/approvals.js")).runApprovals(parsed);
203
226
  case "help": {
204
227
  showHelp(parsed.args[0]);
205
228
  return;
package/dist/install.js CHANGED
@@ -5,9 +5,16 @@ import { homedir } from "node:os";
5
5
  import { dirname, join } from "node:path";
6
6
  import { mcpUrlFor } from "./config.js";
7
7
  import { OAUTH_NEXT, setupEntry, setupSnippet } from "./setup.generated.js";
8
- export const AGENT_TARGETS = ["claude", "cursor", "codex"];
8
+ export const AGENT_TARGETS = [
9
+ "claude",
10
+ "cursor",
11
+ "codex",
12
+ "gemini",
13
+ "antigravity",
14
+ ];
9
15
  export const MCP_INSTALL_TARGETS = [...AGENT_TARGETS, "json"];
10
- /** Cursor and Codex both auto-load `.agents/skills`; Claude Code reads its own. */
16
+ /** Cursor, Codex, Gemini CLI and Antigravity CLI read `.agents/skills`;
17
+ * Claude Code reads its own. */
11
18
  const AGENTS_SKILLS_DIR = ".agents/skills";
12
19
  const CLAUDE_SKILLS_DIR = ".claude/skills";
13
20
  const TOML_HEADER_START = "[";
@@ -50,6 +57,33 @@ const AGENT_SPECS = {
50
57
  merge: (existing, credentials, mode) => upsertCodexBlock(existing, credentials, mode),
51
58
  skillDirs: [AGENTS_SKILLS_DIR],
52
59
  },
60
+ // Gemini CLI (paid Gemini API key or enterprise accounts since Google moved
61
+ // personal accounts to Antigravity CLI on 2026-06-18). `oauth`: the member
62
+ // signs in with `/mcp auth talentos`, as any other app.
63
+ gemini: {
64
+ label: "Gemini CLI",
65
+ hint: "Add to ~/.gemini/settings.json:",
66
+ detect: (probe) => probe.which("gemini"),
67
+ configPath: (home) => join(home, ".gemini", "settings.json"),
68
+ render: (credentials, mode) => clientSnippet("gemini", credentials, mode),
69
+ merge: (existing, credentials, mode) => mergeJsonServer(existing, clientSnippet("gemini", credentials, mode), {
70
+ file: "~/.gemini/settings.json",
71
+ target: "gemini",
72
+ }),
73
+ skillDirs: [AGENTS_SKILLS_DIR],
74
+ },
75
+ // Antigravity CLI (agy) keeps MCP servers in their own file beside Gemini
76
+ // CLI's settings (antigravity.google/docs/cli/gcli-migration).
77
+ antigravity: {
78
+ label: "Antigravity CLI",
79
+ hint: "Add to ~/.gemini/config/mcp_config.json:",
80
+ detect: (probe) => probe.which("agy") ||
81
+ probe.exists(join(probe.home, ".gemini", "antigravity-cli")),
82
+ configPath: (home) => join(home, ".gemini", "config", "mcp_config.json"),
83
+ render: (credentials, mode) => clientSnippet("antigravity", credentials, mode),
84
+ merge: (existing, credentials, mode) => mergeJsonServer(existing, clientSnippet("antigravity", credentials, mode), { file: "~/.gemini/config/mcp_config.json", target: "antigravity" }),
85
+ skillDirs: [AGENTS_SKILLS_DIR],
86
+ },
53
87
  };
54
88
  export function isMcpInstallTarget(value) {
55
89
  return MCP_INSTALL_TARGETS.includes(value);
@@ -129,6 +163,41 @@ export function mergeCursorConfig(existing, credentials) {
129
163
  };
130
164
  return `${JSON.stringify(next, null, 2)}\n`;
131
165
  }
166
+ /**
167
+ * Sets `mcpServers.talentos` in a JSON client config to the entry in
168
+ * `snippet`, keeping every other server and setting. A file that is not a
169
+ * plain JSON object, or whose `mcpServers` is not one, is refused rather than
170
+ * overwritten. Gemini CLI also reads comments in its settings, which a rewrite
171
+ * would drop, so such a file is refused too and the member adds the entry by
172
+ * hand. No message here holds the key.
173
+ */
174
+ export function mergeJsonServer(existing, snippet, where) {
175
+ const rerun = `then run \`npx talentos@1 init --for ${where.target}\` again`;
176
+ let config = {};
177
+ if (existing !== undefined && existing.trim() !== "") {
178
+ let parsed;
179
+ try {
180
+ parsed = JSON.parse(existing);
181
+ }
182
+ catch {
183
+ throw new Error(`${where.file} is not plain JSON (comments aren't supported). Add the talentos entry by hand, or fix the file, ${rerun}.`);
184
+ }
185
+ if (!isPlainObject(parsed)) {
186
+ throw new Error(`${where.file} is not a JSON object. Fix it, ${rerun}.`);
187
+ }
188
+ config = parsed;
189
+ }
190
+ if (config.mcpServers !== undefined && !isPlainObject(config.mcpServers)) {
191
+ throw new Error(`${where.file} has an mcpServers that is not an object. Fix it, ${rerun}.`);
192
+ }
193
+ const servers = config.mcpServers ?? {};
194
+ const entry = JSON.parse(snippet)
195
+ .mcpServers.talentos;
196
+ return `${JSON.stringify({ ...config, mcpServers: { ...servers, talentos: entry } }, null, 2)}\n`;
197
+ }
198
+ function isPlainObject(value) {
199
+ return typeof value === "object" && value !== null && !Array.isArray(value);
200
+ }
132
201
  export function upsertCodexBlock(existing, credentials, mode = "key") {
133
202
  return upsertCodexSection(existing, "talentos", AGENT_SPECS.codex.render(credentials, mode));
134
203
  }