@integrity-labs/agt-cli 0.11.0 → 0.12.2

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.
@@ -1,3 +1,216 @@
1
+ // ../../packages/core/dist/delivery/parse.js
2
+ function parseDeliveryTarget(raw) {
3
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
4
+ return {
5
+ ok: false,
6
+ code: "MALFORMED_DELIVERY_TARGET",
7
+ detail: "delivery_to must be a JSON object"
8
+ };
9
+ }
10
+ const obj = raw;
11
+ const kind = obj["kind"];
12
+ if (kind === "channel") {
13
+ return parseChannelTarget(obj);
14
+ }
15
+ if (kind === "dm") {
16
+ return parseDmTarget(obj);
17
+ }
18
+ return {
19
+ ok: false,
20
+ code: "UNKNOWN_KIND",
21
+ detail: `delivery_to.kind must be 'channel' or 'dm' (got ${JSON.stringify(kind)})`
22
+ };
23
+ }
24
+ function parseChannelTarget(obj) {
25
+ const provider = obj["provider"];
26
+ if (provider === "slack") {
27
+ const channelId = obj["channel_id"];
28
+ if (typeof channelId !== "string" || channelId.length === 0) {
29
+ return {
30
+ ok: false,
31
+ code: "MISSING_CHANNEL_ID",
32
+ detail: "channel:slack target requires a non-empty channel_id"
33
+ };
34
+ }
35
+ return { kind: "channel", provider: "slack", channel_id: channelId };
36
+ }
37
+ if (provider === "telegram") {
38
+ const chatId = obj["chat_id"];
39
+ if (typeof chatId !== "string" || chatId.length === 0) {
40
+ return {
41
+ ok: false,
42
+ code: "MISSING_CHAT_ID",
43
+ detail: "channel:telegram target requires a non-empty chat_id"
44
+ };
45
+ }
46
+ return { kind: "channel", provider: "telegram", chat_id: chatId };
47
+ }
48
+ return {
49
+ ok: false,
50
+ code: "UNKNOWN_PROVIDER",
51
+ detail: `channel.provider must be 'slack' or 'telegram' (got ${JSON.stringify(provider)})`
52
+ };
53
+ }
54
+ var SUPPORTED_MEDIUMS = /* @__PURE__ */ new Set(["auto", "slack", "telegram"]);
55
+ var RESERVED_MEDIUMS = /* @__PURE__ */ new Set(["teams", "whatsapp", "imessage"]);
56
+ function parseDmTarget(obj) {
57
+ const personId = obj["person_id"];
58
+ if (typeof personId !== "string" || personId.length === 0) {
59
+ return {
60
+ ok: false,
61
+ code: "MISSING_PERSON_ID",
62
+ detail: "dm target requires a non-empty person_id"
63
+ };
64
+ }
65
+ const followReportsTo = obj["follow_reports_to"];
66
+ if (typeof followReportsTo !== "boolean") {
67
+ return {
68
+ ok: false,
69
+ code: "MALFORMED_DELIVERY_TARGET",
70
+ detail: "dm.follow_reports_to must be a boolean"
71
+ };
72
+ }
73
+ const medium = obj["medium"];
74
+ if (typeof medium !== "string") {
75
+ return {
76
+ ok: false,
77
+ code: "MALFORMED_DELIVERY_TARGET",
78
+ detail: "dm.medium must be a string"
79
+ };
80
+ }
81
+ if (RESERVED_MEDIUMS.has(medium)) {
82
+ return {
83
+ ok: false,
84
+ code: "DM_MEDIUM_NOT_SUPPORTED",
85
+ detail: `dm.medium '${medium}' is reserved but not yet dispatchable (ENG-4427)`
86
+ };
87
+ }
88
+ if (!SUPPORTED_MEDIUMS.has(medium)) {
89
+ return {
90
+ ok: false,
91
+ code: "UNKNOWN_MEDIUM",
92
+ detail: `dm.medium must be 'auto', 'slack', or 'telegram' (got ${JSON.stringify(medium)})`
93
+ };
94
+ }
95
+ return {
96
+ kind: "dm",
97
+ person_id: personId,
98
+ follow_reports_to: followReportsTo,
99
+ medium
100
+ };
101
+ }
102
+ function isParseError(v) {
103
+ return typeof v === "object" && v !== null && "ok" in v && v.ok === false;
104
+ }
105
+
106
+ // ../../packages/core/dist/delivery/format.js
107
+ function formatDmFooter(teamName, agentDisplayName) {
108
+ const team = teamName?.trim() || "unassigned team";
109
+ return `\u2014 scheduled by ${team} / ${agentDisplayName}`;
110
+ }
111
+ function appendDmFooter(body, teamName, agentDisplayName) {
112
+ const footer = formatDmFooter(teamName, agentDisplayName);
113
+ const trimmed = body.replace(/\s+$/, "");
114
+ if (trimmed.endsWith(footer))
115
+ return trimmed;
116
+ return `${trimmed}
117
+
118
+ ${footer}`;
119
+ }
120
+ function formatForOpenClawCli(target) {
121
+ if (target.kind === "channel") {
122
+ if (target.provider === "slack") {
123
+ if (!target.channel_id) {
124
+ throw new Error("INVALID_DELIVERY_TARGET: slack channel target is missing channel_id");
125
+ }
126
+ return `channel:${target.channel_id}`;
127
+ }
128
+ if (!target.chat_id) {
129
+ throw new Error("INVALID_DELIVERY_TARGET: telegram channel target is missing chat_id");
130
+ }
131
+ return `chat:${target.chat_id}`;
132
+ }
133
+ throw new Error(`DM_NOT_SUPPORTED_ON_FRAMEWORK: dm targets can't be passed to openclaw cron add. See ENG-4423 \xA79.1 and the follow-up ENG-4431.`);
134
+ }
135
+
136
+ // ../../packages/core/dist/delivery/resolve.js
137
+ function resolveDmTarget(target, agent, people) {
138
+ if (target.kind === "channel") {
139
+ if (target.provider === "slack") {
140
+ return {
141
+ ok: true,
142
+ kind: "channel",
143
+ provider: "slack",
144
+ channel_id: target.channel_id ?? ""
145
+ };
146
+ }
147
+ return {
148
+ ok: true,
149
+ kind: "channel",
150
+ provider: "telegram",
151
+ chat_id: target.chat_id ?? ""
152
+ };
153
+ }
154
+ const effectivePersonId = resolveEffectivePersonId(target, agent);
155
+ if ("ok" in effectivePersonId)
156
+ return effectivePersonId;
157
+ const person = people.get(effectivePersonId.person_id);
158
+ if (!person) {
159
+ return {
160
+ ok: false,
161
+ code: "DM_TARGET_PERSON_NOT_FOUND",
162
+ detail: `person ${effectivePersonId.person_id} not present in resolver people map`
163
+ };
164
+ }
165
+ const FALLBACK_ORDER = ["slack", "telegram"];
166
+ const preferredMedium = target.medium === "auto" ? null : target.medium;
167
+ const chosenMedium = preferredMedium ? agent.dm_capable_mediums.includes(preferredMedium) && personHasMedium(person, preferredMedium) ? preferredMedium : null : FALLBACK_ORDER.find((m) => agent.dm_capable_mediums.includes(m) && personHasMedium(person, m)) ?? null;
168
+ if (!chosenMedium) {
169
+ return {
170
+ ok: false,
171
+ code: "DM_TARGET_NO_REACHABLE_MEDIUM",
172
+ detail: `agent and person ${person.person_id} share no DM-capable medium`
173
+ };
174
+ }
175
+ if (chosenMedium === "slack") {
176
+ return {
177
+ ok: true,
178
+ kind: "dm",
179
+ medium: "slack",
180
+ slack_user_id: person.slack_user_id,
181
+ recipient_person_id: person.person_id
182
+ };
183
+ }
184
+ return {
185
+ ok: true,
186
+ kind: "dm",
187
+ medium: "telegram",
188
+ telegram_chat_id: person.telegram_chat_id,
189
+ recipient_person_id: person.person_id
190
+ };
191
+ }
192
+ function resolveEffectivePersonId(target, agent) {
193
+ if (target.follow_reports_to) {
194
+ if (agent.reports_to_type !== "person" || !agent.reports_to_person_id) {
195
+ return {
196
+ ok: false,
197
+ code: "DM_FOLLOW_TARGET_NOT_PERSON",
198
+ detail: "follow_reports_to=true but the agent has no person-typed reports_to at dispatch time"
199
+ };
200
+ }
201
+ return { person_id: agent.reports_to_person_id };
202
+ }
203
+ return { person_id: target.person_id };
204
+ }
205
+ function personHasMedium(person, medium) {
206
+ if (medium === "slack")
207
+ return Boolean(person.slack_user_id);
208
+ return Boolean(person.telegram_chat_id);
209
+ }
210
+ function isResolveError(v) {
211
+ return "ok" in v && v.ok === false;
212
+ }
213
+
1
214
  // ../../packages/core/dist/provisioning/framework-registry.js
2
215
  var adapters = /* @__PURE__ */ new Map();
3
216
  function registerFramework(adapter) {
@@ -10,6 +223,256 @@ function getFramework(id) {
10
223
  return adapter;
11
224
  }
12
225
 
226
+ // ../../packages/core/dist/integrations/registry.js
227
+ var INTEGRATION_REGISTRY = [
228
+ {
229
+ id: "linear",
230
+ name: "Linear",
231
+ category: "project-management",
232
+ description: "Issue tracking and project management",
233
+ supported_auth_types: ["api_key", "oauth2"],
234
+ capabilities: [
235
+ { id: "linear:read-issues", name: "Read Issues", description: "View issues, projects, and teams", access: "read" },
236
+ { id: "linear:create-issue", name: "Create Issues", description: "Create and update issues", access: "write" },
237
+ { id: "linear:manage-projects", name: "Manage Projects", description: "Create/archive projects and manage team settings", access: "admin" }
238
+ ],
239
+ cli_tool: {
240
+ package: "@schpet/linear-cli",
241
+ binary: "linear",
242
+ env_key: "LINEAR_API_KEY",
243
+ skill_id: "linear-cli",
244
+ extra_env: { LINEAR_ISSUE_SORT: "priority" },
245
+ installer: "npm"
246
+ }
247
+ },
248
+ {
249
+ id: "github",
250
+ name: "GitHub",
251
+ category: "code",
252
+ description: "Source code hosting, pull requests, and CI/CD",
253
+ supported_auth_types: ["api_key", "oauth2"],
254
+ capabilities: [
255
+ { id: "github:read-repos", name: "Read Repositories", description: "View repos, issues, and PRs", access: "read" },
256
+ { id: "github:write-code", name: "Write Code", description: "Push commits and create PRs", access: "write" },
257
+ { id: "github:manage-repos", name: "Manage Repositories", description: "Create/delete repos and manage settings", access: "admin" }
258
+ ],
259
+ cli_tool: {
260
+ package: "gh",
261
+ binary: "gh",
262
+ env_key: "GITHUB_TOKEN",
263
+ skill_id: "gh-cli",
264
+ installer: "brew"
265
+ }
266
+ },
267
+ {
268
+ id: "google-workspace",
269
+ name: "Google Workspace",
270
+ category: "workspace-productivity",
271
+ description: "Gmail, Calendar, Drive, Sheets, Docs, and Chat",
272
+ supported_auth_types: ["oauth2"],
273
+ capabilities: [
274
+ { id: "gws:read-email", name: "Read Email", description: "Read Gmail messages, threads, and labels", access: "read" },
275
+ { id: "gws:send-email", name: "Send Email", description: "Send, reply, and forward emails", access: "write" },
276
+ { id: "gws:read-calendar", name: "Read Calendar", description: "View events and agendas", access: "read" },
277
+ { id: "gws:manage-calendar", name: "Manage Calendar", description: "Create, update, and delete events", access: "write" },
278
+ { id: "gws:read-drive", name: "Read Drive", description: "List and download files", access: "read" },
279
+ { id: "gws:write-drive", name: "Write Drive", description: "Upload, create, and share files", access: "write" },
280
+ { id: "gws:read-sheets", name: "Read Sheets", description: "Read spreadsheet values", access: "read" },
281
+ { id: "gws:write-sheets", name: "Write Sheets", description: "Append and update spreadsheet data", access: "write" },
282
+ { id: "gws:read-docs", name: "Read Docs", description: "Read document content", access: "read" },
283
+ { id: "gws:write-docs", name: "Write Docs", description: "Create and append to documents", access: "write" },
284
+ { id: "gws:chat", name: "Chat", description: "Send messages to Google Chat spaces", access: "write" }
285
+ ],
286
+ cli_tool: {
287
+ package: "@googleworkspace/cli",
288
+ binary: "gws",
289
+ env_key: "GOOGLE_WORKSPACE_CLI_TOKEN",
290
+ skill_id: "gws-cli",
291
+ installer: "npm"
292
+ }
293
+ },
294
+ {
295
+ id: "xero",
296
+ name: "Xero",
297
+ category: "accounting",
298
+ description: "Cloud accounting \u2014 financial reports, transactions, and account balances",
299
+ supported_auth_types: ["oauth2"],
300
+ capabilities: [
301
+ { id: "xero:read-reports", name: "Read Reports", description: "Pull P&L, balance sheet, and trial balance reports", access: "read" },
302
+ { id: "xero:read-accounts", name: "Read Accounts", description: "View chart of accounts and account balances", access: "read" },
303
+ { id: "xero:read-transactions", name: "Read Transactions", description: "View bank transactions, invoices, and journal entries", access: "read" },
304
+ { id: "xero:read-contacts", name: "Read Contacts", description: "View customers, suppliers, and contact groups", access: "read" },
305
+ { id: "xero:manage-settings", name: "Manage Settings", description: "Manage org settings and chart of accounts", access: "admin" }
306
+ ]
307
+ },
308
+ {
309
+ id: "qmd",
310
+ name: "QMD Memory Search",
311
+ category: "knowledge",
312
+ description: "Local-first memory search sidecar \u2014 BM25 + vector search + reranking over agent memory files",
313
+ supported_auth_types: ["none"],
314
+ cli_tool: {
315
+ package: "@tobilu/qmd",
316
+ binary: "qmd",
317
+ env_key: "",
318
+ installer: "npm"
319
+ },
320
+ capabilities: [
321
+ { id: "qmd:search", name: "Search Memory", description: "Semantic + keyword search over indexed memory files", access: "read" },
322
+ { id: "qmd:get", name: "Get Memory", description: "Read memory files by path and line range", access: "read" }
323
+ ],
324
+ beta: true
325
+ },
326
+ {
327
+ id: "v0",
328
+ name: "v0 by Vercel",
329
+ category: "ui-generation",
330
+ description: "Programmatic UI generation \u2014 generate React + Tailwind + shadcn/ui components and full apps from natural language prompts",
331
+ supported_auth_types: ["api_key"],
332
+ beta: true,
333
+ capabilities: [
334
+ {
335
+ id: "v0:generate-ui",
336
+ name: "Generate UI",
337
+ description: "Create React components and full apps from a natural language prompt",
338
+ access: "write",
339
+ required_scopes: ["chats:create"]
340
+ },
341
+ {
342
+ id: "v0:iterate-ui",
343
+ name: "Iterate UI",
344
+ description: "Send follow-up prompts to refine a previously generated component",
345
+ access: "write",
346
+ required_scopes: ["chats:send"]
347
+ },
348
+ {
349
+ id: "v0:read-chats",
350
+ name: "Read Chats",
351
+ description: "Retrieve chat history, generated files, and demo URLs",
352
+ access: "read",
353
+ required_scopes: ["chats:read"]
354
+ },
355
+ {
356
+ id: "v0:manage-projects",
357
+ name: "Manage Projects",
358
+ description: "Create and manage v0 project containers for versioned generation history",
359
+ access: "write",
360
+ required_scopes: ["projects:write"]
361
+ },
362
+ {
363
+ id: "v0:deploy",
364
+ name: "Deploy to Vercel",
365
+ description: "Deploy a generated version to Vercel and receive a live URL",
366
+ access: "write",
367
+ required_scopes: ["deployments:create"]
368
+ }
369
+ ],
370
+ docs_url: "https://v0.dev/docs/api/platform/overview"
371
+ },
372
+ {
373
+ id: "pika",
374
+ name: "Pika",
375
+ category: "media",
376
+ description: "AI video meeting agent \u2014 join Google Meet and Zoom calls with a custom avatar and cloned voice via PikaStreaming",
377
+ supported_auth_types: ["api_key"],
378
+ capabilities: [
379
+ { id: "pika:join-meeting", name: "Join Meeting", description: "Join a video meeting as an AI participant with avatar and voice", access: "write" },
380
+ { id: "pika:leave-meeting", name: "Leave Meeting", description: "Leave an active video meeting session", access: "write" },
381
+ { id: "pika:generate-avatar", name: "Generate Avatar", description: "Generate an AI avatar image for video calls", access: "write" },
382
+ { id: "pika:clone-voice", name: "Clone Voice", description: "Clone a voice from an audio recording", access: "write" }
383
+ ],
384
+ cli_tool: {
385
+ package: "pika-skills",
386
+ binary: "python3",
387
+ env_key: "PIKA_DEV_KEY",
388
+ skill_id: "pikastream-video-meeting",
389
+ // python3 is part of the host bootstrap baseline — skills are fetched
390
+ // separately. Don't try to auto-install python via npm/brew.
391
+ installer: "manual"
392
+ },
393
+ docs_url: "https://github.com/Pika-Labs/Pika-Skills"
394
+ },
395
+ {
396
+ id: "claude-code",
397
+ name: "Claude Code",
398
+ category: "code",
399
+ description: "Claude Code AI agent runtime \u2014 code editing, task execution, file management, and development workflows",
400
+ supported_auth_types: ["api_key", "none"],
401
+ capabilities: [
402
+ { id: "claude-code:edit-code", name: "Edit Code", description: "Read, write, and edit source files", access: "write" },
403
+ { id: "claude-code:run-tasks", name: "Run Tasks", description: "Execute bash commands and development tasks", access: "write" },
404
+ { id: "claude-code:search", name: "Search Code", description: "Search files and grep codebase", access: "read" },
405
+ { id: "claude-code:git", name: "Git Operations", description: "Commit, branch, push, and manage version control", access: "write" }
406
+ ],
407
+ cli_tool: {
408
+ package: "@anthropic-ai/claude-code",
409
+ binary: "claude",
410
+ env_key: "ANTHROPIC_API_KEY",
411
+ // Claude Code is installed by the host bootstrap / operator setup —
412
+ // don't attempt a second install from the manager poll.
413
+ installer: "manual"
414
+ },
415
+ docs_url: "https://docs.anthropic.com/en/docs/claude-code"
416
+ },
417
+ {
418
+ id: "xurl",
419
+ name: "xurl (X API)",
420
+ category: "social",
421
+ description: "Official X (Twitter) API CLI \u2014 a curl-like tool for X's REST and streaming endpoints with OAuth 2.0 PKCE, OAuth 1.0a, and bearer-token auth",
422
+ supported_auth_types: ["api_key"],
423
+ capabilities: [
424
+ { id: "xurl:read", name: "Read X API", description: "Call GET endpoints (users, tweets, timelines, search)", access: "read" },
425
+ { id: "xurl:write", name: "Write X API", description: "Post tweets, reply, like, and retweet", access: "write" },
426
+ { id: "xurl:stream", name: "Stream X API", description: "Consume filtered and sampled stream endpoints", access: "read" },
427
+ { id: "xurl:media", name: "Upload Media", description: "Chunked upload of images and video to the X media endpoints", access: "write" }
428
+ ],
429
+ cli_tool: {
430
+ package: "@xdevplatform/xurl",
431
+ binary: "xurl",
432
+ env_key: "X_BEARER_TOKEN",
433
+ skill_id: "xurl-cli",
434
+ // xurl is a Go binary distributed through homebrew tap; operator
435
+ // installs via `brew install xdevplatform/tap/xurl`. Mark manual
436
+ // for now — add a dedicated `tap` installer in a follow-up if more
437
+ // brew-tap tools land.
438
+ installer: "manual"
439
+ },
440
+ docs_url: "https://github.com/xdevplatform/xurl"
441
+ },
442
+ {
443
+ id: "coderabbit",
444
+ name: "CodeRabbit",
445
+ category: "code",
446
+ description: "AI-powered code review CLI for local and pre-push review runs",
447
+ supported_auth_types: ["none"],
448
+ capabilities: [
449
+ { id: "coderabbit:review", name: "Review Changes", description: "Run a local CodeRabbit review over staged or branch changes", access: "read" }
450
+ ],
451
+ cli_tool: {
452
+ package: "",
453
+ binary: "coderabbit",
454
+ env_key: "",
455
+ installer: "script",
456
+ script: "curl -fsSL https://cli.coderabbit.ai/install.sh | sh"
457
+ },
458
+ docs_url: "https://www.coderabbit.ai/cli"
459
+ },
460
+ {
461
+ id: "custom",
462
+ name: "Custom Integration",
463
+ category: "custom",
464
+ description: "Connect to any service via API key or webhook",
465
+ supported_auth_types: ["api_key", "webhook", "none"],
466
+ capabilities: [
467
+ { id: "custom:api-access", name: "API Access", description: "Generic API access with configured credentials", access: "read" }
468
+ ]
469
+ }
470
+ ];
471
+ var integrationMap = new Map(INTEGRATION_REGISTRY.map((i) => [i.id, i]));
472
+ function getIntegration(id) {
473
+ return integrationMap.get(id);
474
+ }
475
+
13
476
  // ../../packages/core/dist/provisioning/frameworks/openclaw/index.js
14
477
  import { execFile, spawn } from "child_process";
15
478
  import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2, existsSync as existsSync2, unlinkSync as unlinkSync2, chmodSync as chmodSync2, renameSync as renameSync2, symlinkSync } from "fs";
@@ -243,223 +706,6 @@ function getAllChannelIds() {
243
706
  return CHANNEL_REGISTRY.map((c) => c.id);
244
707
  }
245
708
 
246
- // ../../packages/core/dist/integrations/registry.js
247
- var INTEGRATION_REGISTRY = [
248
- {
249
- id: "linear",
250
- name: "Linear",
251
- category: "project-management",
252
- description: "Issue tracking and project management",
253
- supported_auth_types: ["api_key", "oauth2"],
254
- capabilities: [
255
- { id: "linear:read-issues", name: "Read Issues", description: "View issues, projects, and teams", access: "read" },
256
- { id: "linear:create-issue", name: "Create Issues", description: "Create and update issues", access: "write" },
257
- { id: "linear:manage-projects", name: "Manage Projects", description: "Create/archive projects and manage team settings", access: "admin" }
258
- ],
259
- cli_tool: {
260
- package: "@schpet/linear-cli",
261
- binary: "linear",
262
- env_key: "LINEAR_API_KEY",
263
- skill_id: "linear-cli",
264
- extra_env: { LINEAR_ISSUE_SORT: "priority" }
265
- }
266
- },
267
- {
268
- id: "github",
269
- name: "GitHub",
270
- category: "code",
271
- description: "Source code hosting, pull requests, and CI/CD",
272
- supported_auth_types: ["api_key", "oauth2"],
273
- capabilities: [
274
- { id: "github:read-repos", name: "Read Repositories", description: "View repos, issues, and PRs", access: "read" },
275
- { id: "github:write-code", name: "Write Code", description: "Push commits and create PRs", access: "write" },
276
- { id: "github:manage-repos", name: "Manage Repositories", description: "Create/delete repos and manage settings", access: "admin" }
277
- ],
278
- cli_tool: {
279
- package: "gh",
280
- binary: "gh",
281
- env_key: "GITHUB_TOKEN",
282
- skill_id: "gh-cli"
283
- }
284
- },
285
- {
286
- id: "google-workspace",
287
- name: "Google Workspace",
288
- category: "workspace-productivity",
289
- description: "Gmail, Calendar, Drive, Sheets, Docs, and Chat",
290
- supported_auth_types: ["oauth2"],
291
- capabilities: [
292
- { id: "gws:read-email", name: "Read Email", description: "Read Gmail messages, threads, and labels", access: "read" },
293
- { id: "gws:send-email", name: "Send Email", description: "Send, reply, and forward emails", access: "write" },
294
- { id: "gws:read-calendar", name: "Read Calendar", description: "View events and agendas", access: "read" },
295
- { id: "gws:manage-calendar", name: "Manage Calendar", description: "Create, update, and delete events", access: "write" },
296
- { id: "gws:read-drive", name: "Read Drive", description: "List and download files", access: "read" },
297
- { id: "gws:write-drive", name: "Write Drive", description: "Upload, create, and share files", access: "write" },
298
- { id: "gws:read-sheets", name: "Read Sheets", description: "Read spreadsheet values", access: "read" },
299
- { id: "gws:write-sheets", name: "Write Sheets", description: "Append and update spreadsheet data", access: "write" },
300
- { id: "gws:read-docs", name: "Read Docs", description: "Read document content", access: "read" },
301
- { id: "gws:write-docs", name: "Write Docs", description: "Create and append to documents", access: "write" },
302
- { id: "gws:chat", name: "Chat", description: "Send messages to Google Chat spaces", access: "write" }
303
- ],
304
- cli_tool: {
305
- package: "@googleworkspace/cli",
306
- binary: "gws",
307
- env_key: "GOOGLE_WORKSPACE_CLI_TOKEN",
308
- skill_id: "gws-cli"
309
- }
310
- },
311
- {
312
- id: "xero",
313
- name: "Xero",
314
- category: "accounting",
315
- description: "Cloud accounting \u2014 financial reports, transactions, and account balances",
316
- supported_auth_types: ["oauth2"],
317
- capabilities: [
318
- { id: "xero:read-reports", name: "Read Reports", description: "Pull P&L, balance sheet, and trial balance reports", access: "read" },
319
- { id: "xero:read-accounts", name: "Read Accounts", description: "View chart of accounts and account balances", access: "read" },
320
- { id: "xero:read-transactions", name: "Read Transactions", description: "View bank transactions, invoices, and journal entries", access: "read" },
321
- { id: "xero:read-contacts", name: "Read Contacts", description: "View customers, suppliers, and contact groups", access: "read" },
322
- { id: "xero:manage-settings", name: "Manage Settings", description: "Manage org settings and chart of accounts", access: "admin" }
323
- ]
324
- },
325
- {
326
- id: "qmd",
327
- name: "QMD Memory Search",
328
- category: "knowledge",
329
- description: "Local-first memory search sidecar \u2014 BM25 + vector search + reranking over agent memory files",
330
- supported_auth_types: ["none"],
331
- cli_tool: {
332
- package: "@tobilu/qmd",
333
- binary: "qmd",
334
- env_key: ""
335
- },
336
- capabilities: [
337
- { id: "qmd:search", name: "Search Memory", description: "Semantic + keyword search over indexed memory files", access: "read" },
338
- { id: "qmd:get", name: "Get Memory", description: "Read memory files by path and line range", access: "read" }
339
- ],
340
- beta: true
341
- },
342
- {
343
- id: "v0",
344
- name: "v0 by Vercel",
345
- category: "ui-generation",
346
- description: "Programmatic UI generation \u2014 generate React + Tailwind + shadcn/ui components and full apps from natural language prompts",
347
- supported_auth_types: ["api_key"],
348
- beta: true,
349
- capabilities: [
350
- {
351
- id: "v0:generate-ui",
352
- name: "Generate UI",
353
- description: "Create React components and full apps from a natural language prompt",
354
- access: "write",
355
- required_scopes: ["chats:create"]
356
- },
357
- {
358
- id: "v0:iterate-ui",
359
- name: "Iterate UI",
360
- description: "Send follow-up prompts to refine a previously generated component",
361
- access: "write",
362
- required_scopes: ["chats:send"]
363
- },
364
- {
365
- id: "v0:read-chats",
366
- name: "Read Chats",
367
- description: "Retrieve chat history, generated files, and demo URLs",
368
- access: "read",
369
- required_scopes: ["chats:read"]
370
- },
371
- {
372
- id: "v0:manage-projects",
373
- name: "Manage Projects",
374
- description: "Create and manage v0 project containers for versioned generation history",
375
- access: "write",
376
- required_scopes: ["projects:write"]
377
- },
378
- {
379
- id: "v0:deploy",
380
- name: "Deploy to Vercel",
381
- description: "Deploy a generated version to Vercel and receive a live URL",
382
- access: "write",
383
- required_scopes: ["deployments:create"]
384
- }
385
- ],
386
- docs_url: "https://v0.dev/docs/api/platform/overview"
387
- },
388
- {
389
- id: "pika",
390
- name: "Pika",
391
- category: "media",
392
- description: "AI video meeting agent \u2014 join Google Meet and Zoom calls with a custom avatar and cloned voice via PikaStreaming",
393
- supported_auth_types: ["api_key"],
394
- capabilities: [
395
- { id: "pika:join-meeting", name: "Join Meeting", description: "Join a video meeting as an AI participant with avatar and voice", access: "write" },
396
- { id: "pika:leave-meeting", name: "Leave Meeting", description: "Leave an active video meeting session", access: "write" },
397
- { id: "pika:generate-avatar", name: "Generate Avatar", description: "Generate an AI avatar image for video calls", access: "write" },
398
- { id: "pika:clone-voice", name: "Clone Voice", description: "Clone a voice from an audio recording", access: "write" }
399
- ],
400
- cli_tool: {
401
- package: "pika-skills",
402
- binary: "python3",
403
- env_key: "PIKA_DEV_KEY",
404
- skill_id: "pikastream-video-meeting"
405
- },
406
- docs_url: "https://github.com/Pika-Labs/Pika-Skills"
407
- },
408
- {
409
- id: "claude-code",
410
- name: "Claude Code",
411
- category: "code",
412
- description: "Claude Code AI agent runtime \u2014 code editing, task execution, file management, and development workflows",
413
- supported_auth_types: ["api_key", "none"],
414
- capabilities: [
415
- { id: "claude-code:edit-code", name: "Edit Code", description: "Read, write, and edit source files", access: "write" },
416
- { id: "claude-code:run-tasks", name: "Run Tasks", description: "Execute bash commands and development tasks", access: "write" },
417
- { id: "claude-code:search", name: "Search Code", description: "Search files and grep codebase", access: "read" },
418
- { id: "claude-code:git", name: "Git Operations", description: "Commit, branch, push, and manage version control", access: "write" }
419
- ],
420
- cli_tool: {
421
- package: "@anthropic-ai/claude-code",
422
- binary: "claude",
423
- env_key: "ANTHROPIC_API_KEY"
424
- },
425
- docs_url: "https://docs.anthropic.com/en/docs/claude-code"
426
- },
427
- {
428
- id: "xurl",
429
- name: "xurl (X API)",
430
- category: "social",
431
- description: "Official X (Twitter) API CLI \u2014 a curl-like tool for X's REST and streaming endpoints with OAuth 2.0 PKCE, OAuth 1.0a, and bearer-token auth",
432
- supported_auth_types: ["api_key"],
433
- capabilities: [
434
- { id: "xurl:read", name: "Read X API", description: "Call GET endpoints (users, tweets, timelines, search)", access: "read" },
435
- { id: "xurl:write", name: "Write X API", description: "Post tweets, reply, like, and retweet", access: "write" },
436
- { id: "xurl:stream", name: "Stream X API", description: "Consume filtered and sampled stream endpoints", access: "read" },
437
- { id: "xurl:media", name: "Upload Media", description: "Chunked upload of images and video to the X media endpoints", access: "write" }
438
- ],
439
- cli_tool: {
440
- package: "@xdevplatform/xurl",
441
- binary: "xurl",
442
- env_key: "X_BEARER_TOKEN",
443
- skill_id: "xurl-cli"
444
- },
445
- docs_url: "https://github.com/xdevplatform/xurl"
446
- },
447
- {
448
- id: "custom",
449
- name: "Custom Integration",
450
- category: "custom",
451
- description: "Connect to any service via API key or webhook",
452
- supported_auth_types: ["api_key", "webhook", "none"],
453
- capabilities: [
454
- { id: "custom:api-access", name: "API Access", description: "Generic API access with configured credentials", access: "read" }
455
- ]
456
- }
457
- ];
458
- var integrationMap = new Map(INTEGRATION_REGISTRY.map((i) => [i.id, i]));
459
- function getIntegration(id) {
460
- return integrationMap.get(id);
461
- }
462
-
463
709
  // ../../packages/core/dist/provisioning/frameworks/openclaw/mapper.js
464
710
  function mapToolsToOpenClaw(tools) {
465
711
  const allow = tools.tools.map((t) => t.id);
@@ -941,6 +1187,9 @@ var openclawAdapter = {
941
1187
  id: "openclaw",
942
1188
  label: "OpenClaw",
943
1189
  cliBinary: "openclaw",
1190
+ getAgentDir(codeName) {
1191
+ return join2(getHomeDir(), ".augmented", codeName);
1192
+ },
944
1193
  buildArtifacts(input) {
945
1194
  const config = buildOpenClawConfig(input);
946
1195
  const safeKnowledge = (input.knowledge ?? []).filter((k) => !/[/\\]|\.\./.test(k.slug));
@@ -1707,8 +1956,19 @@ ${entry.content}`
1707
1956
  if (!useMainSession) {
1708
1957
  if (task.delivery_mode === "announce") {
1709
1958
  addArgs.push("--announce");
1710
- if (task.delivery_to) {
1711
- addArgs.push("--to", task.delivery_to);
1959
+ if (task.delivery_to !== null && task.delivery_to !== void 0) {
1960
+ let toArg = null;
1961
+ if (typeof task.delivery_to === "string") {
1962
+ toArg = task.delivery_to;
1963
+ } else {
1964
+ const parsed = parseDeliveryTarget(task.delivery_to);
1965
+ if (isParseError(parsed)) {
1966
+ throw new Error(`OpenClaw cron add: malformed delivery_to on task '${task.name}': ${parsed.code} \u2014 ${parsed.detail}`);
1967
+ }
1968
+ toArg = formatForOpenClawCli(parsed);
1969
+ }
1970
+ if (toArg)
1971
+ addArgs.push("--to", toArg);
1712
1972
  }
1713
1973
  if (task.delivery_channel && task.delivery_channel !== "last") {
1714
1974
  addArgs.push("--channel", task.delivery_channel);
@@ -1836,6 +2096,9 @@ var nemoClawAdapter = {
1836
2096
  id: "nemoclaw",
1837
2097
  label: "NemoClaw (Cloud)",
1838
2098
  cliBinary: "nemoclaw",
2099
+ getAgentDir(codeName) {
2100
+ return join3(homedir2(), ".augmented", codeName);
2101
+ },
1839
2102
  buildArtifacts(input) {
1840
2103
  const blueprint = {
1841
2104
  agentCodeName: input.agent.code_name,
@@ -2091,7 +2354,7 @@ function extractAllowedDomains(input) {
2091
2354
  registerFramework(nemoClawAdapter);
2092
2355
 
2093
2356
  // ../../packages/core/dist/provisioning/frameworks/claudecode/index.js
2094
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync4, chmodSync as chmodSync4, readdirSync, rmSync } from "fs";
2357
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync4, chmodSync as chmodSync4, readdirSync, rmSync, copyFileSync } from "fs";
2095
2358
  import { join as join4, relative, dirname as dirname4 } from "path";
2096
2359
  import { homedir as homedir3 } from "os";
2097
2360
  import { execFile as execFile3 } from "child_process";
@@ -2421,7 +2684,65 @@ function getHomeDir3() {
2421
2684
  }
2422
2685
  function getAgentDir(codeName) {
2423
2686
  assertValidCodeName(codeName);
2424
- return join4(getHomeDir3(), ".augmented", codeName, "claudecode");
2687
+ return join4(getHomeDir3(), ".augmented", codeName);
2688
+ }
2689
+ var migratedCodeNames = /* @__PURE__ */ new Set();
2690
+ function migrateLegacyClaudecodeDir(codeName, log) {
2691
+ assertValidCodeName(codeName);
2692
+ if (migratedCodeNames.has(codeName))
2693
+ return;
2694
+ const legacyRoot = join4(getHomeDir3(), ".augmented", codeName, "claudecode");
2695
+ if (!existsSync4(legacyRoot)) {
2696
+ migratedCodeNames.add(codeName);
2697
+ return;
2698
+ }
2699
+ const newRoot = getAgentDir(codeName);
2700
+ const emit = (msg) => {
2701
+ log?.(msg);
2702
+ };
2703
+ try {
2704
+ const walkAndMigrate = (srcDir, destDir) => {
2705
+ mkdirSync4(destDir, { recursive: true });
2706
+ for (const entry of readdirSync(srcDir, { withFileTypes: true })) {
2707
+ const src = join4(srcDir, entry.name);
2708
+ const dest = join4(destDir, entry.name);
2709
+ if (entry.isDirectory()) {
2710
+ walkAndMigrate(src, dest);
2711
+ continue;
2712
+ }
2713
+ if (entry.name === ".mcp.json" && existsSync4(dest)) {
2714
+ try {
2715
+ const oldCfg = JSON.parse(readFileSync4(src, "utf-8"));
2716
+ const newCfg = JSON.parse(readFileSync4(dest, "utf-8"));
2717
+ const merged = { mcpServers: { ...oldCfg.mcpServers ?? {}, ...newCfg.mcpServers ?? {} } };
2718
+ writeFileSync4(dest, JSON.stringify(merged, null, 2));
2719
+ emit(`[migrate] '${codeName}' merged .mcp.json (${Object.keys(merged.mcpServers).length} servers)`);
2720
+ } catch (err) {
2721
+ throw new Error(`Failed merging .mcp.json (${src} \u2192 ${dest}): ${err.message}`);
2722
+ }
2723
+ continue;
2724
+ }
2725
+ if (!existsSync4(dest)) {
2726
+ copyFileSync(src, dest);
2727
+ continue;
2728
+ }
2729
+ try {
2730
+ const srcStat = readFileSync4(src);
2731
+ const destStat = readFileSync4(dest);
2732
+ if (!srcStat.equals(destStat)) {
2733
+ }
2734
+ } catch (err) {
2735
+ throw new Error(`Failed comparing ${src} vs ${dest}: ${err.message}`);
2736
+ }
2737
+ }
2738
+ };
2739
+ walkAndMigrate(legacyRoot, newRoot);
2740
+ rmSync(legacyRoot, { recursive: true, force: true });
2741
+ emit(`[migrate] '${codeName}': collapsed ~/.augmented/${codeName}/claudecode/ into ~/.augmented/${codeName}/`);
2742
+ migratedCodeNames.add(codeName);
2743
+ } catch (err) {
2744
+ emit(`[migrate] '${codeName}': migration failed \u2014 leaving legacy dir in place: ${err.message}`);
2745
+ }
2425
2746
  }
2426
2747
  function getProjectDir(codeName) {
2427
2748
  assertValidCodeName(codeName);
@@ -2778,6 +3099,11 @@ var claudeCodeAdapter = {
2778
3099
  id: "claude-code",
2779
3100
  label: "Claude Code",
2780
3101
  cliBinary: "claude",
3102
+ getAgentDir(codeName) {
3103
+ const agentDir = getAgentDir(codeName);
3104
+ migrateLegacyClaudecodeDir(codeName);
3105
+ return agentDir;
3106
+ },
2781
3107
  buildArtifacts(input) {
2782
3108
  const integrationSummaries = (input.integrations ?? []).map((i) => {
2783
3109
  const def = INTEGRATION_REGISTRY.find((d) => d.id === i.definition_id);
@@ -2856,12 +3182,17 @@ ${sections}`
2856
3182
  const { readdirSync: readdirSync2, statSync } = await import("fs");
2857
3183
  const entries = readdirSync2(augDir);
2858
3184
  for (const entry of entries) {
2859
- const ccDir = join4(augDir, entry, "claudecode");
3185
+ if (entry.startsWith("_") || entry.startsWith("."))
3186
+ continue;
3187
+ const agentRoot = join4(augDir, entry);
2860
3188
  try {
2861
- if (statSync(ccDir).isDirectory()) {
2862
- agents.add(entry);
2863
- }
3189
+ if (!statSync(agentRoot).isDirectory())
3190
+ continue;
2864
3191
  } catch {
3192
+ continue;
3193
+ }
3194
+ if (existsSync4(join4(agentRoot, "registration.json"))) {
3195
+ agents.add(entry);
2865
3196
  }
2866
3197
  }
2867
3198
  } catch {
@@ -3440,6 +3771,10 @@ ${sections}`
3440
3771
  };
3441
3772
  registerFramework(claudeCodeAdapter);
3442
3773
 
3774
+ // ../../packages/core/dist/provisioning/frameworks/managed-agents/index.js
3775
+ import { homedir as homedir4 } from "os";
3776
+ import { join as join5 } from "path";
3777
+
3443
3778
  // ../../packages/core/dist/provisioning/frameworks/managed-agents/system-prompt.js
3444
3779
  function generateSystemPrompt(input) {
3445
3780
  const { agent, charterFrontmatter, charterContent, resolvedChannels, integrations } = input;
@@ -3637,6 +3972,9 @@ function buildMcpServers(input) {
3637
3972
  var ManagedAgentsAdapter = {
3638
3973
  id: "managed-agents",
3639
3974
  label: "Managed Agents (Anthropic Cloud)",
3975
+ getAgentDir(codeName) {
3976
+ return join5(homedir4(), ".augmented", codeName);
3977
+ },
3640
3978
  buildArtifacts(input) {
3641
3979
  const { agent, toolsFrontmatter } = input;
3642
3980
  const toolset = mapToolsToAgentToolset(toolsFrontmatter);
@@ -3693,10 +4031,10 @@ registerFramework(ManagedAgentsAdapter);
3693
4031
 
3694
4032
  // src/lib/config.ts
3695
4033
  import { readFileSync as readFileSync5, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync5 } from "fs";
3696
- import { join as join5 } from "path";
3697
- import { homedir as homedir4 } from "os";
3698
- var AUGMENTED_DIR2 = join5(homedir4(), ".augmented");
3699
- var CONFIG_PATH = join5(AUGMENTED_DIR2, "config.json");
4034
+ import { join as join6 } from "path";
4035
+ import { homedir as homedir5 } from "os";
4036
+ var AUGMENTED_DIR2 = join6(homedir5(), ".augmented");
4037
+ var CONFIG_PATH = join6(AUGMENTED_DIR2, "config.json");
3700
4038
  function ensureAugmentedDir() {
3701
4039
  if (!existsSync5(AUGMENTED_DIR2)) {
3702
4040
  mkdirSync5(AUGMENTED_DIR2, { recursive: true });
@@ -3708,8 +4046,8 @@ function reloadFromShellProfile() {
3708
4046
  function loadFromShellProfile(force = false) {
3709
4047
  if (!force && process.env["AGT_HOST"] && process.env["AGT_API_KEY"]) return;
3710
4048
  const shell = process.env["SHELL"] ?? "";
3711
- const home = homedir4();
3712
- const candidates = shell.includes("zsh") ? [join5(home, ".zshrc"), join5(home, ".zprofile")] : shell.includes("fish") ? [join5(home, ".config", "fish", "config.fish")] : [join5(home, ".bashrc"), join5(home, ".bash_profile")];
4049
+ const home = homedir5();
4050
+ const candidates = shell.includes("zsh") ? [join6(home, ".zshrc"), join6(home, ".zprofile")] : shell.includes("fish") ? [join6(home, ".config", "fish", "config.fish")] : [join6(home, ".bashrc"), join6(home, ".bash_profile")];
3713
4051
  for (const profile of candidates) {
3714
4052
  try {
3715
4053
  const content = readFileSync5(profile, "utf-8");
@@ -5941,10 +6279,16 @@ function provision(input, frameworkId = "openclaw") {
5941
6279
  }
5942
6280
 
5943
6281
  export {
6282
+ parseDeliveryTarget,
6283
+ isParseError,
6284
+ appendDmFooter,
6285
+ resolveDmTarget,
6286
+ isResolveError,
5944
6287
  getFramework,
5945
6288
  CHANNEL_REGISTRY,
5946
6289
  getChannel,
5947
6290
  getAllChannelIds,
6291
+ getIntegration,
5948
6292
  provisionStopHook,
5949
6293
  provisionIsolationHook,
5950
6294
  getApiKey,
@@ -5977,4 +6321,4 @@ export {
5977
6321
  detectDrift,
5978
6322
  provision
5979
6323
  };
5980
- //# sourceMappingURL=chunk-WTMVQND4.js.map
6324
+ //# sourceMappingURL=chunk-S5VHDDAJ.js.map