@alexkroman1/aai-cli 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/dist/{_bundler-CgBw5Bcu.mjs → _bundler-B6v31ROV.mjs} +1 -1
- package/dist/_console-audio.d.ts +18 -0
- package/dist/{_dev-server-BNq5OnUJ.mjs → _dev-server-GoEXEVpA.mjs} +2 -2
- package/dist/_resource-commands.d.ts +34 -2
- package/dist/{_slug-api-DJuwYZ6T.mjs → _slug-api-BnmTHtjd.mjs} +1 -1
- package/dist/{_studio-BH05zugt.mjs → _studio-B5m4jBTD.mjs} +14 -9
- package/dist/_studio.d.ts +16 -4
- package/dist/_target-bundle.d.ts +2 -0
- package/dist/{_templates-Bv-rd0SO.mjs → _templates-BVMVsQh0.mjs} +10 -6
- package/dist/_templates.d.ts +9 -2
- package/dist/{build-B37oBfEv.mjs → build-CKhanHVv.mjs} +28 -32
- package/dist/cli-workflow.d.ts +7 -0
- package/dist/cli.mjs +213 -181
- package/dist/{client-bundler-D4SeZJ8E.mjs → client-bundler-DZ_Zoznn.mjs} +2 -1
- package/dist/client-bundler.d.ts +7 -1
- package/dist/client-bundler.mjs +1 -1
- package/dist/{console-D6OOjjeJ.mjs → console-Dxq26Adz.mjs} +14 -10
- package/dist/{delete-Br0EOH0g.mjs → delete-DwXCHzTl.mjs} +8 -8
- package/dist/delete.d.ts +4 -3
- package/dist/{deploy-CLUH5cv2.mjs → deploy-CbA8Ibiu.mjs} +2 -2
- package/dist/{dev-ZVuyPLUk.mjs → dev-BWBDbUEb.mjs} +1 -1
- package/dist/{init-x3FsKl2q.mjs → init-CidslZZz.mjs} +1 -1
- package/dist/{logs-BfRq1HX9.mjs → logs-CnPK-Prw.mjs} +25 -3
- package/dist/scaffold/CLAUDE.md +52 -52
- package/dist/scaffold/agent-guide/AGENT-API.md +20 -20
- package/dist/scaffold/agent-guide/HOSTING.md +32 -33
- package/dist/scaffold/agent-guide/PIPELINE-TUNING.md +44 -47
- package/dist/scaffold/agent-guide/PROVIDERS.md +54 -57
- package/dist/scaffold/agent-guide/TESTING-EVALS.md +31 -31
- package/dist/scaffold/agent-guide/TOOLS.md +86 -87
- package/dist/scaffold/agent-guide/UI.md +59 -58
- package/dist/scaffold/agent-guide/WORKFLOWS.md +129 -127
- package/dist/scaffold/package.json +4 -4
- package/dist/scaffold/vitest.config.ts +3 -3
- package/dist/{secret-Db1UWLSZ.mjs → secret-DPdPEet2.mjs} +2 -2
- package/dist/{studio-DAoJApzD.mjs → studio-COjK25Rl.mjs} +23 -24
- package/dist/studio.d.ts +5 -4
- package/dist/templates/call-audit-workflow/agent.eval.test.ts +6 -6
- package/dist/templates/call-audit-workflow/agent.test.ts +2 -2
- package/dist/templates/document-redline-workflow/agent.eval.test.ts +14 -17
- package/dist/templates/home-assistant-agent/agent.test.ts +0 -1
- package/dist/templates/link-digest-workflow/agent.eval.test.ts +2 -2
- package/dist/templates/link-digest-workflow/agent.test.ts +24 -25
- package/dist/templates/medication-safety-agent/agent.test.ts +15 -18
- package/dist/templates/medication-safety-agent/fda.test.ts +16 -17
- package/dist/templates/medication-safety-agent/fda.ts +7 -0
- package/dist/templates/medication-safety-agent/tools/check_drug_interaction.ts +61 -53
- package/dist/templates/medication-safety-agent/tools/medication_lookup.ts +42 -32
- package/dist/templates/meeting-recap-agent/agent.eval.test.ts +29 -16
- package/dist/templates/podcast-digest-workflow/agent.eval.test.ts +3 -3
- package/dist/templates/podcast-digest-workflow/agent.test.ts +17 -17
- package/dist/templates/research-handoff-agent/agent.eval.test.ts +22 -15
- package/dist/templates/research-handoff-agent/agent.test.ts +2 -15
- package/dist/templates/research-planner-agent/agent.test.ts +22 -17
- package/dist/templates/research-planner-agent/shared.ts +122 -93
- package/dist/templates/retail-orders-agent/shared.ts +2 -2
- package/dist/templates/retail-orders-agent/tools/get_order_details.ts +1 -1
- package/dist/templates/spoken-summary-workflow/agent.eval.test.ts +6 -6
- package/dist/templates/spoken-summary-workflow/agent.test.ts +2 -2
- package/dist/templates/transcription-workflow/agent.eval.test.ts +3 -3
- package/dist/templates/transcription-workflow/agent.test.ts +2 -1
- package/dist/templates/transcription-workflow/recover.test.ts +4 -7
- package/dist/templates/web-research-agent/agent.test.ts +4 -3
- package/dist/templates/word-game-agent/agent.test.ts +11 -5
- package/package.json +6 -6
package/dist/cli.mjs
CHANGED
|
@@ -403,102 +403,127 @@ const localArg = {
|
|
|
403
403
|
type: "boolean",
|
|
404
404
|
description: "Edit this project's .env instead of the platform's secrets (no login needed)"
|
|
405
405
|
};
|
|
406
|
-
const secretPut = defineExec({
|
|
407
|
-
meta: {
|
|
408
|
-
name: "put",
|
|
409
|
-
description: "Create or update a secret (value read from stdin, or prompted on a terminal)"
|
|
410
|
-
},
|
|
411
|
-
args: {
|
|
412
|
-
name: {
|
|
413
|
-
type: "positional",
|
|
414
|
-
description: "Secret name. The VALUE is not an argument — pipe it in (`printf %s \"$VALUE\" | aai secret put NAME`), or be prompted, masked, when stdin is a terminal",
|
|
415
|
-
required: true
|
|
416
|
-
},
|
|
417
|
-
local: localArg,
|
|
418
|
-
...platformArgs
|
|
419
|
-
},
|
|
420
|
-
cwd: "any",
|
|
421
|
-
async run({ args, mode, cwd, ui }) {
|
|
422
|
-
refuseValueInArgv(args._);
|
|
423
|
-
const { executeLocalSecretPut, executeSecretPut, resolveSecretValue } = await import("./secret-Db1UWLSZ.mjs");
|
|
424
|
-
const value = await resolveSecretValue(args.name, mode);
|
|
425
|
-
return args.local ? executeLocalSecretPut(cwd, args.name, value, ui) : executeSecretPut(cwd, args.name, value, args.server, ui);
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
const secretDelete = defineExec({
|
|
429
|
-
meta: {
|
|
430
|
-
name: "delete",
|
|
431
|
-
description: "Delete a secret"
|
|
432
|
-
},
|
|
433
|
-
args: {
|
|
434
|
-
name: {
|
|
435
|
-
type: "positional",
|
|
436
|
-
description: "Secret name",
|
|
437
|
-
required: true
|
|
438
|
-
},
|
|
439
|
-
local: localArg,
|
|
440
|
-
...platformArgs
|
|
441
|
-
},
|
|
442
|
-
cwd: "any",
|
|
443
|
-
async run({ args, cwd, ui }) {
|
|
444
|
-
const { executeLocalSecretDelete, executeSecretDelete } = await import("./secret-Db1UWLSZ.mjs");
|
|
445
|
-
return args.local ? executeLocalSecretDelete(cwd, args.name, ui) : executeSecretDelete(cwd, args.name, args.server, ui);
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
const secretList = defineExec({
|
|
449
|
-
meta: {
|
|
450
|
-
name: "list",
|
|
451
|
-
description: "List all secrets"
|
|
452
|
-
},
|
|
453
|
-
args: { ...platformArgs },
|
|
454
|
-
cwd: "any",
|
|
455
|
-
async run({ args, cwd, ui }) {
|
|
456
|
-
const { executeSecretList } = await import("./secret-Db1UWLSZ.mjs");
|
|
457
|
-
return executeSecretList(cwd, args.server, ui);
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
const secret = defineCommand({
|
|
461
|
-
meta: {
|
|
462
|
-
name: "secret",
|
|
463
|
-
description: "Manage agent secrets"
|
|
464
|
-
},
|
|
465
|
-
subCommands: {
|
|
466
|
-
put: secretPut,
|
|
467
|
-
delete: secretDelete,
|
|
468
|
-
list: secretList
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
406
|
/** An optional `[dir]` positional, resolved against the working directory. */
|
|
472
407
|
function resolveDirArg(cwd, dir) {
|
|
473
408
|
return dir ? path.resolve(cwd, dir) : cwd;
|
|
474
409
|
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
410
|
+
/**
|
|
411
|
+
* The optional `[dir]` positional the project-scoped subcommands share.
|
|
412
|
+
*
|
|
413
|
+
* Named for what it is rather than for `storage`, which was the only group
|
|
414
|
+
* that had one when it was written — `logs` takes the same positional and
|
|
415
|
+
* read as borrowing another command's arg.
|
|
416
|
+
*/
|
|
417
|
+
const dirArg = {
|
|
418
|
+
type: "positional",
|
|
419
|
+
description: "Project directory",
|
|
420
|
+
required: false
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* The real executors, imported lazily — the CLI's startup path must not pay for
|
|
424
|
+
* a command nobody invoked.
|
|
425
|
+
*/
|
|
426
|
+
const REAL_EXECUTORS = {
|
|
427
|
+
secret: () => import("./secret-DPdPEet2.mjs"),
|
|
428
|
+
logs: () => import("./logs-CnPK-Prw.mjs")
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* Build `aai secret` and `aai logs` over `load`. The seam a spec hands fake
|
|
432
|
+
* executors through; the CLI uses the exported `secret`/`logs` below.
|
|
433
|
+
*/
|
|
434
|
+
function createResourceCommands(load = REAL_EXECUTORS) {
|
|
435
|
+
const secretPut = defineExec({
|
|
436
|
+
meta: {
|
|
437
|
+
name: "put",
|
|
438
|
+
description: "Create or update a secret (value read from stdin, or prompted on a terminal)"
|
|
485
439
|
},
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
440
|
+
args: {
|
|
441
|
+
name: {
|
|
442
|
+
type: "positional",
|
|
443
|
+
description: "Secret name. The VALUE is not an argument — pipe it in (`printf %s \"$VALUE\" | aai secret put NAME`), or be prompted, masked, when stdin is a terminal",
|
|
444
|
+
required: true
|
|
445
|
+
},
|
|
446
|
+
local: localArg,
|
|
447
|
+
...platformArgs
|
|
490
448
|
},
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
449
|
+
cwd: "any",
|
|
450
|
+
async run({ args, mode, cwd, ui }) {
|
|
451
|
+
refuseValueInArgv(args._);
|
|
452
|
+
const { executeLocalSecretPut, executeSecretPut, resolveSecretValue } = await load.secret();
|
|
453
|
+
const value = await resolveSecretValue(args.name, mode);
|
|
454
|
+
return args.local ? executeLocalSecretPut(cwd, args.name, value, ui) : executeSecretPut(cwd, args.name, value, args.server, ui);
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
const secretDelete = defineExec({
|
|
458
|
+
meta: {
|
|
459
|
+
name: "delete",
|
|
460
|
+
description: "Delete a secret"
|
|
461
|
+
},
|
|
462
|
+
args: {
|
|
463
|
+
name: {
|
|
464
|
+
type: "positional",
|
|
465
|
+
description: "Secret name",
|
|
466
|
+
required: true
|
|
467
|
+
},
|
|
468
|
+
local: localArg,
|
|
469
|
+
...platformArgs
|
|
470
|
+
},
|
|
471
|
+
cwd: "any",
|
|
472
|
+
async run({ args, cwd, ui }) {
|
|
473
|
+
const { executeLocalSecretDelete, executeSecretDelete } = await load.secret();
|
|
474
|
+
return args.local ? executeLocalSecretDelete(cwd, args.name, ui) : executeSecretDelete(cwd, args.name, args.server, ui);
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
const secretList = defineExec({
|
|
478
|
+
meta: {
|
|
479
|
+
name: "list",
|
|
480
|
+
description: "List all secrets"
|
|
481
|
+
},
|
|
482
|
+
args: { ...platformArgs },
|
|
483
|
+
cwd: "any",
|
|
484
|
+
async run({ args, cwd, ui }) {
|
|
485
|
+
const { executeSecretList } = await load.secret();
|
|
486
|
+
return executeSecretList(cwd, args.server, ui);
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
return {
|
|
490
|
+
secret: defineCommand({
|
|
491
|
+
meta: {
|
|
492
|
+
name: "secret",
|
|
493
|
+
description: "Manage agent secrets"
|
|
494
|
+
},
|
|
495
|
+
subCommands: {
|
|
496
|
+
put: secretPut,
|
|
497
|
+
delete: secretDelete,
|
|
498
|
+
list: secretList
|
|
499
|
+
}
|
|
500
|
+
}),
|
|
501
|
+
logs: defineExec({
|
|
502
|
+
meta: {
|
|
503
|
+
name: "logs",
|
|
504
|
+
description: "Show what the deployed agent has printed"
|
|
505
|
+
},
|
|
506
|
+
args: {
|
|
507
|
+
dir: dirArg,
|
|
508
|
+
follow: {
|
|
509
|
+
type: "boolean",
|
|
510
|
+
alias: "f",
|
|
511
|
+
description: "Keep printing new output"
|
|
512
|
+
},
|
|
513
|
+
...platformArgs
|
|
514
|
+
},
|
|
515
|
+
cwd: "any",
|
|
516
|
+
async run({ args, cwd, ui }) {
|
|
517
|
+
const { executeLogs } = await load.logs();
|
|
518
|
+
return executeLogs(resolveDirArg(cwd, args.dir), {
|
|
519
|
+
server: args.server,
|
|
520
|
+
follow: args.follow
|
|
521
|
+
}, ui);
|
|
522
|
+
}
|
|
523
|
+
})
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
const { secret, logs } = createResourceCommands();
|
|
502
527
|
//#endregion
|
|
503
528
|
//#region src/_studio-commands.ts
|
|
504
529
|
/**
|
|
@@ -520,7 +545,7 @@ const list = defineExec({
|
|
|
520
545
|
args: { ...platformArgs },
|
|
521
546
|
cwd: "any",
|
|
522
547
|
async run({ args, cwd, ui }) {
|
|
523
|
-
const { executeList } = await import("./studio-
|
|
548
|
+
const { executeList } = await import("./studio-COjK25Rl.mjs");
|
|
524
549
|
return executeList({
|
|
525
550
|
cwd,
|
|
526
551
|
server: args.server
|
|
@@ -552,7 +577,7 @@ const pull = defineExec({
|
|
|
552
577
|
},
|
|
553
578
|
cwd: "any",
|
|
554
579
|
async run({ args, cwd, ui }) {
|
|
555
|
-
const { executePull } = await import("./studio-
|
|
580
|
+
const { executePull } = await import("./studio-COjK25Rl.mjs");
|
|
556
581
|
return executePull({
|
|
557
582
|
cwd,
|
|
558
583
|
project: args.project,
|
|
@@ -573,7 +598,7 @@ const push = defineExec({
|
|
|
573
598
|
},
|
|
574
599
|
cwd: "agent",
|
|
575
600
|
async run({ args, cwd, ui }) {
|
|
576
|
-
const { executePush } = await import("./studio-
|
|
601
|
+
const { executePush } = await import("./studio-COjK25Rl.mjs");
|
|
577
602
|
return executePush({
|
|
578
603
|
cwd,
|
|
579
604
|
server: args.server,
|
|
@@ -596,7 +621,7 @@ const publish = defineExec({
|
|
|
596
621
|
},
|
|
597
622
|
cwd: "agent",
|
|
598
623
|
async run({ args, cwd, ui }) {
|
|
599
|
-
const { executePublish } = await import("./studio-
|
|
624
|
+
const { executePublish } = await import("./studio-COjK25Rl.mjs");
|
|
600
625
|
return executePublish({
|
|
601
626
|
cwd,
|
|
602
627
|
server: args.server,
|
|
@@ -681,88 +706,95 @@ const workflowOpts = (args) => ({
|
|
|
681
706
|
token: args.token,
|
|
682
707
|
agent: args.agent
|
|
683
708
|
});
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
return executeWorkflowList(cwd, workflowOpts(args), ui);
|
|
694
|
-
}
|
|
695
|
-
});
|
|
696
|
-
const workflowRuns = defineExec({
|
|
697
|
-
meta: {
|
|
698
|
-
name: "runs",
|
|
699
|
-
description: "List recent runs of one workflow, newest first"
|
|
700
|
-
},
|
|
701
|
-
args: {
|
|
702
|
-
workflow: {
|
|
703
|
-
type: "positional",
|
|
704
|
-
description: "Workflow name",
|
|
705
|
-
required: true
|
|
709
|
+
/**
|
|
710
|
+
* Build the group over `load`, which resolves the executors only when a verb
|
|
711
|
+
* runs (the lazy import above). The seam a spec hands fake executors through.
|
|
712
|
+
*/
|
|
713
|
+
function createWorkflowCommand(load = () => import("./workflow-CDUlTD5B.mjs")) {
|
|
714
|
+
const workflowList = defineExec({
|
|
715
|
+
meta: {
|
|
716
|
+
name: "list",
|
|
717
|
+
description: "List the workflows this agent declares"
|
|
706
718
|
},
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
719
|
+
args: workflowArgs,
|
|
720
|
+
cwd: WORKFLOW_CWD,
|
|
721
|
+
async run({ args, cwd, ui }) {
|
|
722
|
+
const { executeWorkflowList } = await load();
|
|
723
|
+
return executeWorkflowList(cwd, workflowOpts(args), ui);
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
const workflowRuns = defineExec({
|
|
727
|
+
meta: {
|
|
728
|
+
name: "runs",
|
|
729
|
+
description: "List recent runs of one workflow, newest first"
|
|
710
730
|
},
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
731
|
+
args: {
|
|
732
|
+
workflow: {
|
|
733
|
+
type: "positional",
|
|
734
|
+
description: "Workflow name",
|
|
735
|
+
required: true
|
|
736
|
+
},
|
|
737
|
+
limit: {
|
|
738
|
+
type: "string",
|
|
739
|
+
description: "How many runs to list"
|
|
740
|
+
},
|
|
741
|
+
...workflowArgs
|
|
742
|
+
},
|
|
743
|
+
cwd: WORKFLOW_CWD,
|
|
744
|
+
async run({ args, cwd, ui }) {
|
|
745
|
+
const { executeWorkflowRuns } = await load();
|
|
746
|
+
const limit = args.limit === void 0 ? void 0 : Number(args.limit);
|
|
747
|
+
if (limit !== void 0 && !Number.isFinite(limit)) throw new CliError("bad_limit", "--limit must be a number");
|
|
748
|
+
return executeWorkflowRuns(cwd, args.workflow, {
|
|
749
|
+
...workflowOpts(args),
|
|
750
|
+
limit
|
|
751
|
+
}, ui);
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
const workflowShow = defineExec({
|
|
755
|
+
meta: {
|
|
756
|
+
name: "show",
|
|
757
|
+
description: "Show one run, including its output"
|
|
758
|
+
},
|
|
759
|
+
args: {
|
|
760
|
+
runId: runIdArg,
|
|
761
|
+
...workflowArgs
|
|
762
|
+
},
|
|
763
|
+
cwd: WORKFLOW_CWD,
|
|
764
|
+
async run({ args, cwd, ui }) {
|
|
765
|
+
const { executeWorkflowShow } = await load();
|
|
766
|
+
return executeWorkflowShow(cwd, args.runId, workflowOpts(args), ui);
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
const workflowCancel = defineExec({
|
|
770
|
+
meta: {
|
|
771
|
+
name: "cancel",
|
|
772
|
+
description: "Stop a running workflow run"
|
|
773
|
+
},
|
|
774
|
+
args: {
|
|
775
|
+
runId: runIdArg,
|
|
776
|
+
...workflowArgs
|
|
777
|
+
},
|
|
778
|
+
cwd: WORKFLOW_CWD,
|
|
779
|
+
async run({ args, cwd, ui }) {
|
|
780
|
+
const { executeWorkflowCancel } = await load();
|
|
781
|
+
return executeWorkflowCancel(cwd, args.runId, workflowOpts(args), ui);
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
return defineCommand({
|
|
785
|
+
meta: {
|
|
786
|
+
name: "workflow",
|
|
787
|
+
description: "Inspect and steer durable workflow runs"
|
|
788
|
+
},
|
|
789
|
+
subCommands: {
|
|
790
|
+
list: workflowList,
|
|
791
|
+
runs: workflowRuns,
|
|
792
|
+
show: workflowShow,
|
|
793
|
+
cancel: workflowCancel
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
const workflow = createWorkflowCommand();
|
|
766
798
|
//#endregion
|
|
767
799
|
//#region src/cli.ts
|
|
768
800
|
const cliDir = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -819,7 +851,7 @@ const init = defineExec({
|
|
|
819
851
|
},
|
|
820
852
|
cwd: "none",
|
|
821
853
|
async run({ args, mode, ui }) {
|
|
822
|
-
const { executeInit } = await import("./init-
|
|
854
|
+
const { executeInit } = await import("./init-CidslZZz.mjs");
|
|
823
855
|
return executeInit({
|
|
824
856
|
dir: args.dir,
|
|
825
857
|
force: args.force,
|
|
@@ -860,7 +892,7 @@ const dev = defineExec({
|
|
|
860
892
|
},
|
|
861
893
|
cwd: "agent",
|
|
862
894
|
async run({ args, cwd, ui }) {
|
|
863
|
-
const { executeDev } = await import("./dev-
|
|
895
|
+
const { executeDev } = await import("./dev-BWBDbUEb.mjs");
|
|
864
896
|
return executeDev({
|
|
865
897
|
cwd,
|
|
866
898
|
port: args.port,
|
|
@@ -881,7 +913,7 @@ const consoleCommand = defineExec({
|
|
|
881
913
|
} },
|
|
882
914
|
cwd: "agent",
|
|
883
915
|
async run({ args, cwd, mode, ui }) {
|
|
884
|
-
const { executeConsole } = await import("./console-
|
|
916
|
+
const { executeConsole } = await import("./console-Dxq26Adz.mjs");
|
|
885
917
|
return executeConsole({
|
|
886
918
|
cwd,
|
|
887
919
|
verbose: args.verbose,
|
|
@@ -971,7 +1003,7 @@ const build = defineExec({
|
|
|
971
1003
|
},
|
|
972
1004
|
cwd: "agent",
|
|
973
1005
|
async run({ args, cwd, ui }) {
|
|
974
|
-
const { executeBuild } = await import("./build-
|
|
1006
|
+
const { executeBuild } = await import("./build-CKhanHVv.mjs");
|
|
975
1007
|
return executeBuild({
|
|
976
1008
|
cwd,
|
|
977
1009
|
skipTests: args["skip-tests"],
|
|
@@ -999,7 +1031,7 @@ const deploy = defineExec({
|
|
|
999
1031
|
},
|
|
1000
1032
|
cwd: "agent",
|
|
1001
1033
|
async run({ args, cwd, ui }) {
|
|
1002
|
-
const { executeDeploy } = await import("./deploy-
|
|
1034
|
+
const { executeDeploy } = await import("./deploy-CbA8Ibiu.mjs");
|
|
1003
1035
|
return executeDeploy({
|
|
1004
1036
|
cwd,
|
|
1005
1037
|
server: args.server,
|
|
@@ -1016,7 +1048,7 @@ const del = defineExec({
|
|
|
1016
1048
|
args: { ...platformArgs },
|
|
1017
1049
|
cwd: "any",
|
|
1018
1050
|
async run({ args, cwd, ui }) {
|
|
1019
|
-
const { executeDelete } = await import("./delete-
|
|
1051
|
+
const { executeDelete } = await import("./delete-DwXCHzTl.mjs");
|
|
1020
1052
|
return executeDelete({
|
|
1021
1053
|
cwd,
|
|
1022
1054
|
server: args.server
|
|
@@ -1043,7 +1075,7 @@ const templates = defineExec({
|
|
|
1043
1075
|
args: { json: sharedArgs.json },
|
|
1044
1076
|
cwd: "none",
|
|
1045
1077
|
async run({ mode, ui }) {
|
|
1046
|
-
const { listTemplates } = await import("./_templates-
|
|
1078
|
+
const { listTemplates } = await import("./_templates-BVMVsQh0.mjs");
|
|
1047
1079
|
const names = await listTemplates();
|
|
1048
1080
|
if (mode === "human") {
|
|
1049
1081
|
for (const name of names) ui.log.message(name);
|
|
@@ -196,11 +196,12 @@ async function buildClient(cwd, options = {}) {
|
|
|
196
196
|
if (!await fileExists(clientEntry)) return {};
|
|
197
197
|
const plugins = options.plugins ?? (options.configFile === false ? void 0 : await defaultClientPlugins(cwd));
|
|
198
198
|
const outDir = options.outDir ?? DEFAULT_OUT_DIR;
|
|
199
|
+
const viteBuild = options.viteBuild ?? build;
|
|
199
200
|
const clientDir = path.join(cwd, outDir);
|
|
200
201
|
let cleanupHtml = () => {};
|
|
201
202
|
try {
|
|
202
203
|
cleanupHtml = writeTempHtml(cwd);
|
|
203
|
-
await withPreservedNodeEnv(() =>
|
|
204
|
+
await withPreservedNodeEnv(() => viteBuild(mergeConfig(devSourceViteConfig(), {
|
|
204
205
|
root: cwd,
|
|
205
206
|
base: "./",
|
|
206
207
|
logLevel: "silent",
|
package/dist/client-bundler.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PluginOption } from "vite";
|
|
1
|
+
import { type InlineConfig, type PluginOption } from "vite";
|
|
2
2
|
/**
|
|
3
3
|
* Options for client SPA bundling.
|
|
4
4
|
*
|
|
@@ -20,6 +20,12 @@ export type BuildClientOptions = {
|
|
|
20
20
|
configFile?: false;
|
|
21
21
|
/** Build output directory, relative to `cwd`. */
|
|
22
22
|
outDir?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The Vite build to run the assembled config through — Vite's own `build`
|
|
25
|
+
* unless given. A seam for specs, which assert on the config rather than
|
|
26
|
+
* running Rolldown.
|
|
27
|
+
*/
|
|
28
|
+
viteBuild?: (config: InlineConfig) => Promise<unknown>;
|
|
23
29
|
};
|
|
24
30
|
/**
|
|
25
31
|
* Build the client SPA with Vite if `client.tsx` exists.
|
package/dist/client-bundler.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { a as ok, n as fail } from "./_output-DBP9Op_d.mjs";
|
|
3
3
|
import { t as defaultUi } from "./_ui-Coe0zwmm.mjs";
|
|
4
4
|
import { o as errorDetail, s as errorMessage } from "./_utils-BVLdBvdT.mjs";
|
|
5
|
-
import { n as createWorkerEvaluator } from "./_bundler-
|
|
6
|
-
import { loadWorker, t as resolveAgentEnv } from "./_dev-server-
|
|
5
|
+
import { n as createWorkerEvaluator } from "./_bundler-B6v31ROV.mjs";
|
|
6
|
+
import { loadWorker, t as resolveAgentEnv } from "./_dev-server-GoEXEVpA.mjs";
|
|
7
7
|
import { styleText } from "node:util";
|
|
8
8
|
import { spawn } from "node:child_process";
|
|
9
9
|
import { connectSession, createRuntime, ensureSessionStateSchema, ensureWorkflowJournalSchema } from "@alexkroman1/aai-runtime";
|
|
@@ -57,7 +57,7 @@ function kill(child, signal) {
|
|
|
57
57
|
* Windows keeps the direct spawn: it has no bash, and its stdio pipes are
|
|
58
58
|
* named pipes rather than sockets.
|
|
59
59
|
*/
|
|
60
|
-
function spawnPlay(args) {
|
|
60
|
+
function spawnPlay(spawn, args) {
|
|
61
61
|
const stdio = [
|
|
62
62
|
"pipe",
|
|
63
63
|
"ignore",
|
|
@@ -74,7 +74,7 @@ function spawnPlay(args) {
|
|
|
74
74
|
/** bash's exit status for a command it could not find — the spawn's ENOENT, one shell down. */
|
|
75
75
|
const COMMAND_NOT_FOUND = 127;
|
|
76
76
|
/** Open the default microphone. */
|
|
77
|
-
function startCapture(sampleRate, onChunk, onError) {
|
|
77
|
+
function startCapture(spawn, sampleRate, onChunk, onError) {
|
|
78
78
|
const child = spawn("rec", [
|
|
79
79
|
"-q",
|
|
80
80
|
...RAW_PCM16,
|
|
@@ -111,11 +111,11 @@ function startCapture(sampleRate, onChunk, onError) {
|
|
|
111
111
|
* between reads, so a `play` blocked on an idle pipe — every moment the agent
|
|
112
112
|
* is not talking — ignores it and outlives the console.
|
|
113
113
|
*/
|
|
114
|
-
function startPlayback(sampleRate, onError) {
|
|
114
|
+
function startPlayback(spawn, sampleRate, onError) {
|
|
115
115
|
let stopped = false;
|
|
116
116
|
let child = open();
|
|
117
117
|
function open() {
|
|
118
|
-
const next = spawnPlay([
|
|
118
|
+
const next = spawnPlay(spawn, [
|
|
119
119
|
"-q",
|
|
120
120
|
...RAW_PCM16,
|
|
121
121
|
"-r",
|
|
@@ -149,11 +149,15 @@ function startPlayback(sampleRate, onError) {
|
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
+
/** SoX-backed devices that start their processes through `spawnFn`. */
|
|
153
|
+
function createSoxAudio(spawnFn = spawn) {
|
|
154
|
+
return {
|
|
155
|
+
startCapture: (sampleRate, onChunk, onError) => startCapture(spawnFn, sampleRate, onChunk, onError),
|
|
156
|
+
startPlayback: (sampleRate, onError) => startPlayback(spawnFn, sampleRate, onError)
|
|
157
|
+
};
|
|
158
|
+
}
|
|
152
159
|
/** The SoX-backed devices. */
|
|
153
|
-
const soxAudio =
|
|
154
|
-
startCapture,
|
|
155
|
-
startPlayback
|
|
156
|
-
};
|
|
160
|
+
const soxAudio = createSoxAudio();
|
|
157
161
|
//#endregion
|
|
158
162
|
//#region src/_console-session.ts
|
|
159
163
|
/**
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { a as ok } from "./_output-DBP9Op_d.mjs";
|
|
3
3
|
import { t as defaultUi } from "./_ui-Coe0zwmm.mjs";
|
|
4
4
|
import { l as writeProjectConfig } from "./_config-mq1I5Cva.mjs";
|
|
5
|
-
import { i as requireDeployedSlug
|
|
6
|
-
import { d as
|
|
5
|
+
import { i as requireDeployedSlug } from "./_agent-BopNO5Bq.mjs";
|
|
6
|
+
import { c as studioProjectApiUrl, d as apiRequest, f as apiTestSeam, t as REAL_STUDIO_DEPS, u as HINT_NOT_DEPLOYED } from "./_studio-B5m4jBTD.mjs";
|
|
7
7
|
import { omitUndefined } from "@alexkroman1/aai/utils";
|
|
8
8
|
//#region src/delete.ts
|
|
9
|
-
async function runDelete(opts) {
|
|
10
|
-
await
|
|
9
|
+
async function runDelete(opts, request = apiRequest) {
|
|
10
|
+
await request(`${opts.url}/${opts.slug}`, {
|
|
11
11
|
method: "DELETE",
|
|
12
12
|
apiKey: opts.apiKey,
|
|
13
13
|
action: "delete",
|
|
@@ -22,13 +22,13 @@ async function runDelete(opts) {
|
|
|
22
22
|
* delete the studio's own Delete button runs. A directory that only knows a
|
|
23
23
|
* slug (no studio link) deletes that deployed agent directly.
|
|
24
24
|
*/
|
|
25
|
-
async function executeDelete(opts, ui = defaultUi) {
|
|
25
|
+
async function executeDelete(opts, ui = defaultUi, deps = REAL_STUDIO_DEPS) {
|
|
26
26
|
const { cwd } = opts;
|
|
27
|
-
const { config, serverUrl, apiKey } = await resolveDeployTarget(cwd, opts.server);
|
|
27
|
+
const { config, serverUrl, apiKey } = await deps.resolveDeployTarget(cwd, opts.server);
|
|
28
28
|
if (config?.studioProject) {
|
|
29
29
|
const project = config.studioProject;
|
|
30
30
|
ui.log.step(`Deleting studio project ${project} (and its deployed agents)`);
|
|
31
|
-
await apiRequest(studioProjectApiUrl(serverUrl, project), {
|
|
31
|
+
await deps.apiRequest(studioProjectApiUrl(serverUrl, project), {
|
|
32
32
|
method: "DELETE",
|
|
33
33
|
apiKey,
|
|
34
34
|
action: "delete",
|
|
@@ -47,7 +47,7 @@ async function executeDelete(opts, ui = defaultUi) {
|
|
|
47
47
|
url: serverUrl,
|
|
48
48
|
slug,
|
|
49
49
|
apiKey
|
|
50
|
-
});
|
|
50
|
+
}, deps.apiRequest);
|
|
51
51
|
ui.log.success(`Deleted ${serverUrl}/${slug}`);
|
|
52
52
|
return ok({ slug });
|
|
53
53
|
}
|
package/dist/delete.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { type ApiTestSeam } from "./_api-client.ts";
|
|
1
|
+
import { type ApiTestSeam, apiRequest } from "./_api-client.ts";
|
|
2
2
|
import { type CommandResult } from "./_output.ts";
|
|
3
|
+
import { type StudioDeps } from "./_studio.ts";
|
|
3
4
|
import { type Ui } from "./_ui.ts";
|
|
4
5
|
export type DeleteOpts = ApiTestSeam & {
|
|
5
6
|
url: string;
|
|
6
7
|
slug: string;
|
|
7
8
|
apiKey: string;
|
|
8
9
|
};
|
|
9
|
-
export declare function runDelete(opts: DeleteOpts): Promise<void>;
|
|
10
|
+
export declare function runDelete(opts: DeleteOpts, request?: typeof apiRequest): Promise<void>;
|
|
10
11
|
type DeleteData = {
|
|
11
12
|
slug?: string;
|
|
12
13
|
project?: string;
|
|
@@ -21,5 +22,5 @@ type DeleteData = {
|
|
|
21
22
|
export declare function executeDelete(opts: {
|
|
22
23
|
cwd: string;
|
|
23
24
|
server?: string | undefined;
|
|
24
|
-
}, ui?: Ui): Promise<CommandResult<DeleteData>>;
|
|
25
|
+
}, ui?: Ui, deps?: StudioDeps): Promise<CommandResult<DeleteData>>;
|
|
25
26
|
export {};
|
|
@@ -4,11 +4,11 @@ import { n as fmtUrl, t as defaultUi } from "./_ui-Coe0zwmm.mjs";
|
|
|
4
4
|
import { s as errorMessage$1 } from "./_utils-BVLdBvdT.mjs";
|
|
5
5
|
import { s as updateProjectConfig } from "./_config-mq1I5Cva.mjs";
|
|
6
6
|
import { i as resolveServerEnv } from "./_server-common-CVXIeWrY.mjs";
|
|
7
|
-
import { i as evalWorkerConfig, t as buildAgentBundle } from "./_bundler-
|
|
7
|
+
import { i as evalWorkerConfig, t as buildAgentBundle } from "./_bundler-B6v31ROV.mjs";
|
|
8
8
|
import { o as resolveDeployTarget } from "./_agent-BopNO5Bq.mjs";
|
|
9
9
|
import { assertTypechecks } from "./_typecheck-gate-CcX2gLJZ.mjs";
|
|
10
10
|
import { n as scanWorkflowDeterminism, t as determinismWarnings } from "./_workflow-determinism-CLxFQ5ox.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { a as projectNameFromDir, d as apiRequest, f as apiTestSeam, p as checkedResponse } from "./_studio-B5m4jBTD.mjs";
|
|
12
12
|
import { isRecord, omitUndefined } from "@alexkroman1/aai/utils";
|
|
13
13
|
import { gzipSync } from "node:zlib";
|
|
14
14
|
//#region src/_deploy.ts
|