@tacitai/mcp-server 0.6.53 → 0.6.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +13 -0
- package/dist/index.js +7 -0
- package/dist/templates/role-loader.js +1 -0
- package/dist/tools/career.d.ts +20 -0
- package/dist/tools/career.js +562 -0
- package/dist/tools/exec-route.d.ts +16 -0
- package/dist/tools/exec-route.js +21 -5
- package/dist/tools/recall.js +4 -0
- package/dist/tools/registry.js +17 -2
- package/dist/tools/synthesize.js +4 -0
- package/dist/workflow-registry.d.ts +1 -0
- package/dist/workflow-registry.js +14 -0
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -563,6 +563,19 @@ export async function getRequestAutonomy(principal) {
|
|
|
563
563
|
autonomyCache.set(principal, level);
|
|
564
564
|
return level;
|
|
565
565
|
}
|
|
566
|
+
// HMAC session tokens carry autonomy_level in their payload — no API call needed
|
|
567
|
+
if (isHmacSessionToken(token)) {
|
|
568
|
+
try {
|
|
569
|
+
const payloadB64 = token.split('.')[0];
|
|
570
|
+
const payload = JSON.parse(Buffer.from(payloadB64, 'base64url').toString('utf-8'));
|
|
571
|
+
const level = parseAutonomyLevel(payload.autonomy_level);
|
|
572
|
+
autonomyCache.set(principal, level);
|
|
573
|
+
return level;
|
|
574
|
+
}
|
|
575
|
+
catch {
|
|
576
|
+
return envFallbackAutonomy();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
566
579
|
const apiUrl = (process.env['TACIT_API_URL'] ?? 'http://localhost:7473').replace(/\/$/, '');
|
|
567
580
|
try {
|
|
568
581
|
const resp = await globalThis.fetch(`${apiUrl}/api/v1/people/myself`, {
|
package/dist/index.js
CHANGED
|
@@ -58,6 +58,7 @@ import { registerLakeStructureTools } from './tools/lake-structure.js';
|
|
|
58
58
|
import { registerResearchTools } from './tools/research.js';
|
|
59
59
|
import { registerGmTools } from './tools/gm.js';
|
|
60
60
|
import { registerCaptureTools } from './tools/capture.js';
|
|
61
|
+
import { registerCareerTools } from './tools/career.js';
|
|
61
62
|
import { registerSkillTools } from './tools/skills.js';
|
|
62
63
|
import { registerWikiTools } from './tools/wiki.js';
|
|
63
64
|
import { registerVoiceTools } from './tools/voice.js';
|
|
@@ -128,6 +129,7 @@ const GUIDANCE_MAP = {
|
|
|
128
129
|
LAKE_OPERATIONS: 'Data lake operations active. Explore catalog first, then ingest/classify, then propose structure.',
|
|
129
130
|
CTO_ENGINEERING: 'CTO Engineering active. Routes engineering requests to sub-execs (Agentic Engineering Exec). Describe the engineering need.',
|
|
130
131
|
SECRETARY_CHRONICLE: 'Secretary active. Use tacit_secretary_log to record events, tacit_secretary_recall to search history.',
|
|
132
|
+
CAREER_APPLICATION: 'Career application workflow active. Use tacit_career_* tools to manage campaigns, search/add jobs, generate tailored materials, and move jobs through pipeline stages.',
|
|
131
133
|
};
|
|
132
134
|
function expandGuidance(raw, _typeName, phase) {
|
|
133
135
|
const expanded = GUIDANCE_MAP[raw];
|
|
@@ -303,6 +305,7 @@ async function run() {
|
|
|
303
305
|
'- "new exec role", "role creation", "engineering architecture" → cto_engineer',
|
|
304
306
|
'- "log decision", "meeting notes", "action items", "decision history" → secretary',
|
|
305
307
|
'- "data sources", "data lake", "classify", "taxonomy" → lake_operator',
|
|
308
|
+
'- "career", "job search", "resume", "cover letter", "job application" → career_executive',
|
|
306
309
|
'',
|
|
307
310
|
'HOW TO START:',
|
|
308
311
|
'1. For any business request, call tacit_exec_route with the user\'s intent. It returns the role, workflow type, and a script of tools to call.',
|
|
@@ -312,6 +315,9 @@ async function run() {
|
|
|
312
315
|
'5. Use tacit_workflow_prereqs to check what steps a gated tool requires.',
|
|
313
316
|
'6. After async delegation, use tacit_agent_status with agent_id and run_id to check progress and retrieve results.',
|
|
314
317
|
'',
|
|
318
|
+
'COLLABORATIVE ARTIFACTS:',
|
|
319
|
+
'- When any workflow needs a shared tracker, sign-off sheet, dependency checklist, or approval form where multiple people update status, use /artifact-design-collab (db+user capabilities, realtime sync, permission-aware forms, viewer identity).',
|
|
320
|
+
'',
|
|
315
321
|
'RULES:',
|
|
316
322
|
'- Workflows enforce ordered phases. Complete prerequisites before write operations.',
|
|
317
323
|
'- Wiki writes require approval. KB and lake reads are ungated.',
|
|
@@ -386,6 +392,7 @@ async function run() {
|
|
|
386
392
|
registerLakeStructureTools(server, getClient);
|
|
387
393
|
registerGmTools(server, getClient, gate);
|
|
388
394
|
registerCaptureTools(server, getClient);
|
|
395
|
+
registerCareerTools(server, getClient);
|
|
389
396
|
registerResearchTools(server, getClient, getRequestPrincipal);
|
|
390
397
|
registerSkillTools(server, getClient);
|
|
391
398
|
registerWikiTools(server, getClient);
|
|
@@ -95,4 +95,5 @@ const FALLBACK_TEMPLATES = [
|
|
|
95
95
|
{ slug: 'lake_operator', display_name: 'Lake Operator', description: 'Manages data lake ingestion, classification, taxonomy, and structure proposals.', icon: 'database', default_capabilities: ['lake_ingestion', 'classification', 'taxonomy_management', 'structure_proposals'], workflow_types: ['lake_operations'] },
|
|
96
96
|
{ slug: 'access_administrator', display_name: 'Access Administrator', description: 'Manages workspace membership, role assignments, and capability denials via IAM tools.', icon: 'shield', default_capabilities: ['iam_membership', 'iam_role_management', 'iam_denial_management'], workflow_types: ['iam_membership_ops', 'iam_access_review'] },
|
|
97
97
|
{ slug: 'security_officer', display_name: 'Security Officer', description: 'Manages credential inventory, rotation tracking, and T3 approval workflows.', icon: 'lock', default_capabilities: ['secret_inventory', 'rotation_tracking', 't3_approval'], workflow_types: ['security_audit', 'secret_rotation'] },
|
|
98
|
+
{ slug: 'career_executive', display_name: 'Career Executive', description: 'Manages career application pipeline — job search, campaigns, tailored resume and cover letter generation.', icon: 'target', default_capabilities: ['career_enabled', 'crew.run', 'chronicle.write'], workflow_types: ['career_application'] },
|
|
98
99
|
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Career tools — MV-1543 W2: Career executive MCP tools.
|
|
3
|
+
*
|
|
4
|
+
* 15 tools:
|
|
5
|
+
* READ: tacit_career_list_campaigns, tacit_career_search_status,
|
|
6
|
+
* tacit_career_list_jobs, tacit_career_get_job,
|
|
7
|
+
* tacit_career_list_materials, tacit_career_generate_status
|
|
8
|
+
* WRITE: tacit_career_create_campaign, tacit_career_seed_pyramid,
|
|
9
|
+
* tacit_career_search_jobs, tacit_career_add_job,
|
|
10
|
+
* tacit_career_update_job, tacit_career_move_job,
|
|
11
|
+
* tacit_career_attach_material, tacit_career_detach_material,
|
|
12
|
+
* tacit_career_generate_material
|
|
13
|
+
*
|
|
14
|
+
* SEC-4: WRITE tools check FEATURE_CAREER_EXEC at the MCP layer (double gate
|
|
15
|
+
* with backend). READ tools (list/get/status) are ungated so users can still
|
|
16
|
+
* view their data when the feature is disabled.
|
|
17
|
+
*/
|
|
18
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
19
|
+
import { TacitClient } from '../client.js';
|
|
20
|
+
export declare function registerCareerTools(server: McpServer, getClientFn: () => Promise<TacitClient>): void;
|
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Career tools — MV-1543 W2: Career executive MCP tools.
|
|
3
|
+
*
|
|
4
|
+
* 15 tools:
|
|
5
|
+
* READ: tacit_career_list_campaigns, tacit_career_search_status,
|
|
6
|
+
* tacit_career_list_jobs, tacit_career_get_job,
|
|
7
|
+
* tacit_career_list_materials, tacit_career_generate_status
|
|
8
|
+
* WRITE: tacit_career_create_campaign, tacit_career_seed_pyramid,
|
|
9
|
+
* tacit_career_search_jobs, tacit_career_add_job,
|
|
10
|
+
* tacit_career_update_job, tacit_career_move_job,
|
|
11
|
+
* tacit_career_attach_material, tacit_career_detach_material,
|
|
12
|
+
* tacit_career_generate_material
|
|
13
|
+
*
|
|
14
|
+
* SEC-4: WRITE tools check FEATURE_CAREER_EXEC at the MCP layer (double gate
|
|
15
|
+
* with backend). READ tools (list/get/status) are ungated so users can still
|
|
16
|
+
* view their data when the feature is disabled.
|
|
17
|
+
*/
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
import dns from 'node:dns/promises';
|
|
20
|
+
import { TacitApiError, TokenExpiredError } from '../client.js';
|
|
21
|
+
import { featureDisabledResult } from './errors.js';
|
|
22
|
+
function flagGuard() {
|
|
23
|
+
if (process.env['FEATURE_CAREER_EXEC'] === 'true')
|
|
24
|
+
return null;
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: 'text', text: 'FEATURE_CAREER_EXEC is not enabled on this cell.' }],
|
|
27
|
+
isError: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function ok(data) {
|
|
31
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
32
|
+
}
|
|
33
|
+
function apiErrorResult(err, toolName) {
|
|
34
|
+
if (err instanceof TokenExpiredError) {
|
|
35
|
+
return { content: [{ type: 'text', text: err.message }], isError: true };
|
|
36
|
+
}
|
|
37
|
+
if (err instanceof TacitApiError) {
|
|
38
|
+
const disabled = featureDisabledResult(err);
|
|
39
|
+
if (disabled)
|
|
40
|
+
return disabled;
|
|
41
|
+
return { content: [{ type: 'text', text: `API error ${err.statusCode} on ${toolName}: ${err.body}` }], isError: true };
|
|
42
|
+
}
|
|
43
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
44
|
+
return { content: [{ type: 'text', text: `Error: ${msg}` }], isError: true };
|
|
45
|
+
}
|
|
46
|
+
// ─── SSRF guard (SEC-2 / R12) ─────────────────────────────────────────────
|
|
47
|
+
function isPrivateIp(ip) {
|
|
48
|
+
// Strip IPv4-mapped IPv6 prefix
|
|
49
|
+
const addr = ip.startsWith('::ffff:') ? ip.slice(7) : ip;
|
|
50
|
+
// IPv6 loopback
|
|
51
|
+
if (addr === '::1' || ip === '::1')
|
|
52
|
+
return true;
|
|
53
|
+
const parts = addr.split('.').map(Number);
|
|
54
|
+
if (parts.length === 4 && parts.every((n) => n >= 0 && n <= 255)) {
|
|
55
|
+
const [a, b] = parts;
|
|
56
|
+
if (a === 127)
|
|
57
|
+
return true; // 127.0.0.0/8
|
|
58
|
+
if (a === 10)
|
|
59
|
+
return true; // 10.0.0.0/8
|
|
60
|
+
if (a === 172 && b >= 16 && b <= 31)
|
|
61
|
+
return true; // 172.16.0.0/12
|
|
62
|
+
if (a === 192 && b === 168)
|
|
63
|
+
return true; // 192.168.0.0/16
|
|
64
|
+
if (a === 169 && b === 254)
|
|
65
|
+
return true; // 169.254.0.0/16 (link-local / metadata)
|
|
66
|
+
if (a === 0)
|
|
67
|
+
return true; // 0.0.0.0/8
|
|
68
|
+
}
|
|
69
|
+
// IPv6 private ranges (fc00::/7, fe80::/10)
|
|
70
|
+
const lower = ip.toLowerCase();
|
|
71
|
+
if (lower.startsWith('fc') || lower.startsWith('fd'))
|
|
72
|
+
return true;
|
|
73
|
+
if (lower.startsWith('fe80'))
|
|
74
|
+
return true;
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
async function validateUrlNotPrivate(rawUrl) {
|
|
78
|
+
let parsed;
|
|
79
|
+
try {
|
|
80
|
+
parsed = new URL(rawUrl);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return 'Invalid URL';
|
|
84
|
+
}
|
|
85
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
86
|
+
return `Refused: non-HTTP protocol ${parsed.protocol}`;
|
|
87
|
+
}
|
|
88
|
+
// Extract hostname (strip brackets from IPv6 literals)
|
|
89
|
+
let hostname = parsed.hostname;
|
|
90
|
+
if (hostname.startsWith('[') && hostname.endsWith(']')) {
|
|
91
|
+
hostname = hostname.slice(1, -1);
|
|
92
|
+
}
|
|
93
|
+
// Check if hostname is already an IP literal
|
|
94
|
+
if (isPrivateIp(hostname)) {
|
|
95
|
+
return `Refused: URL points to private/loopback address (${hostname})`;
|
|
96
|
+
}
|
|
97
|
+
// Resolve hostname to check for DNS rebinding to private IPs
|
|
98
|
+
try {
|
|
99
|
+
const results = await dns.lookup(hostname, { all: true });
|
|
100
|
+
for (const r of results) {
|
|
101
|
+
if (isPrivateIp(r.address)) {
|
|
102
|
+
return `Refused: hostname "${hostname}" resolves to private/internal address ${r.address}`;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return `Refused: cannot resolve hostname "${hostname}"`;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
// ─── Schemas ───────────────────────────────────────────────────────────────
|
|
112
|
+
const listCampaignsSchema = z.object({});
|
|
113
|
+
const createCampaignSchema = z.object({
|
|
114
|
+
title: z.string().describe('Campaign name (e.g. "Senior Engineer — Q4 2026")'),
|
|
115
|
+
description: z.string().optional().describe('Campaign description'),
|
|
116
|
+
});
|
|
117
|
+
const seedPyramidSchema = z.object({});
|
|
118
|
+
const searchJobsSchema = z.object({
|
|
119
|
+
portfolio_id: z.string().uuid().describe('Campaign portfolio UUID'),
|
|
120
|
+
query: z.string().describe('Job search query (e.g. "senior software engineer")'),
|
|
121
|
+
company: z.string().optional().describe('Company name filter'),
|
|
122
|
+
location: z.string().optional().describe('Location filter (e.g. "Remote", "Vancouver BC")'),
|
|
123
|
+
sites: z.array(z.string()).optional().describe('Job sites to search (e.g. ["linkedin", "indeed"])'),
|
|
124
|
+
salary_min: z.number().optional().describe('Minimum salary filter'),
|
|
125
|
+
salary_max: z.number().optional().describe('Maximum salary filter'),
|
|
126
|
+
hours_old: z.number().optional().describe('Only postings from the last N hours'),
|
|
127
|
+
max_results: z.number().optional().describe('Max results per site (default 10)'),
|
|
128
|
+
});
|
|
129
|
+
const searchStatusSchema = z.object({
|
|
130
|
+
portfolio_id: z.string().uuid().describe('Campaign portfolio UUID'),
|
|
131
|
+
run_id: z.string().uuid().describe('Search run UUID'),
|
|
132
|
+
});
|
|
133
|
+
const listJobsSchema = z.object({
|
|
134
|
+
portfolio_id: z.string().uuid().optional().describe('Campaign portfolio UUID (omit for all campaigns)'),
|
|
135
|
+
status: z.string().optional().describe('Filter by job status (e.g. "saved", "applied", "interviewing")'),
|
|
136
|
+
query: z.string().optional().describe('Free-text search within job titles/companies'),
|
|
137
|
+
});
|
|
138
|
+
const getJobSchema = z.object({
|
|
139
|
+
artifact_id: z.string().uuid().describe('Job artifact UUID'),
|
|
140
|
+
});
|
|
141
|
+
const addJobSchema = z.object({
|
|
142
|
+
portfolio_id: z.string().uuid().describe('Campaign portfolio UUID'),
|
|
143
|
+
url: z.string().optional().describe('Job posting URL to fetch and extract'),
|
|
144
|
+
text: z.string().optional().describe('Pasted job posting text (when URL is unavailable)'),
|
|
145
|
+
job_title: z.string().describe('Job title (required)'),
|
|
146
|
+
company_name: z.string().optional().describe('Company name'),
|
|
147
|
+
location: z.string().optional().describe('Job location'),
|
|
148
|
+
employment_type: z.string().optional().describe('Employment type (e.g. "full_time", "contract")'),
|
|
149
|
+
});
|
|
150
|
+
const updateJobSchema = z.object({
|
|
151
|
+
artifact_id: z.string().uuid().describe('Job artifact UUID'),
|
|
152
|
+
title: z.string().optional().describe('Updated artifact title'),
|
|
153
|
+
job_title: z.string().optional().describe('Updated job title'),
|
|
154
|
+
company_name: z.string().optional().describe('Updated company name'),
|
|
155
|
+
location: z.string().optional().describe('Updated location'),
|
|
156
|
+
salary_min: z.number().optional().describe('Updated minimum salary'),
|
|
157
|
+
salary_max: z.number().optional().describe('Updated maximum salary'),
|
|
158
|
+
salary_currency: z.string().optional().describe('Salary currency code (e.g. "CAD", "USD")'),
|
|
159
|
+
employment_type: z.string().optional().describe('Updated employment type'),
|
|
160
|
+
notes: z.string().optional().describe('Personal notes about the job'),
|
|
161
|
+
});
|
|
162
|
+
const moveJobSchema = z.object({
|
|
163
|
+
ids: z.array(z.string().uuid()).min(1).describe('Job artifact UUIDs to move'),
|
|
164
|
+
target_status: z.string().describe('Target status (e.g. "saved", "applied", "interviewing", "offered")'),
|
|
165
|
+
confirm_user_instruction: z.boolean().optional().describe('Set true to confirm moving to a guarded status (applied/interviewing/offered/declined/rejected/closed)'),
|
|
166
|
+
});
|
|
167
|
+
const attachMaterialSchema = z.object({
|
|
168
|
+
job_artifact_id: z.string().uuid().describe('Parent job artifact UUID'),
|
|
169
|
+
content: z.string().optional().describe('Material content text'),
|
|
170
|
+
existing_artifact_id: z.string().uuid().optional().describe('UUID of an existing artifact to attach'),
|
|
171
|
+
file_path: z.string().optional().describe('Path to a local file (.md, .txt, .pdf — max 10 MB, user-provided path only)'),
|
|
172
|
+
});
|
|
173
|
+
const detachMaterialSchema = z.object({
|
|
174
|
+
material_artifact_id: z.string().uuid().describe('Material artifact UUID to detach'),
|
|
175
|
+
});
|
|
176
|
+
const listMaterialsSchema = z.object({
|
|
177
|
+
portfolio_id: z.string().uuid().describe('Campaign portfolio UUID'),
|
|
178
|
+
scope: z.enum(['all', 'linked', 'unlinked']).optional().describe('Filter by link status (default: all)'),
|
|
179
|
+
query: z.string().optional().describe('Free-text search within materials'),
|
|
180
|
+
unlinked_only: z.boolean().optional().describe('Show only materials not linked to any job'),
|
|
181
|
+
});
|
|
182
|
+
const generateMaterialSchema = z.object({
|
|
183
|
+
job_artifact_id: z.string().uuid().describe('Job artifact UUID to generate material for'),
|
|
184
|
+
artifact_type: z.enum(['tailored_resume', 'cover_letter']).describe('Type of material to generate'),
|
|
185
|
+
});
|
|
186
|
+
const generateStatusSchema = z.object({
|
|
187
|
+
run_id: z.string().uuid().describe('Agent run UUID from generate_material'),
|
|
188
|
+
include_receipt: z.boolean().optional().describe('Include the full run receipt with claims manifest'),
|
|
189
|
+
});
|
|
190
|
+
// ─── Registration ──────────────────────────────────────────────────────────
|
|
191
|
+
export function registerCareerTools(server, getClientFn) {
|
|
192
|
+
// ── 1. tacit_career_list_campaigns ─────────────────────────────────────
|
|
193
|
+
server.tool('tacit_career_list_campaigns', 'List all career campaign portfolios (job_search domain). Returns portfolio id, title, description, job counts.', listCampaignsSchema.shape, async () => {
|
|
194
|
+
try {
|
|
195
|
+
const client = await getClientFn();
|
|
196
|
+
const res = await client.get('/api/v1/portfolios', { domain_schema_id: 'job_search' });
|
|
197
|
+
return ok(res);
|
|
198
|
+
}
|
|
199
|
+
catch (err) {
|
|
200
|
+
return apiErrorResult(err, 'tacit_career_list_campaigns');
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
// ── 2. tacit_career_create_campaign ────────────────────────────────────
|
|
204
|
+
server.tool('tacit_career_create_campaign', 'Create a new career campaign portfolio. Sets domain_schema_id to job_search automatically.', createCampaignSchema.shape, async (args) => {
|
|
205
|
+
const blocked = flagGuard();
|
|
206
|
+
if (blocked)
|
|
207
|
+
return blocked;
|
|
208
|
+
try {
|
|
209
|
+
const client = await getClientFn();
|
|
210
|
+
const input = args;
|
|
211
|
+
const res = await client.post('/api/v1/portfolios', {
|
|
212
|
+
name: input.title,
|
|
213
|
+
pillar: 'INTERNAL',
|
|
214
|
+
domain_schema_id: 'job_search',
|
|
215
|
+
});
|
|
216
|
+
return ok(res);
|
|
217
|
+
}
|
|
218
|
+
catch (err) {
|
|
219
|
+
return apiErrorResult(err, 'tacit_career_create_campaign');
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
// ── 3. tacit_career_seed_pyramid ───────────────────────────────────────
|
|
223
|
+
server.tool('tacit_career_seed_pyramid', 'Seed the career job-search pyramid template (value streams, programs). Idempotent — safe to call if already seeded. Checks current state first.', seedPyramidSchema.shape, async () => {
|
|
224
|
+
const blocked = flagGuard();
|
|
225
|
+
if (blocked)
|
|
226
|
+
return blocked;
|
|
227
|
+
try {
|
|
228
|
+
const client = await getClientFn();
|
|
229
|
+
const check = await client.get('/api/v1/alignment/pyramid-seeded');
|
|
230
|
+
if (check?.['seeded'] === true) {
|
|
231
|
+
return ok({ already_seeded: true, ...check });
|
|
232
|
+
}
|
|
233
|
+
const res = await client.post('/api/v1/alignment/seed-job-search-template', {});
|
|
234
|
+
return ok(res);
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
return apiErrorResult(err, 'tacit_career_seed_pyramid');
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
// ── 4. tacit_career_search_jobs ────────────────────────────────────────
|
|
241
|
+
server.tool('tacit_career_search_jobs', 'Launch a job search across configured sites. Returns a run_id for polling status. The search runs asynchronously — use tacit_career_search_status to check results.', searchJobsSchema.shape, async (args) => {
|
|
242
|
+
const blocked = flagGuard();
|
|
243
|
+
if (blocked)
|
|
244
|
+
return blocked;
|
|
245
|
+
try {
|
|
246
|
+
const client = await getClientFn();
|
|
247
|
+
const input = args;
|
|
248
|
+
const body = { query: input.query };
|
|
249
|
+
if (input.company)
|
|
250
|
+
body['company'] = input.company;
|
|
251
|
+
if (input.location)
|
|
252
|
+
body['location'] = input.location;
|
|
253
|
+
if (input.sites)
|
|
254
|
+
body['sites'] = input.sites;
|
|
255
|
+
if (input.salary_min !== undefined)
|
|
256
|
+
body['salary_min'] = input.salary_min;
|
|
257
|
+
if (input.salary_max !== undefined)
|
|
258
|
+
body['salary_max'] = input.salary_max;
|
|
259
|
+
if (input.hours_old !== undefined)
|
|
260
|
+
body['hours_old'] = input.hours_old;
|
|
261
|
+
if (input.max_results !== undefined)
|
|
262
|
+
body['max_results'] = input.max_results;
|
|
263
|
+
const res = await client.post(`/api/v1/portfolios/${input.portfolio_id}/job-search`, body);
|
|
264
|
+
return ok(res);
|
|
265
|
+
}
|
|
266
|
+
catch (err) {
|
|
267
|
+
return apiErrorResult(err, 'tacit_career_search_jobs');
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
// ── 5. tacit_career_search_status ──────────────────────────────────────
|
|
271
|
+
server.tool('tacit_career_search_status', 'Check the status of a job search run. Returns channel_results with per-site hits when complete.', searchStatusSchema.shape, async (args) => {
|
|
272
|
+
try {
|
|
273
|
+
const client = await getClientFn();
|
|
274
|
+
const { portfolio_id, run_id } = args;
|
|
275
|
+
const res = await client.get(`/api/v1/portfolios/${portfolio_id}/job-search/${run_id}`);
|
|
276
|
+
return ok(res);
|
|
277
|
+
}
|
|
278
|
+
catch (err) {
|
|
279
|
+
return apiErrorResult(err, 'tacit_career_search_status');
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
// ── 6. tacit_career_list_jobs ──────────────────────────────────────────
|
|
283
|
+
server.tool('tacit_career_list_jobs', 'List job postings in a campaign. Optionally filter by status or search query. Omit portfolio_id to list across all campaigns.', listJobsSchema.shape, async (args) => {
|
|
284
|
+
try {
|
|
285
|
+
const client = await getClientFn();
|
|
286
|
+
const input = args;
|
|
287
|
+
const params = {
|
|
288
|
+
type: 'career_posting',
|
|
289
|
+
};
|
|
290
|
+
if (input.status)
|
|
291
|
+
params['status'] = input.status;
|
|
292
|
+
if (input.query)
|
|
293
|
+
params['query'] = input.query;
|
|
294
|
+
const endpoint = input.portfolio_id
|
|
295
|
+
? `/api/v1/portfolios/${input.portfolio_id}/artifacts`
|
|
296
|
+
: '/api/v1/artifacts';
|
|
297
|
+
const res = await client.get(endpoint, params);
|
|
298
|
+
return ok(res);
|
|
299
|
+
}
|
|
300
|
+
catch (err) {
|
|
301
|
+
return apiErrorResult(err, 'tacit_career_list_jobs');
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
// ── 7. tacit_career_get_job ────────────────────────────────────────────
|
|
305
|
+
server.tool('tacit_career_get_job', 'Get a job posting with its linked materials and claims_manifest. Returns the job artifact, attached career materials, and structured claims from generated content.', getJobSchema.shape, async (args) => {
|
|
306
|
+
try {
|
|
307
|
+
const client = await getClientFn();
|
|
308
|
+
const { artifact_id } = args;
|
|
309
|
+
const jobList = await client.get('/api/v1/artifacts', { artifact_id, type: 'career_posting' });
|
|
310
|
+
const jobs = (jobList?.['artifacts'] ?? jobList?.['data'] ?? [jobList]);
|
|
311
|
+
const job = jobs.find((j) => j['artifact_id'] === artifact_id) ?? jobs[0];
|
|
312
|
+
if (!job) {
|
|
313
|
+
return { content: [{ type: 'text', text: `Job artifact ${artifact_id} not found.` }], isError: true };
|
|
314
|
+
}
|
|
315
|
+
const portfolioId = job['portfolio_id'];
|
|
316
|
+
let materials = [];
|
|
317
|
+
if (portfolioId) {
|
|
318
|
+
materials = await client.get(`/api/v1/portfolios/${portfolioId}/artifacts`, {
|
|
319
|
+
type: 'career_material',
|
|
320
|
+
job_artifact_id: artifact_id,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
const metadata = (job['structured_metadata'] ?? {});
|
|
324
|
+
return ok({
|
|
325
|
+
job,
|
|
326
|
+
materials,
|
|
327
|
+
claims_manifest: metadata['claims_manifest'] ?? null,
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
catch (err) {
|
|
331
|
+
return apiErrorResult(err, 'tacit_career_get_job');
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
// ── 8. tacit_career_add_job ────────────────────────────────────────────
|
|
335
|
+
server.tool('tacit_career_add_job', 'Add a job posting to a campaign. Provide a URL (fetched and extracted), pasted text, or structured fields. job_title is always required. Deduplicates on URL — returns the existing card with duplicate:true on conflict.', addJobSchema.shape, async (args) => {
|
|
336
|
+
const blocked = flagGuard();
|
|
337
|
+
if (blocked)
|
|
338
|
+
return blocked;
|
|
339
|
+
try {
|
|
340
|
+
const client = await getClientFn();
|
|
341
|
+
const input = args;
|
|
342
|
+
// SEC-2: SSRF guard — refuse private/loopback/metadata URLs
|
|
343
|
+
if (input.url) {
|
|
344
|
+
const ssrfError = await validateUrlNotPrivate(input.url);
|
|
345
|
+
if (ssrfError) {
|
|
346
|
+
return { content: [{ type: 'text', text: `Refused: URL blocked by SSRF guard — ${ssrfError}` }], isError: true };
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
const metadata = {
|
|
350
|
+
job_title: input.job_title,
|
|
351
|
+
company_name: input.company_name,
|
|
352
|
+
location: input.location,
|
|
353
|
+
employment_type: input.employment_type,
|
|
354
|
+
status: 'saved',
|
|
355
|
+
};
|
|
356
|
+
if (input.url)
|
|
357
|
+
metadata['posting_url'] = input.url;
|
|
358
|
+
const body = {
|
|
359
|
+
title: input.job_title,
|
|
360
|
+
domain: 'CAREER',
|
|
361
|
+
portfolio_id: input.portfolio_id,
|
|
362
|
+
structured_metadata: metadata,
|
|
363
|
+
};
|
|
364
|
+
if (input.text)
|
|
365
|
+
body['content_body'] = input.text;
|
|
366
|
+
try {
|
|
367
|
+
const res = await client.post('/api/v1/artifacts', body);
|
|
368
|
+
return ok({ ...res, duplicate: false });
|
|
369
|
+
}
|
|
370
|
+
catch (fetchErr) {
|
|
371
|
+
if (fetchErr instanceof TacitApiError && fetchErr.statusCode === 409) {
|
|
372
|
+
let existingId;
|
|
373
|
+
try {
|
|
374
|
+
const parsed = JSON.parse(fetchErr.body ?? '{}');
|
|
375
|
+
existingId = parsed.existing_artifact_id;
|
|
376
|
+
}
|
|
377
|
+
catch { /* ignore parse errors */ }
|
|
378
|
+
return ok({ duplicate: true, existing_artifact_id: existingId, message: 'A job with this URL already exists.', body: fetchErr.body });
|
|
379
|
+
}
|
|
380
|
+
throw fetchErr;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
catch (err) {
|
|
384
|
+
return apiErrorResult(err, 'tacit_career_add_job');
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
// ── 9. tacit_career_update_job ─────────────────────────────────────────
|
|
388
|
+
server.tool('tacit_career_update_job', 'Update a job posting\'s title or metadata fields. Title goes through artifact PATCH; metadata fields through metadata PATCH.', updateJobSchema.shape, async (args) => {
|
|
389
|
+
const blocked = flagGuard();
|
|
390
|
+
if (blocked)
|
|
391
|
+
return blocked;
|
|
392
|
+
try {
|
|
393
|
+
const client = await getClientFn();
|
|
394
|
+
const input = args;
|
|
395
|
+
const results = [];
|
|
396
|
+
if (input.title) {
|
|
397
|
+
const titleRes = await client.patch(`/api/v1/artifacts/${input.artifact_id}`, {
|
|
398
|
+
title: input.title,
|
|
399
|
+
});
|
|
400
|
+
results.push({ title_update: titleRes });
|
|
401
|
+
}
|
|
402
|
+
const metaFields = {};
|
|
403
|
+
if (input.job_title)
|
|
404
|
+
metaFields['job_title'] = input.job_title;
|
|
405
|
+
if (input.company_name)
|
|
406
|
+
metaFields['company_name'] = input.company_name;
|
|
407
|
+
if (input.location)
|
|
408
|
+
metaFields['location'] = input.location;
|
|
409
|
+
if (input.salary_min !== undefined)
|
|
410
|
+
metaFields['salary_min'] = input.salary_min;
|
|
411
|
+
if (input.salary_max !== undefined)
|
|
412
|
+
metaFields['salary_max'] = input.salary_max;
|
|
413
|
+
if (input.salary_currency)
|
|
414
|
+
metaFields['salary_currency'] = input.salary_currency;
|
|
415
|
+
if (input.employment_type)
|
|
416
|
+
metaFields['employment_type'] = input.employment_type;
|
|
417
|
+
if (input.notes !== undefined)
|
|
418
|
+
metaFields['notes'] = input.notes;
|
|
419
|
+
if (Object.keys(metaFields).length > 0) {
|
|
420
|
+
const metaRes = await client.patch(`/api/v1/artifacts/${input.artifact_id}/metadata`, { metadata_updates: metaFields });
|
|
421
|
+
results.push({ metadata_update: metaRes });
|
|
422
|
+
}
|
|
423
|
+
return ok(results.length === 1 ? results[0] : results);
|
|
424
|
+
}
|
|
425
|
+
catch (err) {
|
|
426
|
+
return apiErrorResult(err, 'tacit_career_update_job');
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
// ── 10. tacit_career_move_job ──────────────────────────────────────────
|
|
430
|
+
server.tool('tacit_career_move_job', 'Move one or more job postings to a new status. Guarded statuses (applied, interviewing, offered, declined, rejected, closed) require confirm_user_instruction:true. Returns per-id results.', moveJobSchema.shape, async (args) => {
|
|
431
|
+
const blocked = flagGuard();
|
|
432
|
+
if (blocked)
|
|
433
|
+
return blocked;
|
|
434
|
+
try {
|
|
435
|
+
const client = await getClientFn();
|
|
436
|
+
const input = args;
|
|
437
|
+
const guarded = ['applied', 'interviewing', 'offered', 'declined', 'rejected', 'closed'];
|
|
438
|
+
if (guarded.includes(input.target_status) && !input.confirm_user_instruction) {
|
|
439
|
+
return {
|
|
440
|
+
content: [{
|
|
441
|
+
type: 'text',
|
|
442
|
+
text: `Moving to "${input.target_status}" requires explicit user instruction. Set confirm_user_instruction:true if the user asked for this move.`,
|
|
443
|
+
}],
|
|
444
|
+
isError: true,
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
const results = [];
|
|
448
|
+
for (const id of input.ids) {
|
|
449
|
+
try {
|
|
450
|
+
const res = await client.patch(`/api/v1/artifacts/${id}/metadata`, {
|
|
451
|
+
metadata_updates: { application_status: input.target_status },
|
|
452
|
+
});
|
|
453
|
+
results.push({ id, ok: true, data: res });
|
|
454
|
+
}
|
|
455
|
+
catch (moveErr) {
|
|
456
|
+
const msg = moveErr instanceof Error ? moveErr.message : String(moveErr);
|
|
457
|
+
results.push({ id, ok: false, error: msg });
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return ok(results);
|
|
461
|
+
}
|
|
462
|
+
catch (err) {
|
|
463
|
+
return apiErrorResult(err, 'tacit_career_move_job');
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
// ── 11. tacit_career_attach_material ───────────────────────────────────
|
|
467
|
+
server.tool('tacit_career_attach_material', 'Attach a career material (resume, cover letter, etc.) to a job posting. Provide content text, an existing artifact id, or a file path (.md/.txt/.pdf, max 10 MB, user-provided path only). The single attach path (SEC-7).', attachMaterialSchema.shape, async (args) => {
|
|
468
|
+
const blocked = flagGuard();
|
|
469
|
+
if (blocked)
|
|
470
|
+
return blocked;
|
|
471
|
+
try {
|
|
472
|
+
const client = await getClientFn();
|
|
473
|
+
const input = args;
|
|
474
|
+
const body = {};
|
|
475
|
+
if (input.content)
|
|
476
|
+
body['content'] = input.content;
|
|
477
|
+
if (input.existing_artifact_id)
|
|
478
|
+
body['existing_artifact_id'] = input.existing_artifact_id;
|
|
479
|
+
if (input.file_path)
|
|
480
|
+
body['file_path'] = input.file_path;
|
|
481
|
+
const res = await client.post(`/api/v1/artifacts/${input.job_artifact_id}/career-material`, body);
|
|
482
|
+
return ok(res);
|
|
483
|
+
}
|
|
484
|
+
catch (err) {
|
|
485
|
+
return apiErrorResult(err, 'tacit_career_attach_material');
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
// ── 12. tacit_career_detach_material ───────────────────────────────────
|
|
489
|
+
server.tool('tacit_career_detach_material', 'Detach a career material from its parent job posting. Sets job_artifact_id to null on the material artifact.', detachMaterialSchema.shape, async (args) => {
|
|
490
|
+
const blocked = flagGuard();
|
|
491
|
+
if (blocked)
|
|
492
|
+
return blocked;
|
|
493
|
+
try {
|
|
494
|
+
const client = await getClientFn();
|
|
495
|
+
const { material_artifact_id } = args;
|
|
496
|
+
const res = await client.patch(`/api/v1/artifacts/${material_artifact_id}/metadata`, {
|
|
497
|
+
metadata_updates: { job_artifact_id: null },
|
|
498
|
+
});
|
|
499
|
+
return ok(res);
|
|
500
|
+
}
|
|
501
|
+
catch (err) {
|
|
502
|
+
return apiErrorResult(err, 'tacit_career_detach_material');
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
// ── 13. tacit_career_list_materials ────────────────────────────────────
|
|
506
|
+
server.tool('tacit_career_list_materials', 'List career materials in a campaign. Filter by link status (all/linked/unlinked) or search query. Finds voice-gate-failed drafts.', listMaterialsSchema.shape, async (args) => {
|
|
507
|
+
try {
|
|
508
|
+
const client = await getClientFn();
|
|
509
|
+
const input = args;
|
|
510
|
+
const params = {
|
|
511
|
+
type: 'career_material',
|
|
512
|
+
};
|
|
513
|
+
if (input.query)
|
|
514
|
+
params['query'] = input.query;
|
|
515
|
+
if (input.unlinked_only)
|
|
516
|
+
params['unlinked_only'] = true;
|
|
517
|
+
if (input.scope && input.scope !== 'all')
|
|
518
|
+
params['scope'] = input.scope;
|
|
519
|
+
const res = await client.get(`/api/v1/portfolios/${input.portfolio_id}/artifacts`, params);
|
|
520
|
+
return ok(res);
|
|
521
|
+
}
|
|
522
|
+
catch (err) {
|
|
523
|
+
return apiErrorResult(err, 'tacit_career_list_materials');
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
// ── 14. tacit_career_generate_material ─────────────────────────────────
|
|
527
|
+
server.tool('tacit_career_generate_material', 'Generate a tailored resume or cover letter for a job posting. Dispatches a crew run that produces voice-matched material. Returns run_id for polling with tacit_career_generate_status. Requires an active voice profile with voice_mode=voice_on.', generateMaterialSchema.shape, async (args) => {
|
|
528
|
+
const blocked = flagGuard();
|
|
529
|
+
if (blocked)
|
|
530
|
+
return blocked;
|
|
531
|
+
try {
|
|
532
|
+
const client = await getClientFn();
|
|
533
|
+
const input = args;
|
|
534
|
+
const res = await client.post(`/api/v1/artifacts/${input.job_artifact_id}/career-material/generate`, { artifact_type: input.artifact_type });
|
|
535
|
+
return ok(res);
|
|
536
|
+
}
|
|
537
|
+
catch (err) {
|
|
538
|
+
return apiErrorResult(err, 'tacit_career_generate_material');
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
// ── 15. tacit_career_generate_status ───────────────────────────────────
|
|
542
|
+
server.tool('tacit_career_generate_status', 'Check the status of a career material generation run. Returns run state, voice gate result, and material id when complete. Optionally includes the full receipt with claims_manifest.', generateStatusSchema.shape, async (args) => {
|
|
543
|
+
try {
|
|
544
|
+
const client = await getClientFn();
|
|
545
|
+
const input = args;
|
|
546
|
+
const run = await client.get(`/api/v1/agent-runs/${input.run_id}`);
|
|
547
|
+
if (input.include_receipt) {
|
|
548
|
+
try {
|
|
549
|
+
const receipt = await client.get(`/api/v1/agent-runs/${input.run_id}/receipt`);
|
|
550
|
+
return ok({ run, receipt });
|
|
551
|
+
}
|
|
552
|
+
catch {
|
|
553
|
+
return ok({ run, receipt_error: 'Receipt not yet available' });
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
return ok(run);
|
|
557
|
+
}
|
|
558
|
+
catch (err) {
|
|
559
|
+
return apiErrorResult(err, 'tacit_career_generate_status');
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
}
|
|
@@ -7,4 +7,20 @@
|
|
|
7
7
|
* imperative next-step script the LLM can follow deterministically.
|
|
8
8
|
*/
|
|
9
9
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
10
|
+
interface RoleRoute {
|
|
11
|
+
slug: string;
|
|
12
|
+
present_as: string;
|
|
13
|
+
workflow_type: string;
|
|
14
|
+
keywords: string[];
|
|
15
|
+
description: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const ROLE_ROUTES: RoleRoute[];
|
|
18
|
+
export declare function matchRole(request: string): {
|
|
19
|
+
primary: RoleRoute;
|
|
20
|
+
alternatives: Array<{
|
|
21
|
+
role_slug: string;
|
|
22
|
+
reason: string;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
10
25
|
export declare function registerExecRouteTool(server: McpServer): void;
|
|
26
|
+
export {};
|
package/dist/tools/exec-route.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* imperative next-step script the LLM can follow deterministically.
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
-
const ROLE_ROUTES = [
|
|
10
|
+
export const ROLE_ROUTES = [
|
|
11
11
|
{
|
|
12
12
|
slug: 'general_manager',
|
|
13
13
|
present_as: 'General Manager',
|
|
@@ -82,8 +82,8 @@ const ROLE_ROUTES = [
|
|
|
82
82
|
slug: 'secretary',
|
|
83
83
|
present_as: 'Secretary',
|
|
84
84
|
workflow_type: 'secretary_chronicle',
|
|
85
|
-
keywords: ['log decision', 'log meeting', 'meeting notes', 'action items', 'what decisions', 'decision history', 'retro', 'retrospective', 'log blocker', 'status update'],
|
|
86
|
-
description: 'Natural language Chronicle event management: log decisions, meetings, action items, blockers,
|
|
85
|
+
keywords: ['log decision', 'log meeting', 'meeting notes', 'action items', 'what decisions', 'decision history', 'retro', 'retrospective', 'log blocker', 'status update', 'save link', 'save url', 'bookmark'],
|
|
86
|
+
description: 'Natural language Chronicle event management: log decisions, meetings, action items, blockers, recall event history. Also saves links to the link library.',
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
slug: 'lake_operator',
|
|
@@ -106,8 +106,15 @@ const ROLE_ROUTES = [
|
|
|
106
106
|
keywords: ['secret inventory', 'rotate secret', 'credential', 'token management', 'approval', 't3'],
|
|
107
107
|
description: 'Manages credential inventory, rotation tracking, and T3 approval workflows.',
|
|
108
108
|
},
|
|
109
|
+
{
|
|
110
|
+
slug: 'career_executive',
|
|
111
|
+
present_as: 'Career Executive',
|
|
112
|
+
workflow_type: 'career_application',
|
|
113
|
+
keywords: ['career', 'job search', 'resume', 'cover letter', 'job application', 'tailored resume', 'career material', 'job pipeline', 'job board', 'career campaign', 'job posting', 'find job', 'triage inbox', 'my application', 'job market'],
|
|
114
|
+
description: 'Manages career application pipeline — job search, campaign management, tailored resume and cover letter generation.',
|
|
115
|
+
},
|
|
109
116
|
];
|
|
110
|
-
function matchRole(request) {
|
|
117
|
+
export function matchRole(request) {
|
|
111
118
|
const lower = request.toLowerCase();
|
|
112
119
|
const scores = [];
|
|
113
120
|
for (const route of ROLE_ROUTES) {
|
|
@@ -148,6 +155,7 @@ function buildScript(role) {
|
|
|
148
155
|
steps.push('Call tacit_secretary_log to record events from natural language, or tacit_secretary_recall to search event history.');
|
|
149
156
|
steps.push('Secretary auto-classifies event types (decision, meeting, action item, blocker, etc.) from your description.');
|
|
150
157
|
steps.push('For decision history: tacit_secretary_recall follows override chains to show how decisions evolved.');
|
|
158
|
+
steps.push('To save a link/URL: call tacit_capture_save with { url, note, tags }. This saves to the link library (MV-1537), not Chronicle.');
|
|
151
159
|
return steps;
|
|
152
160
|
}
|
|
153
161
|
if (role.workflow_type === 'research_deep_dive' && role.slug === 'researcher') {
|
|
@@ -159,7 +167,9 @@ function buildScript(role) {
|
|
|
159
167
|
steps.push(`Call tacit_agent_delegate with role_slug="${role.slug}" and your task description.`);
|
|
160
168
|
steps.push('The delegation returns agent_id and run_id. Use tacit_agent_status with both to check progress and retrieve results.');
|
|
161
169
|
if (role.workflow_type === 'gm_content_placement') {
|
|
162
|
-
steps.push('
|
|
170
|
+
steps.push('SOP-14 (career check first): if the request names a job, application, resume, or cover letter, call tacit_career_list_jobs to find the job card. If matched, propose attaching; on approval use tacit_career_attach_material directly (ADR-210 exempts career materials from lake-first). If no match or career not enabled, fall through to normal filing.');
|
|
171
|
+
steps.push('For link saves (URL/bookmark): call tacit_capture_save with { url, note, tags } — this saves to the link library (MV-1537), NOT the data lake.');
|
|
172
|
+
steps.push('For content placement (non-link): call tacit_gm_ingest first, then tacit_gm_approve to confirm placement.');
|
|
163
173
|
}
|
|
164
174
|
else if (role.workflow_type === 'wiki_authoring') {
|
|
165
175
|
steps.push('Wiki writes require approval. The workflow enforces: draft → review → approve → publish.');
|
|
@@ -179,6 +189,12 @@ function buildScript(role) {
|
|
|
179
189
|
steps.push('Use tacit_agent_delegate to the security_officer role.');
|
|
180
190
|
steps.push('Security tools: security_secret_inventory, security_rotate_secret, iam_create_approval, iam_token_management.');
|
|
181
191
|
}
|
|
192
|
+
if (role.workflow_type === 'career_application') {
|
|
193
|
+
steps.push('Career tools: tacit_career_list_campaigns, tacit_career_create_campaign, tacit_career_search_jobs, tacit_career_list_jobs, tacit_career_add_job, tacit_career_get_job.');
|
|
194
|
+
steps.push('Material generation: tacit_career_generate_material to dispatch a crew run, tacit_career_generate_status to poll progress.');
|
|
195
|
+
steps.push('Attach/detach materials to jobs: tacit_career_attach_material, tacit_career_detach_material.');
|
|
196
|
+
steps.push('Move jobs through pipeline stages: tacit_career_move_job (guarded statuses require confirm_user_instruction).');
|
|
197
|
+
}
|
|
182
198
|
steps.push('Check tacit_workflow_prereqs if a tool returns a workflow block — it shows required prior steps.');
|
|
183
199
|
return steps;
|
|
184
200
|
}
|
package/dist/tools/recall.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { getClient, TacitApiError, TokenExpiredError } from '../client.js';
|
|
7
|
+
import { featureDisabledResult } from './errors.js';
|
|
7
8
|
export const recallInputSchema = z.object({
|
|
8
9
|
query: z.string().min(1).describe('Recall query'),
|
|
9
10
|
portfolio_id: z.string().min(1).describe('Portfolio UUID to scope the recall'),
|
|
@@ -46,6 +47,9 @@ export function buildRecallRequest(client, input) {
|
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
if (err instanceof TacitApiError) {
|
|
50
|
+
const disabled = featureDisabledResult(err);
|
|
51
|
+
if (disabled)
|
|
52
|
+
return disabled;
|
|
49
53
|
return { content: [{ type: 'text', text: `API error ${err.statusCode}: ${err.body}` }], isError: true };
|
|
50
54
|
}
|
|
51
55
|
const msg = err instanceof Error ? err.message : String(err);
|
package/dist/tools/registry.js
CHANGED
|
@@ -122,6 +122,12 @@ const READ_TOOLS = [
|
|
|
122
122
|
'tacit_security_secret_inventory',
|
|
123
123
|
'tacit_security_incident_report',
|
|
124
124
|
'tacit_mcp_profile_health',
|
|
125
|
+
'tacit_career_list_campaigns',
|
|
126
|
+
'tacit_career_list_jobs',
|
|
127
|
+
'tacit_career_get_job',
|
|
128
|
+
'tacit_career_list_materials',
|
|
129
|
+
'tacit_career_search_status',
|
|
130
|
+
'tacit_career_generate_status',
|
|
125
131
|
];
|
|
126
132
|
const DISPATCH_TOOLS = [
|
|
127
133
|
'tacit_agent_delegate',
|
|
@@ -210,6 +216,15 @@ const WRITE_TOOLS = [
|
|
|
210
216
|
'tacit_capture_note',
|
|
211
217
|
'tacit_capture_place',
|
|
212
218
|
'tacit_iam_reactivate_identity',
|
|
219
|
+
'tacit_career_create_campaign',
|
|
220
|
+
'tacit_career_search_jobs',
|
|
221
|
+
'tacit_career_add_job',
|
|
222
|
+
'tacit_career_update_job',
|
|
223
|
+
'tacit_career_move_job',
|
|
224
|
+
'tacit_career_generate_material',
|
|
225
|
+
'tacit_career_attach_material',
|
|
226
|
+
'tacit_career_detach_material',
|
|
227
|
+
'tacit_career_seed_pyramid',
|
|
213
228
|
];
|
|
214
229
|
function build() {
|
|
215
230
|
const map = new Map();
|
|
@@ -236,8 +251,8 @@ function build() {
|
|
|
236
251
|
if (!exclusive.has(n))
|
|
237
252
|
add(n, classOf(n), 'https', false);
|
|
238
253
|
}
|
|
239
|
-
if (map.size !==
|
|
240
|
-
throw new Error(`tool registry expected
|
|
254
|
+
if (map.size !== 207)
|
|
255
|
+
throw new Error(`tool registry expected 207 tools, got ${map.size}`);
|
|
241
256
|
return map;
|
|
242
257
|
}
|
|
243
258
|
export const TOOL_REGISTRY = build();
|
package/dist/tools/synthesize.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
import { getClient, TacitApiError, TokenExpiredError } from '../client.js';
|
|
12
|
+
import { featureDisabledResult } from './errors.js';
|
|
12
13
|
export const synthesizeInputSchema = z.object({
|
|
13
14
|
query: z.string().min(1).describe('Question or synthesis prompt'),
|
|
14
15
|
stream: z.boolean().optional().describe('If true, use SSE stream variant (/mind/synthesize/stream)'),
|
|
@@ -156,6 +157,9 @@ export function buildSynthesizeRequest(client, input) {
|
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
159
|
if (err instanceof TacitApiError) {
|
|
160
|
+
const disabled = featureDisabledResult(err);
|
|
161
|
+
if (disabled)
|
|
162
|
+
return disabled;
|
|
159
163
|
return { content: [{ type: 'text', text: `API error ${err.statusCode}: ${err.body}` }], isError: true };
|
|
160
164
|
}
|
|
161
165
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -83,4 +83,5 @@ export declare const IAM_MEMBERSHIP_OPS_TYPE_DEF: WorkflowTypeDef;
|
|
|
83
83
|
export declare const IAM_ACCESS_REVIEW_TYPE_DEF: WorkflowTypeDef;
|
|
84
84
|
export declare const SECURITY_AUDIT_TYPE_DEF: WorkflowTypeDef;
|
|
85
85
|
export declare const SECRET_ROTATION_TYPE_DEF: WorkflowTypeDef;
|
|
86
|
+
export declare const CAREER_APPLICATION_TYPE_DEF: WorkflowTypeDef;
|
|
86
87
|
export declare function createDefaultRegistry(): WorkflowRegistry;
|
|
@@ -426,6 +426,19 @@ export const SECRET_ROTATION_TYPE_DEF = {
|
|
|
426
426
|
guidance: 'SECRET_ROTATION',
|
|
427
427
|
maxInstances: 1,
|
|
428
428
|
};
|
|
429
|
+
// ─── Career Application type definition (MV-1543 W3) ───────────────────────
|
|
430
|
+
// §4.8: list_jobs, add_job, attach_material, detach_material are NOT gated —
|
|
431
|
+
// they are everyday card-level CRUD and must remain outside gatedTools/requiredTools.
|
|
432
|
+
export const CAREER_APPLICATION_TYPE_DEF = {
|
|
433
|
+
name: 'career_application',
|
|
434
|
+
entryTool: null,
|
|
435
|
+
prereqs: { kind: 'flat', tools: [] },
|
|
436
|
+
persistent: false,
|
|
437
|
+
failDirection: 'open',
|
|
438
|
+
sharedToolPolicy: 'passthrough',
|
|
439
|
+
guidance: 'CAREER_APPLICATION',
|
|
440
|
+
maxInstances: 3,
|
|
441
|
+
};
|
|
429
442
|
// ─── Factory ────────────────────────────────────────────────────────────────
|
|
430
443
|
export function createDefaultRegistry() {
|
|
431
444
|
const registry = new WorkflowRegistry();
|
|
@@ -445,5 +458,6 @@ export function createDefaultRegistry() {
|
|
|
445
458
|
registry.register(IAM_ACCESS_REVIEW_TYPE_DEF);
|
|
446
459
|
registry.register(SECURITY_AUDIT_TYPE_DEF);
|
|
447
460
|
registry.register(SECRET_ROTATION_TYPE_DEF);
|
|
461
|
+
registry.register(CAREER_APPLICATION_TYPE_DEF);
|
|
448
462
|
return registry;
|
|
449
463
|
}
|