talentos 1.4.13 → 1.4.15

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.
@@ -10,7 +10,7 @@ import { redactAgentOutput, } from "../agent-link.js";
10
10
  import { gatewayLauncherPath } from "../gateway-install.js";
11
11
  import { providerPathEnv, resolveProviderBinary } from "../provider-binary.js";
12
12
  import { codexImagesProven, probeCodexImages } from "./codex-image-probe.js";
13
- import { codexRoomArgs, ROOM_TOOLS } from "./codex-policy.js";
13
+ import { codexRoomArgs, ROOM_DIRECT_TOOLS, ROOM_PROXY_ONLY_TOOLS, } from "./codex-policy.js";
14
14
  import { binaryIdentity, CodexBoundaryError, CodexProbeInterrupted, codexWebProven, probeCodexBoundary, } from "./codex-probe.js";
15
15
  import { geminiRoomArgs } from "./gemini-policy.js";
16
16
  import { GeminiBoundaryError, probeGeminiBoundary } from "./gemini-probe.js";
@@ -67,7 +67,15 @@ const CLAUDE_ISOLATION_FLAGS = [
67
67
  ];
68
68
  // What Codex prints when the required room server never listed its tools.
69
69
  const ROOM_SERVER_FAILED = /required MCP servers failed to initialize/u;
70
- const CLAUDE_TOOLS = ROOM_TOOLS.map((tool) => `mcp__talentos__${tool}`).join(",");
70
+ const CLAUDE_TOOLS = ROOM_DIRECT_TOOLS.map((tool) => `mcp__talentos__${tool}`).join(",");
71
+ // Denied as well as left out of the allow list: a denied tool is not shown to
72
+ // the model, an unlisted one is only refused when it is called.
73
+ const CLAUDE_DISALLOWED = [
74
+ "Bash",
75
+ "Agent",
76
+ "Task",
77
+ ...ROOM_PROXY_ONLY_TOOLS.map((tool) => `mcp__talentos__${tool}`),
78
+ ].join(",");
71
79
  // A room job with web: Claude's own search (run by Anthropic, it reads nothing on
72
80
  // this computer), no other built-in tool. WebFetch stays out: it would run on the
73
81
  // owner's computer and could be pointed at their network (#13155 review). Pages
@@ -468,6 +476,7 @@ export async function runProvider(input) {
468
476
  roomId: job.packet.room?.id,
469
477
  roomFileIds: roomFileIds(job.packet),
470
478
  triggerId: job.packet.trigger?.id,
479
+ ownAsk: job.native?.ownAsk,
471
480
  sessionId,
472
481
  sharedRoom: job.native?.sharedRoom,
473
482
  workspace: input.owner.workspace,
@@ -521,6 +530,7 @@ export async function runProvider(input) {
521
530
  roomId: job.packet.room?.id,
522
531
  roomFileIds: roomFileIds(job.packet),
523
532
  triggerId: job.packet.trigger?.id,
533
+ ownAsk: job.native?.ownAsk,
524
534
  sessionId,
525
535
  sharedRoom: job.native?.sharedRoom,
526
536
  signal,
@@ -576,7 +586,7 @@ export async function runProvider(input) {
576
586
  ? `${CLAUDE_TOOLS},${CLAUDE_WEB_TOOLS},${READ_PAGE_TOOL}`
577
587
  : CLAUDE_TOOLS,
578
588
  "--disallowedTools",
579
- "Bash,Agent,Task",
589
+ CLAUDE_DISALLOWED,
580
590
  "--permission-mode",
581
591
  "dontAsk",
582
592
  // None of the owner's CLAUDE.md, rules, hooks or output style. The login
@@ -52,6 +52,19 @@ export const ROOM_TOOLS = [
52
52
  "room_default_remove",
53
53
  "whoami",
54
54
  ];
55
+ // The upload tools run in the talentos CLI's stdio proxy (mcp-proxy.ts), which
56
+ // reads the file from the job's folder and streams it to storage; the server's
57
+ // own upload_file only refuses. A room-only Claude Code or Gemini CLI job
58
+ // reaches /mcp directly, with no proxy, and has no shell or file tool that could
59
+ // make a file to name, so those launches never offer these (a Codex job, which
60
+ // goes through the proxy, keeps them).
61
+ const PROXY_ONLY_TOOLS = new Set([
62
+ "upload_file",
63
+ "prepare_upload",
64
+ "commit_upload",
65
+ ]);
66
+ export const ROOM_DIRECT_TOOLS = ROOM_TOOLS.filter((tool) => !PROXY_ONLY_TOOLS.has(tool));
67
+ export const ROOM_PROXY_ONLY_TOOLS = ROOM_TOOLS.filter((tool) => PROXY_ONLY_TOOLS.has(tool));
55
68
  // A TOML inline table of string pairs, for a `-c` value.
56
69
  const tomlTable = (pairs) => `{${pairs.map(([key, value]) => `${JSON.stringify(key)}=${JSON.stringify(value)}`).join(",")}}`;
57
70
  export function codexRoomArgs(input) {
@@ -1,4 +1,4 @@
1
- import { ROOM_TOOLS } from "./codex-policy.js";
1
+ import { ROOM_DIRECT_TOOLS } from "./codex-policy.js";
2
2
  // A Gemini CLI room job's boundary, written as the CLI's own policy engine and
3
3
  // user settings (verified against @google/gemini-cli 0.65.0 with its own
4
4
  // binary: see docs/features/agent-access/README.md, "Gemini CLI"). Three layers:
@@ -34,7 +34,7 @@ denyMessage = "A room job can only use its room tools."
34
34
 
35
35
  [[rule]]
36
36
  mcpName = "${GEMINI_SERVER}"
37
- toolName = ${JSON.stringify([...ROOM_TOOLS])}
37
+ toolName = ${JSON.stringify([...ROOM_DIRECT_TOOLS])}
38
38
  decision = "allow"
39
39
  priority = 100
40
40
  `;
@@ -58,7 +58,7 @@ export function geminiRoomSettings(input) {
58
58
  httpUrl: input.mcpUrl,
59
59
  // The server lists more than a room job may use: only these are ever
60
60
  // registered with the model.
61
- includeTools: [...ROOM_TOOLS],
61
+ includeTools: [...ROOM_DIRECT_TOOLS],
62
62
  },
63
63
  },
64
64
  privacy: { usageStatisticsEnabled: false },
@@ -105,10 +105,10 @@ const OWNER_FEATURE_ARGS = [
105
105
  "features.multi_agent=false",
106
106
  "agents.enabled=false",
107
107
  "tools.experimental_request_user_input.enabled=false",
108
+ // Owner call: an owner-native Codex brings its own memory into room jobs
109
+ // (it reads it), but never writes teammates' room work into it. Room-only
110
+ // jobs keep both off (codex-policy.ts).
108
111
  "memories.generate_memories=false",
109
- // Owner call: Codex's own memory stays out of room jobs; the room is the
110
- // shared record (room-only jobs turn it off too, codex-policy.ts).
111
- "memories.use_memories=false",
112
112
  ];
113
113
  /**
114
114
  * The owner-native launch arguments, minus the hook-trust argument (built
@@ -129,6 +129,16 @@ export function codexOwnerArgs(input) {
129
129
  "-c",
130
130
  'approval_policy="never"',
131
131
  ...OWNER_FEATURE_ARGS.flatMap((flag) => ["-c", flag]),
132
+ // Never list a skill the agent cannot open (#14449): include_instructions
133
+ // hides the whole list, skip_host_skill_discovery the owner's own folders.
134
+ ...(input.ownAsk
135
+ ? []
136
+ : [
137
+ "-c",
138
+ "skills.include_instructions=false",
139
+ "-c",
140
+ "features.skip_host_skill_discovery=true",
141
+ ]),
132
142
  "-c",
133
143
  `model_catalog_json=${JSON.stringify(input.catalogPath)}`,
134
144
  "-c",
@@ -20,6 +20,7 @@ export async function prepareCodexOwnerLaunch(input) {
20
20
  await writePrivateFile(join(jobDir, "context.json"), JSON.stringify({
21
21
  ...(input.askSocket ? { askSocket: input.askSocket } : {}),
22
22
  home: input.home,
23
+ ...(input.ownAsk ? { ownAsk: true } : {}),
23
24
  ...(input.roomId ? { roomId: input.roomId } : {}),
24
25
  ...(input.roomFileIds ? { roomFileIds: input.roomFileIds } : {}),
25
26
  ...(input.triggerId ? { triggerId: input.triggerId } : {}),
@@ -56,6 +57,7 @@ export async function prepareCodexOwnerLaunch(input) {
56
57
  catalogPath,
57
58
  mcpArgs: mcp.args,
58
59
  mcpCommand: mcp.command,
60
+ ownAsk: input.ownAsk,
59
61
  prompt: input.prompt,
60
62
  sessionId: input.sessionId,
61
63
  writableRoot: input.workspace.writeRoots[0] ?? input.workspace.cwd,
@@ -184,6 +184,7 @@ export async function runHook(jobDir, raw, holdMs = HOLD_MS) {
184
184
  home: context.home,
185
185
  roomId: context.roomId,
186
186
  roomFileIds: context.roomFileIds,
187
+ skillsReadable: context.ownAsk === true,
187
188
  triggerId: context.triggerId,
188
189
  writeRoots: context.writeRoots,
189
190
  };
@@ -50,6 +50,7 @@ export async function prepareOwnerLaunch(input) {
50
50
  await writePrivateFile(join(jobDir, "context.json"), JSON.stringify({
51
51
  ...(input.askSocket ? { askSocket: input.askSocket } : {}),
52
52
  home: input.home,
53
+ ...(input.ownAsk ? { ownAsk: true } : {}),
53
54
  ...(input.roomId ? { roomId: input.roomId } : {}),
54
55
  ...(input.roomFileIds ? { roomFileIds: input.roomFileIds } : {}),
55
56
  ...(input.triggerId ? { triggerId: input.triggerId } : {}),
@@ -91,6 +92,9 @@ export async function prepareOwnerLaunch(input) {
91
92
  join(jobDir, "mcp.json"),
92
93
  "--disallowedTools",
93
94
  DISALLOWED,
95
+ // Never list a skill the agent cannot open (#14449): off unless the
96
+ // server said this is the owner's own ask, the only one the hook opens.
97
+ ...(input.ownAsk ? [] : ["--disable-slash-commands"]),
94
98
  ];
95
99
  if (input.sessionId) {
96
100
  args.push("--resume", input.sessionId);
@@ -30,6 +30,15 @@ const HOME_DIRS = [
30
30
  "Library/Application Support/Microsoft Edge",
31
31
  "Library/Application Support/1Password",
32
32
  ];
33
+ /**
34
+ * Skill folders inside a provider's own folder. The one part of it a read may
35
+ * reach, and only on the owner's own ask (#14449): the agent lists these skills
36
+ * to the model, so a skill it cannot open is a dead end. Never a write.
37
+ */
38
+ const HOME_SKILL_DIRS = [
39
+ { dir: ".claude/skills", provider: ".claude" },
40
+ { dir: ".codex/skills", provider: ".codex" },
41
+ ];
33
42
  /** Home-relative files: credentials, provider config and shell start-up files. */
34
43
  const HOME_FILES = [
35
44
  ".claude.json",
@@ -92,8 +101,22 @@ export function isInside(child, parent) {
92
101
  function homeEntries(home, names) {
93
102
  return names.map((name) => canonical(join(home, name), home, home));
94
103
  }
95
- export function protectedPaths(home) {
104
+ /**
105
+ * The skills folders by real path, each kept only when it is exactly its own
106
+ * provider folder's `skills`. Dropping anything else is deliberate and fail-closed:
107
+ * a skills folder that is a link (to ~/.ssh, to ~/.codex/sessions, or to a
108
+ * dotfiles repo) stays closed on purpose, so a link can never open what it points
109
+ * at. An owner who links their skills folder gets no skills read, never a wider one.
110
+ */
111
+ function skillFolders(home) {
112
+ return HOME_SKILL_DIRS.map((entry) => ({
113
+ dir: canonical(join(home, entry.dir), home, home),
114
+ provider: canonical(join(home, entry.provider), home, home),
115
+ })).filter((entry) => entry.dir === join(entry.provider, "skills"));
116
+ }
117
+ export function protectedPaths(home, options = {}) {
96
118
  return {
119
+ readOpen: options.skillsReadable ? skillFolders(home) : [],
97
120
  readWrite: [
98
121
  ...homeEntries(home, HOME_DIRS),
99
122
  ...homeEntries(home, HOME_FILES),
@@ -104,7 +127,11 @@ export function protectedPaths(home) {
104
127
  /** Why a canonical path is off limits, or undefined. `mode` "read" skips write-only protections. */
105
128
  export function protectedReason(path, mode, home, guard = protectedPaths(home)) {
106
129
  for (const entry of guard.readWrite) {
107
- if (isInside(path, entry)) {
130
+ // Only the entry that is a skills folder's own provider folder is lifted,
131
+ // and only for a read.
132
+ if (isInside(path, entry) &&
133
+ !(mode === "read" &&
134
+ guard.readOpen.some((open) => open.provider === entry && isInside(path, open.dir)))) {
108
135
  return "credentials or provider settings";
109
136
  }
110
137
  }
@@ -1366,7 +1366,8 @@ function classifyWrite(tool, real, ctx, content) {
1366
1366
  : allow(true);
1367
1367
  }
1368
1368
  export function classifyCall(call, context) {
1369
- const guard = context.guard ?? protectedPaths(context.home);
1369
+ const guard = context.guard ??
1370
+ protectedPaths(context.home, { skillsReadable: context.skillsReadable });
1370
1371
  const ctx = { ...context, guard, cwd: call.cwd };
1371
1372
  const { tool, toolInput: input } = call;
1372
1373
  if (tool.startsWith("mcp__")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "talentos",
3
- "version": "1.4.13",
3
+ "version": "1.4.15",
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": {