@kohala/devkit 0.1.1 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -1,6 +1,37 @@
1
1
  # @kohala/devkit
2
2
 
3
- ## 0.1.1 (unreleased)
3
+ ## 0.1.3 (unreleased)
4
+
5
+ - **`kohala deploy --run` now explains the "agent not enabled" case instead of
6
+ a raw 409 API error.** Newly deployed agents start disabled on the platform,
7
+ so a manual run cannot start until the agent is enabled in the kohala.ai
8
+ dashboard. The CLI now says exactly that (deploy itself still succeeds; exit
9
+ code stays non-zero so scripts notice the run did not start).
10
+
11
+ - **Documented the platform's runtimeMode display mapping.** The platform
12
+ stores `wrap` under its own enum name `script` (`llm` round-trips as `llm`);
13
+ verified live — this is display-side naming, not data loss.
14
+
15
+ ## 0.1.2
16
+
17
+ - **`kohala validate` now rejects tool ids not in the bundled platform
18
+ catalog snapshot** (BUG-033). A typo'd tool id (e.g. `htpp.geet`) used to
19
+ pass validation and only fail at deploy/run time; it now fails validation
20
+ offline with the offending id(s) named. Pass `--allow-unknown-tools` to
21
+ bypass when the snapshot lags newly added platform tools — the deploy
22
+ endpoint still verifies against the live catalog authoritatively.
23
+
24
+ - **Docs: LLM model-override env vars and `memory serve` agent scoping**
25
+ (BUG-047, BUG-035). The README now documents `KOHALA_LLM_MODEL`,
26
+ `ANTHROPIC_MODEL`, and `GEMINI_MODEL`, and clarifies that
27
+ `kohala memory serve` is always scoped to one agent (run it inside an
28
+ agent directory or pass `--agent <name>`).
29
+
30
+ - **Repo hygiene: removed Replit workspace scaffolding from the repository**
31
+ (BUG-016). `.replit`, `replit.md`, `attached_assets/`, and `artifacts/`
32
+ are no longer tracked in the public repo.
33
+
34
+ ## 0.1.1
4
35
 
5
36
  Bug fixes.
6
37
 
package/README.md CHANGED
@@ -93,3 +93,24 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). Bug reports and PRs welcome.
93
93
  ## License
94
94
 
95
95
  [MIT](LICENSE)
96
+
97
+ ### LLM model overrides (local emulator)
98
+
99
+ `kohala run` in LLM mode picks its model from environment variables:
100
+
101
+ | Variable | Effect |
102
+ | --- | --- |
103
+ | `KOHALA_LLM_MODEL` | Provider-agnostic override — takes precedence over the two below. |
104
+ | `ANTHROPIC_MODEL` | Anthropic model id (e.g. `claude-3-5-haiku-latest`). |
105
+ | `GEMINI_MODEL` | Gemini model id (e.g. `gemini-2.0-flash`). |
106
+
107
+ Unset, the emulator uses its built-in defaults.
108
+
109
+ ### Memory server scoping
110
+
111
+ `kohala memory serve` is always scoped to ONE agent. Either run it from inside
112
+ an agent directory (one containing `kohala.json`) or pass `--agent <name>`:
113
+
114
+ ```bash
115
+ kohala memory serve --agent my-agent --backend file
116
+ ```
package/dist/cli/index.js CHANGED
@@ -190,12 +190,240 @@ function loadManifest(agentDir) {
190
190
  return result.data;
191
191
  }
192
192
 
193
+ // src/manifest/known-tools.ts
194
+ var KNOWN_TOOL_IDS = /* @__PURE__ */ new Set([
195
+ "http.get",
196
+ "http.brightdata",
197
+ "run_python_script",
198
+ "web.search",
199
+ "image.generate",
200
+ "code.run",
201
+ "s3.put",
202
+ "koan.publish",
203
+ "report.publish",
204
+ "email.send",
205
+ "send_email",
206
+ "email.user_send",
207
+ "email.user_inbox",
208
+ "calendar.user_events",
209
+ "calendar.user_create_event",
210
+ "whatsapp.user_send",
211
+ "whatsapp.user_inbox",
212
+ "linkedin.user_post",
213
+ "linkedin.user_profile",
214
+ "linkedin.org_posts",
215
+ "linkedin.org_stats",
216
+ "validate_output",
217
+ "html.parse",
218
+ "json.parse",
219
+ "csv.parse",
220
+ "canvas.message",
221
+ "canvas.request_approval",
222
+ "odoo.search_read",
223
+ "odoo.read",
224
+ "odoo.read_group",
225
+ "odoo.create",
226
+ "odoo.write",
227
+ "odoo.unlink",
228
+ "odoo.call_method",
229
+ "odoo.message_post",
230
+ "odoo.attachments.upload",
231
+ "aftership.create_tracking",
232
+ "aftership.get_tracking",
233
+ "aftership.list_trackings",
234
+ "aftership.update_tracking",
235
+ "aftership.delete_tracking",
236
+ "aftership.detect_courier",
237
+ "fedex.track",
238
+ "ups.track",
239
+ "era5.point_history",
240
+ "noaa.forecast",
241
+ "noaa.alerts",
242
+ "airlabs.flight",
243
+ "airlabs.schedules",
244
+ "adsb.aircraft_near",
245
+ "adsb.by_callsign",
246
+ "aftership.list_couriers",
247
+ "ga.run_report",
248
+ "ga.realtime_report",
249
+ "ga.get_metadata",
250
+ "ga.list_properties",
251
+ "epicor.query",
252
+ "epicor.list",
253
+ "epicor.get",
254
+ "epicor.create",
255
+ "epicor.update",
256
+ "epicor.call_method",
257
+ "ideogram.generate",
258
+ "ideogram.edit",
259
+ "ideogram.remix",
260
+ "ideogram.reframe",
261
+ "ideogram.replace_background",
262
+ "ideogram.upscale",
263
+ "ideogram.describe",
264
+ "elevenlabs.text_to_speech",
265
+ "elevenlabs.speech_to_text",
266
+ "elevenlabs.speech_to_speech",
267
+ "elevenlabs.sound_effects",
268
+ "elevenlabs.voice_isolator",
269
+ "elevenlabs.music",
270
+ "elevenlabs.dubbing",
271
+ "elevenlabs.dubbing_result",
272
+ "elevenlabs.voice_design",
273
+ "elevenlabs.list_voices",
274
+ "video.generate_social",
275
+ "video.generate_cinematic",
276
+ "video.generate_avatar",
277
+ "video.status",
278
+ "extract.fields",
279
+ "extract.receipt",
280
+ "extract.financial",
281
+ "extract.legal",
282
+ "extract.product_spec",
283
+ "extract.menu",
284
+ "extract.evaluate",
285
+ "memory.search",
286
+ "memory.remember",
287
+ "http.post_json",
288
+ "s3.list",
289
+ "s3.get",
290
+ "s3.delete",
291
+ "feed.fetch",
292
+ "text.diff",
293
+ "data.diff",
294
+ "pinecone.upsert",
295
+ "pinecone.query",
296
+ "pinecone.fetch",
297
+ "pinecone.delete",
298
+ "llm.complete",
299
+ "pdf.extract",
300
+ "geocode",
301
+ "slack.message",
302
+ "discord.message",
303
+ "schedule.next_run",
304
+ "schedule.last_run",
305
+ "metrics.record",
306
+ "vector.embed",
307
+ "sms.send",
308
+ "push.send",
309
+ "webhook.post",
310
+ "notify.send",
311
+ "agent.handoff",
312
+ "bus.publish",
313
+ "bus.subscribe",
314
+ "bus.list_subscriptions",
315
+ "bus.unsubscribe",
316
+ "invoice.record",
317
+ "invoice.generate",
318
+ "invoice.modify",
319
+ "invoice.list",
320
+ "invoice.publish_koan",
321
+ "invoice.ap_run",
322
+ "invoice.ap_sweep",
323
+ "invoice.ar_sweep",
324
+ "invoice.ar_draft",
325
+ "invoice.send",
326
+ "invoice.review",
327
+ "invoice.calibrate",
328
+ "invoice.settings",
329
+ "invoice.status",
330
+ "sales_agreement.record",
331
+ "sales_agreement.review",
332
+ "sales_agreement.list",
333
+ "sales_agreement.publish_koan",
334
+ "customers.list",
335
+ "customers.add",
336
+ "customers.get_brand_profile",
337
+ "secrets.get",
338
+ "secrets.set",
339
+ "secrets.list",
340
+ "secrets.delete",
341
+ "aws.ec2_list",
342
+ "aws.ec2_start",
343
+ "aws.ec2_stop",
344
+ "aws.s3_list",
345
+ "aws.lambda_list",
346
+ "aws.lambda_invoke",
347
+ "aws.cloudwatch_alarms",
348
+ "aws.cost_summary",
349
+ "aws.rds_list",
350
+ "aws.bedrock_models",
351
+ "aws.grafana_list",
352
+ "googleads.list_accounts",
353
+ "googleads.search",
354
+ "googleads.campaign_performance",
355
+ "googleads.ad_group_performance",
356
+ "googleads.keyword_performance",
357
+ "googleads.budget_summary",
358
+ "calendar.generate",
359
+ "content.analyze",
360
+ "finance.ar.summary",
361
+ "finance.ar_aging",
362
+ "finance.ar_pastdue_report",
363
+ "finance.ar_overdue_notify",
364
+ "finance.ap.summary",
365
+ "finance.ap_aging",
366
+ "finance.reporting.summary",
367
+ "finance.trial_balance",
368
+ "sales.pipeline.summary",
369
+ "sales.pipeline_read",
370
+ "inventory.stock.summary",
371
+ "inventory.procurement_read",
372
+ "slack.list_channels",
373
+ "slack.post_message",
374
+ "notion.search",
375
+ "notion.append_page",
376
+ "hubspot.list_engagements",
377
+ "hubspot.log_call",
378
+ "hubspot.update_deal",
379
+ "linear.create_issue",
380
+ "asana.create_task",
381
+ "airtable.list_records",
382
+ "airtable.create_record",
383
+ "pandadoc.create_document",
384
+ "canva.create_design",
385
+ "canva.autofill_deck",
386
+ "zapier.trigger_zap",
387
+ "commitments.recall",
388
+ "workspacesync.fanout",
389
+ "dealdesk.draft",
390
+ "pricing.catalog_list",
391
+ "pricing.assumptions_list",
392
+ "pricing.benchmark_list",
393
+ "pricing.single_use_list",
394
+ "pricing.reusable_tco_list",
395
+ "pricing.monitoring_list",
396
+ "pricing.simulate_save"
397
+ ]);
398
+ function unknownToolIds(tools) {
399
+ return tools.filter((t) => !KNOWN_TOOL_IDS.has(t));
400
+ }
401
+
193
402
  // src/cli/validate.ts
194
403
  function registerValidateCommand(program2) {
195
- program2.command("validate").argument("<agent>", "agent directory (containing kohala.json)").description("Validate an agent's kohala.json and print precise errors").action((agent) => {
404
+ program2.command("validate").argument("<agent>", "agent directory (containing kohala.json)").option(
405
+ "--allow-unknown-tools",
406
+ "do not fail on tool ids missing from the bundled catalog snapshot"
407
+ ).description("Validate an agent's kohala.json and print precise errors").action((agent, options) => {
196
408
  const agentDir = path3.resolve(process.cwd(), agent);
197
409
  try {
198
410
  const manifest = loadManifest(agentDir);
411
+ const unknown = unknownToolIds(manifest.toolAllowlist);
412
+ if (unknown.length > 0) {
413
+ const msg = `toolAllowlist contains tool id(s) not in the Kohala tool catalog: ` + unknown.join(", ");
414
+ if (options.allowUnknownTools) {
415
+ console.warn(pc2.yellow(`warning: ${msg}`));
416
+ } else {
417
+ console.error(pc2.red(msg));
418
+ console.error(
419
+ pc2.dim(
420
+ " If these are new platform tools the bundled snapshot doesn't know yet, re-run with --allow-unknown-tools (the deploy endpoint will still verify against the live catalog)."
421
+ )
422
+ );
423
+ process.exitCode = 1;
424
+ return;
425
+ }
426
+ }
199
427
  console.log(pc2.green(`kohala.json for "${manifest.name}" is valid.`));
200
428
  console.log(
201
429
  pc2.dim(
@@ -2172,8 +2400,26 @@ function registerDeployCommand(program2) {
2172
2400
  )
2173
2401
  );
2174
2402
  if (options.run) {
2175
- const runUrl = await client.triggerManualRun(upserted.id);
2176
- console.log(pc8.green(` \u2714 manual run triggered: ${runUrl}`));
2403
+ try {
2404
+ const runUrl = await client.triggerManualRun(upserted.id);
2405
+ console.log(pc8.green(` \u2714 manual run triggered: ${runUrl}`));
2406
+ } catch (error) {
2407
+ if (error instanceof DeployError && error.status === 409) {
2408
+ console.error(
2409
+ pc8.yellow(
2410
+ ` \u2716 manual run not started: the agent is not enabled on the platform yet.`
2411
+ )
2412
+ );
2413
+ console.error(
2414
+ pc8.dim(
2415
+ ` Deploy itself succeeded. Enable "${manifest.name}" in your kohala.ai dashboard, then re-run \`kohala deploy ${agent} --run\` (or trigger a run from the dashboard).`
2416
+ )
2417
+ );
2418
+ process.exitCode = 1;
2419
+ return;
2420
+ }
2421
+ throw error;
2422
+ }
2177
2423
  }
2178
2424
  console.log("");
2179
2425
  console.log(pc8.green(`Deployed. Deploys are additive \u2014 nothing was deleted remotely.`));