@hearsay-tools/squawk 0.18.0-dev.6972 → 0.18.0-dev.6981
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/automations/github-poller.js +1 -5
- package/dist/automations/github-poller.js.map +1 -1
- package/dist/automations/prompts.js +19 -14
- package/dist/automations/prompts.js.map +1 -1
- package/dist/automations/scheduler.d.ts +1 -1
- package/dist/automations/scheduler.js +3 -1
- package/dist/automations/scheduler.js.map +1 -1
- package/dist/automations/service.d.ts +1 -1
- package/dist/automations/service.js +3 -1
- package/dist/automations/service.js.map +1 -1
- package/dist/automations/tool-adapter.d.ts +6 -1
- package/dist/automations/tool-adapter.js +85 -1
- package/dist/automations/tool-adapter.js.map +1 -1
- package/dist/automations/tool-github.d.ts +9 -0
- package/dist/automations/tool-github.js +9 -0
- package/dist/automations/tool-github.js.map +1 -0
- package/dist/automations/tool-timeout.d.ts +2 -0
- package/dist/automations/tool-timeout.js +22 -0
- package/dist/automations/tool-timeout.js.map +1 -0
- package/dist/ci-wait/client.d.ts +2 -0
- package/dist/ci-wait/client.js +5 -0
- package/dist/ci-wait/client.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +387 -40
- package/dist/ci-wait/controller.js +13 -0
- package/dist/ci-wait/controller.js.map +1 -1
- package/dist/ci-wait/tool-catalog.d.ts +29 -0
- package/dist/ci-wait/tool-catalog.js +16 -1
- package/dist/ci-wait/tool-catalog.js.map +1 -1
- package/dist/ci-wait/tools.d.ts +100 -1
- package/dist/ci-wait/tools.js +10 -4
- package/dist/ci-wait/tools.js.map +1 -1
- package/dist/contract/automation-tool.d.ts +320 -0
- package/dist/contract/index.d.ts +2 -0
- package/dist/contract/index.js +55 -7
- package/dist/contract/runner-skills.d.ts +60 -0
- package/dist/core/claude-cli-runner.js +2 -4
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/claude-setting-sources.d.ts +2 -0
- package/dist/core/claude-setting-sources.js +7 -0
- package/dist/core/claude-setting-sources.js.map +1 -0
- package/dist/core/claude-skill-catalog.d.ts +4 -0
- package/dist/core/claude-skill-catalog.js +30 -0
- package/dist/core/claude-skill-catalog.js.map +1 -0
- package/dist/core/codex-skill-catalog.d.ts +4 -0
- package/dist/core/codex-skill-catalog.js +36 -0
- package/dist/core/codex-skill-catalog.js.map +1 -0
- package/dist/core/github-request-limits.d.ts +9 -0
- package/dist/core/github-request-limits.js +13 -0
- package/dist/core/github-request-limits.js.map +1 -0
- package/dist/core/host-skill-catalog.d.ts +5 -0
- package/dist/core/host-skill-catalog.js +16 -0
- package/dist/core/host-skill-catalog.js.map +1 -0
- package/dist/core/omp-skill-catalog.d.ts +4 -0
- package/dist/core/omp-skill-catalog.js +23 -0
- package/dist/core/omp-skill-catalog.js.map +1 -0
- package/dist/core/opencode-skill-catalog.d.ts +4 -0
- package/dist/core/opencode-skill-catalog.js +37 -0
- package/dist/core/opencode-skill-catalog.js.map +1 -0
- package/dist/core/pi-skill-catalog.d.ts +4 -0
- package/dist/core/pi-skill-catalog.js +35 -0
- package/dist/core/pi-skill-catalog.js.map +1 -0
- package/dist/core/runner-skill-catalog.d.ts +29 -0
- package/dist/core/runner-skill-catalog.js +91 -0
- package/dist/core/runner-skill-catalog.js.map +1 -0
- package/dist/core/session-process.d.ts +3 -0
- package/dist/core/session-process.js +10 -0
- package/dist/core/session-process.js.map +1 -1
- package/dist/core/skill-path-scope.d.ts +4 -0
- package/dist/core/skill-path-scope.js +28 -0
- package/dist/core/skill-path-scope.js.map +1 -0
- package/dist/core/skill-probe.d.ts +17 -0
- package/dist/core/skill-probe.js +102 -0
- package/dist/core/skill-probe.js.map +1 -0
- package/dist/delegation/routes.d.ts +9 -9
- package/dist/delegation/transport.d.ts +20 -20
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/server.d.ts +1622 -1622
- package/dist/workflows/run/squawk-tools.js +4 -0
- package/dist/workflows/run/squawk-tools.js.map +1 -1
- package/dist/workflows/run/types.d.ts +2 -0
- package/dist/workflows/run.d.ts +2 -2
- package/dist/workflows/run.js +2 -2
- package/package.json +4 -4
- package/scripts/mock-ci-tool.mjs +5 -0
- package/scripts/mock-claude.mjs +12 -0
- package/scripts/mock-codex-app-server.mjs +4 -0
- package/scripts/mock-omp-rpc.mjs +7 -1
- package/scripts/mock-opencode-serve.mjs +9 -0
- package/scripts/mock-pi-rpc.mjs +5 -0
- package/scripts/mock-skill-list-data.d.mts +1 -0
- package/scripts/mock-skill-list-data.mjs +184 -0
- package/scripts/mock-skill-list.d.mts +1 -0
- package/scripts/mock-skill-list.mjs +8 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AutomationToolRequest, type AutomationToolAnswer } from '../contract/index.js';
|
|
1
2
|
export { ToolsUnavailableError } from './errors.ts';
|
|
2
3
|
import { type ScheduleTaskAnswer, type ScheduleTaskRequest, type ScheduledTasksAnswer, type ScheduledTasksRequest } from '../contract/index.js';
|
|
3
4
|
import { type SquawkAskAnswer, type SquawkAskRequest, type SquawkCancelWaitAnswer, type SquawkCancelWaitRequest, type SquawkDoneAnswer, type SquawkDoneRequest, type SquawkWaitAnswer, type SquawkWaitRequestInput, type Wait, type WaitVia } from '../contract/index.js';
|
|
@@ -34,6 +35,7 @@ export type SquawkToolHandlers = {
|
|
|
34
35
|
stopPreview?: PreviewStop | undefined;
|
|
35
36
|
/** hearsay-tools/cezarion#1465: absent where no cockpit serves the project, answered as `unavailable`. */
|
|
36
37
|
scheduleTask?: (request: ScheduleTaskRequest, signal: AbortSignal) => Promise<ScheduleTaskAnswer>;
|
|
38
|
+
automation?: (request: AutomationToolRequest, signal: AbortSignal) => Promise<AutomationToolAnswer>;
|
|
37
39
|
scheduledTasks?: (request: ScheduledTasksRequest, signal: AbortSignal) => Promise<ScheduledTasksAnswer>;
|
|
38
40
|
};
|
|
39
41
|
type Capability = SquawkToolHandlers & {
|
|
@@ -280,11 +282,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
280
282
|
"/api/v1/tools/ask": {
|
|
281
283
|
$post: {
|
|
282
284
|
output: {
|
|
283
|
-
|
|
285
|
+
ok: false;
|
|
286
|
+
code: 'unavailable';
|
|
284
287
|
message: string;
|
|
285
288
|
};
|
|
286
289
|
outputFormat: "json";
|
|
287
|
-
status:
|
|
290
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
288
291
|
input: {
|
|
289
292
|
json: {
|
|
290
293
|
questions: {
|
|
@@ -302,12 +305,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
302
305
|
};
|
|
303
306
|
} | {
|
|
304
307
|
output: {
|
|
305
|
-
|
|
306
|
-
code: 'unavailable';
|
|
308
|
+
code: 'capability_revoked';
|
|
307
309
|
message: string;
|
|
308
310
|
};
|
|
309
311
|
outputFormat: "json";
|
|
310
|
-
status:
|
|
312
|
+
status: 401;
|
|
311
313
|
input: {
|
|
312
314
|
json: {
|
|
313
315
|
questions: {
|
|
@@ -375,11 +377,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
375
377
|
"/api/v1/tools/cancel-wait": {
|
|
376
378
|
$post: {
|
|
377
379
|
output: {
|
|
378
|
-
|
|
380
|
+
cancelled: false;
|
|
381
|
+
code: 'unavailable';
|
|
379
382
|
message: string;
|
|
380
383
|
};
|
|
381
384
|
outputFormat: "json";
|
|
382
|
-
status:
|
|
385
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
383
386
|
input: {
|
|
384
387
|
json: {
|
|
385
388
|
wait_id: string;
|
|
@@ -387,12 +390,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
387
390
|
};
|
|
388
391
|
} | {
|
|
389
392
|
output: {
|
|
390
|
-
|
|
391
|
-
code: 'unavailable';
|
|
393
|
+
code: 'capability_revoked';
|
|
392
394
|
message: string;
|
|
393
395
|
};
|
|
394
396
|
outputFormat: "json";
|
|
395
|
-
status:
|
|
397
|
+
status: 401;
|
|
396
398
|
input: {
|
|
397
399
|
json: {
|
|
398
400
|
wait_id: string;
|
|
@@ -440,11 +442,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
440
442
|
"/api/v1/tools/done": {
|
|
441
443
|
$post: {
|
|
442
444
|
output: {
|
|
443
|
-
|
|
445
|
+
ok: false;
|
|
446
|
+
code: 'unavailable';
|
|
444
447
|
message: string;
|
|
445
448
|
};
|
|
446
449
|
outputFormat: "json";
|
|
447
|
-
status:
|
|
450
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
448
451
|
input: {
|
|
449
452
|
json: {
|
|
450
453
|
summary?: string | undefined;
|
|
@@ -452,12 +455,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
452
455
|
};
|
|
453
456
|
} | {
|
|
454
457
|
output: {
|
|
455
|
-
|
|
456
|
-
code: 'unavailable';
|
|
458
|
+
code: 'capability_revoked';
|
|
457
459
|
message: string;
|
|
458
460
|
};
|
|
459
461
|
outputFormat: "json";
|
|
460
|
-
status:
|
|
462
|
+
status: 401;
|
|
461
463
|
input: {
|
|
462
464
|
json: {
|
|
463
465
|
summary?: string | undefined;
|
|
@@ -540,11 +542,13 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
540
542
|
"/api/v1/tools/preview-stop": {
|
|
541
543
|
$post: {
|
|
542
544
|
output: {
|
|
543
|
-
|
|
545
|
+
ok: boolean;
|
|
546
|
+
code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
|
|
544
547
|
message: string;
|
|
548
|
+
hint: string;
|
|
545
549
|
};
|
|
546
550
|
outputFormat: "json";
|
|
547
|
-
status:
|
|
551
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
548
552
|
input: {
|
|
549
553
|
json: {
|
|
550
554
|
port: number;
|
|
@@ -553,13 +557,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
553
557
|
};
|
|
554
558
|
} | {
|
|
555
559
|
output: {
|
|
556
|
-
|
|
557
|
-
code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
|
|
560
|
+
code: 'capability_revoked';
|
|
558
561
|
message: string;
|
|
559
|
-
hint: string;
|
|
560
562
|
};
|
|
561
563
|
outputFormat: "json";
|
|
562
|
-
status:
|
|
564
|
+
status: 401;
|
|
563
565
|
input: {
|
|
564
566
|
json: {
|
|
565
567
|
port: number;
|
|
@@ -572,11 +574,13 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
572
574
|
"/api/v1/tools/preview-serve": {
|
|
573
575
|
$post: {
|
|
574
576
|
output: {
|
|
575
|
-
|
|
577
|
+
ok: boolean;
|
|
578
|
+
code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
|
|
576
579
|
message: string;
|
|
580
|
+
hint: string;
|
|
577
581
|
};
|
|
578
582
|
outputFormat: "json";
|
|
579
|
-
status:
|
|
583
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
580
584
|
input: {
|
|
581
585
|
json: {
|
|
582
586
|
command: string;
|
|
@@ -588,13 +592,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
588
592
|
};
|
|
589
593
|
} | {
|
|
590
594
|
output: {
|
|
591
|
-
|
|
592
|
-
code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
|
|
595
|
+
code: 'capability_revoked';
|
|
593
596
|
message: string;
|
|
594
|
-
hint: string;
|
|
595
597
|
};
|
|
596
598
|
outputFormat: "json";
|
|
597
|
-
status:
|
|
599
|
+
status: 401;
|
|
598
600
|
input: {
|
|
599
601
|
json: {
|
|
600
602
|
command: string;
|
|
@@ -607,14 +609,360 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
607
609
|
};
|
|
608
610
|
};
|
|
609
611
|
} & {
|
|
610
|
-
"/api/v1/tools/
|
|
612
|
+
"/api/v1/tools/automation": {
|
|
611
613
|
$post: {
|
|
614
|
+
output: {
|
|
615
|
+
ok: false;
|
|
616
|
+
code: import('../contract/index.js').ScheduledTaskRefusalCode;
|
|
617
|
+
message: string;
|
|
618
|
+
};
|
|
619
|
+
outputFormat: "json";
|
|
620
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
621
|
+
input: {
|
|
622
|
+
json: {
|
|
623
|
+
action: "create";
|
|
624
|
+
definition: {
|
|
625
|
+
name: string;
|
|
626
|
+
description?: string | undefined;
|
|
627
|
+
kind?: "github" | "schedule" | undefined;
|
|
628
|
+
events?: ("issue.labeled" | "issue.opened" | "issue.unlabeled" | "pull_request.opened")[] | undefined;
|
|
629
|
+
intervalSeconds?: number | undefined;
|
|
630
|
+
filters?: {
|
|
631
|
+
[x: string]: unknown;
|
|
632
|
+
includeExisting?: boolean | undefined;
|
|
633
|
+
requireCurrentLabels?: boolean | undefined;
|
|
634
|
+
authors?: string[] | undefined;
|
|
635
|
+
assignees?: string[] | undefined;
|
|
636
|
+
allLabels?: string[] | undefined;
|
|
637
|
+
anyLabels?: string[] | undefined;
|
|
638
|
+
excludeLabels?: string[] | undefined;
|
|
639
|
+
changedLabels?: string[] | undefined;
|
|
640
|
+
lookbackDays?: number | undefined;
|
|
641
|
+
maxRecords?: number | undefined;
|
|
642
|
+
} | undefined;
|
|
643
|
+
schedule?: {
|
|
644
|
+
type: "daily" | "hours" | "once" | "weekdays" | "weekly";
|
|
645
|
+
hour?: number | undefined;
|
|
646
|
+
minute?: number | undefined;
|
|
647
|
+
day?: number | undefined;
|
|
648
|
+
every?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | undefined;
|
|
649
|
+
at?: string | undefined;
|
|
650
|
+
timeZone?: string | undefined;
|
|
651
|
+
latestStartMinutes?: number | undefined;
|
|
652
|
+
} | undefined;
|
|
653
|
+
task: {
|
|
654
|
+
archiveWhenDone?: boolean | undefined;
|
|
655
|
+
autoMergePr?: boolean | undefined;
|
|
656
|
+
allowWorkers?: boolean | undefined;
|
|
657
|
+
allowMessaging?: boolean | undefined;
|
|
658
|
+
prompt: string;
|
|
659
|
+
workflow?: string | undefined;
|
|
660
|
+
steps?: {
|
|
661
|
+
id: string;
|
|
662
|
+
name?: string | undefined;
|
|
663
|
+
prompt?: string | undefined;
|
|
664
|
+
skill?: string | undefined;
|
|
665
|
+
model?: string | undefined;
|
|
666
|
+
effort?: string | undefined;
|
|
667
|
+
timeoutMs?: number | undefined;
|
|
668
|
+
runner?: "claude" | "codex" | "omp" | "opencode" | "pi" | undefined;
|
|
669
|
+
agentProfile?: string | undefined;
|
|
670
|
+
allowedTools?: string[] | undefined;
|
|
671
|
+
bashAllowlist?: string[] | undefined;
|
|
672
|
+
command?: string | undefined;
|
|
673
|
+
onFail?: {
|
|
674
|
+
retry: string;
|
|
675
|
+
max?: number | undefined;
|
|
676
|
+
} | undefined;
|
|
677
|
+
}[] | undefined;
|
|
678
|
+
runner?: "claude" | "codex" | "omp" | "opencode" | "pi" | undefined;
|
|
679
|
+
model?: string | undefined;
|
|
680
|
+
effort?: string | undefined;
|
|
681
|
+
worktree?: boolean | undefined;
|
|
682
|
+
autonomous?: boolean | undefined;
|
|
683
|
+
systemPrompt?: string | undefined;
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
} | {
|
|
687
|
+
action: "show";
|
|
688
|
+
id: string;
|
|
689
|
+
} | {
|
|
690
|
+
action: "preview";
|
|
691
|
+
id: string;
|
|
692
|
+
} | {
|
|
693
|
+
action: "enable";
|
|
694
|
+
id: string;
|
|
695
|
+
explicit?: boolean | undefined;
|
|
696
|
+
};
|
|
697
|
+
};
|
|
698
|
+
} | {
|
|
612
699
|
output: {
|
|
613
700
|
code: 'capability_revoked';
|
|
614
701
|
message: string;
|
|
615
702
|
};
|
|
616
703
|
outputFormat: "json";
|
|
617
704
|
status: 401;
|
|
705
|
+
input: {
|
|
706
|
+
json: {
|
|
707
|
+
action: "create";
|
|
708
|
+
definition: {
|
|
709
|
+
name: string;
|
|
710
|
+
description?: string | undefined;
|
|
711
|
+
kind?: "github" | "schedule" | undefined;
|
|
712
|
+
events?: ("issue.labeled" | "issue.opened" | "issue.unlabeled" | "pull_request.opened")[] | undefined;
|
|
713
|
+
intervalSeconds?: number | undefined;
|
|
714
|
+
filters?: {
|
|
715
|
+
[x: string]: unknown;
|
|
716
|
+
includeExisting?: boolean | undefined;
|
|
717
|
+
requireCurrentLabels?: boolean | undefined;
|
|
718
|
+
authors?: string[] | undefined;
|
|
719
|
+
assignees?: string[] | undefined;
|
|
720
|
+
allLabels?: string[] | undefined;
|
|
721
|
+
anyLabels?: string[] | undefined;
|
|
722
|
+
excludeLabels?: string[] | undefined;
|
|
723
|
+
changedLabels?: string[] | undefined;
|
|
724
|
+
lookbackDays?: number | undefined;
|
|
725
|
+
maxRecords?: number | undefined;
|
|
726
|
+
} | undefined;
|
|
727
|
+
schedule?: {
|
|
728
|
+
type: "daily" | "hours" | "once" | "weekdays" | "weekly";
|
|
729
|
+
hour?: number | undefined;
|
|
730
|
+
minute?: number | undefined;
|
|
731
|
+
day?: number | undefined;
|
|
732
|
+
every?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | undefined;
|
|
733
|
+
at?: string | undefined;
|
|
734
|
+
timeZone?: string | undefined;
|
|
735
|
+
latestStartMinutes?: number | undefined;
|
|
736
|
+
} | undefined;
|
|
737
|
+
task: {
|
|
738
|
+
archiveWhenDone?: boolean | undefined;
|
|
739
|
+
autoMergePr?: boolean | undefined;
|
|
740
|
+
allowWorkers?: boolean | undefined;
|
|
741
|
+
allowMessaging?: boolean | undefined;
|
|
742
|
+
prompt: string;
|
|
743
|
+
workflow?: string | undefined;
|
|
744
|
+
steps?: {
|
|
745
|
+
id: string;
|
|
746
|
+
name?: string | undefined;
|
|
747
|
+
prompt?: string | undefined;
|
|
748
|
+
skill?: string | undefined;
|
|
749
|
+
model?: string | undefined;
|
|
750
|
+
effort?: string | undefined;
|
|
751
|
+
timeoutMs?: number | undefined;
|
|
752
|
+
runner?: "claude" | "codex" | "omp" | "opencode" | "pi" | undefined;
|
|
753
|
+
agentProfile?: string | undefined;
|
|
754
|
+
allowedTools?: string[] | undefined;
|
|
755
|
+
bashAllowlist?: string[] | undefined;
|
|
756
|
+
command?: string | undefined;
|
|
757
|
+
onFail?: {
|
|
758
|
+
retry: string;
|
|
759
|
+
max?: number | undefined;
|
|
760
|
+
} | undefined;
|
|
761
|
+
}[] | undefined;
|
|
762
|
+
runner?: "claude" | "codex" | "omp" | "opencode" | "pi" | undefined;
|
|
763
|
+
model?: string | undefined;
|
|
764
|
+
effort?: string | undefined;
|
|
765
|
+
worktree?: boolean | undefined;
|
|
766
|
+
autonomous?: boolean | undefined;
|
|
767
|
+
systemPrompt?: string | undefined;
|
|
768
|
+
};
|
|
769
|
+
};
|
|
770
|
+
} | {
|
|
771
|
+
action: "show";
|
|
772
|
+
id: string;
|
|
773
|
+
} | {
|
|
774
|
+
action: "preview";
|
|
775
|
+
id: string;
|
|
776
|
+
} | {
|
|
777
|
+
action: "enable";
|
|
778
|
+
id: string;
|
|
779
|
+
explicit?: boolean | undefined;
|
|
780
|
+
};
|
|
781
|
+
};
|
|
782
|
+
} | {
|
|
783
|
+
output: {
|
|
784
|
+
ok: true;
|
|
785
|
+
automation: {
|
|
786
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
787
|
+
id: string;
|
|
788
|
+
revision: number;
|
|
789
|
+
name: string;
|
|
790
|
+
description?: string | undefined;
|
|
791
|
+
enabled: boolean;
|
|
792
|
+
kind: "github" | "schedule";
|
|
793
|
+
events?: ("issue.labeled" | "issue.opened" | "issue.unlabeled" | "pull_request.opened")[] | undefined;
|
|
794
|
+
intervalSeconds?: number | undefined;
|
|
795
|
+
filters?: {
|
|
796
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
797
|
+
includeExisting?: boolean | undefined;
|
|
798
|
+
requireCurrentLabels?: boolean | undefined;
|
|
799
|
+
authors?: string[] | undefined;
|
|
800
|
+
assignees?: string[] | undefined;
|
|
801
|
+
allLabels?: string[] | undefined;
|
|
802
|
+
anyLabels?: string[] | undefined;
|
|
803
|
+
excludeLabels?: string[] | undefined;
|
|
804
|
+
changedLabels?: string[] | undefined;
|
|
805
|
+
lookbackDays: number;
|
|
806
|
+
maxRecords: number;
|
|
807
|
+
} | undefined;
|
|
808
|
+
schedule?: {
|
|
809
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
810
|
+
type: "daily" | "hours" | "once" | "weekdays" | "weekly";
|
|
811
|
+
hour?: number | undefined;
|
|
812
|
+
minute?: number | undefined;
|
|
813
|
+
day?: number | undefined;
|
|
814
|
+
every?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | undefined;
|
|
815
|
+
at?: string | undefined;
|
|
816
|
+
timeZone?: string | undefined;
|
|
817
|
+
latestStartMinutes?: number | undefined;
|
|
818
|
+
} | undefined;
|
|
819
|
+
task: {
|
|
820
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
821
|
+
archiveWhenDone?: boolean | undefined;
|
|
822
|
+
autoMergePr?: boolean | undefined;
|
|
823
|
+
allowWorkers?: boolean | undefined;
|
|
824
|
+
allowMessaging?: boolean | undefined;
|
|
825
|
+
prompt: string;
|
|
826
|
+
workflow?: string | undefined;
|
|
827
|
+
steps?: {
|
|
828
|
+
id: string;
|
|
829
|
+
name?: string | undefined;
|
|
830
|
+
prompt?: string | undefined;
|
|
831
|
+
skill?: string | undefined;
|
|
832
|
+
model?: string | undefined;
|
|
833
|
+
effort?: string | undefined;
|
|
834
|
+
timeoutMs?: number | undefined;
|
|
835
|
+
runner?: "claude" | "codex" | "omp" | "opencode" | "pi" | undefined;
|
|
836
|
+
agentProfile?: string | undefined;
|
|
837
|
+
allowedTools?: string[] | undefined;
|
|
838
|
+
bashAllowlist?: string[] | undefined;
|
|
839
|
+
command?: string | undefined;
|
|
840
|
+
onFail?: {
|
|
841
|
+
retry: string;
|
|
842
|
+
max: number;
|
|
843
|
+
} | undefined;
|
|
844
|
+
}[] | undefined;
|
|
845
|
+
runner?: "claude" | "codex" | "omp" | "opencode" | "pi" | undefined;
|
|
846
|
+
model?: string | undefined;
|
|
847
|
+
effort?: string | undefined;
|
|
848
|
+
variants?: 1 | 2 | 3 | undefined;
|
|
849
|
+
worktree?: boolean | undefined;
|
|
850
|
+
autonomous?: boolean | undefined;
|
|
851
|
+
systemPrompt?: string | undefined;
|
|
852
|
+
};
|
|
853
|
+
archived?: {
|
|
854
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
855
|
+
at: string;
|
|
856
|
+
outcome: "cancelled" | "launched";
|
|
857
|
+
runId?: string | undefined;
|
|
858
|
+
receiptId?: string | undefined;
|
|
859
|
+
trigger?: "late" | "manual" | "retry" | "schedule" | undefined;
|
|
860
|
+
} | undefined;
|
|
861
|
+
createdAt: string;
|
|
862
|
+
updatedAt: string;
|
|
863
|
+
};
|
|
864
|
+
url?: string | undefined;
|
|
865
|
+
next_run_at?: string | undefined;
|
|
866
|
+
preview?: {
|
|
867
|
+
matches: number;
|
|
868
|
+
truncated: boolean;
|
|
869
|
+
} | undefined;
|
|
870
|
+
} | {
|
|
871
|
+
ok: false;
|
|
872
|
+
code: "automations_off" | "conflict" | "explicit_required" | "invalid_request" | "not_found" | "preview_required" | "unavailable";
|
|
873
|
+
message: string;
|
|
874
|
+
};
|
|
875
|
+
outputFormat: "json";
|
|
876
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
877
|
+
input: {
|
|
878
|
+
json: {
|
|
879
|
+
action: "create";
|
|
880
|
+
definition: {
|
|
881
|
+
name: string;
|
|
882
|
+
description?: string | undefined;
|
|
883
|
+
kind?: "github" | "schedule" | undefined;
|
|
884
|
+
events?: ("issue.labeled" | "issue.opened" | "issue.unlabeled" | "pull_request.opened")[] | undefined;
|
|
885
|
+
intervalSeconds?: number | undefined;
|
|
886
|
+
filters?: {
|
|
887
|
+
[x: string]: unknown;
|
|
888
|
+
includeExisting?: boolean | undefined;
|
|
889
|
+
requireCurrentLabels?: boolean | undefined;
|
|
890
|
+
authors?: string[] | undefined;
|
|
891
|
+
assignees?: string[] | undefined;
|
|
892
|
+
allLabels?: string[] | undefined;
|
|
893
|
+
anyLabels?: string[] | undefined;
|
|
894
|
+
excludeLabels?: string[] | undefined;
|
|
895
|
+
changedLabels?: string[] | undefined;
|
|
896
|
+
lookbackDays?: number | undefined;
|
|
897
|
+
maxRecords?: number | undefined;
|
|
898
|
+
} | undefined;
|
|
899
|
+
schedule?: {
|
|
900
|
+
type: "daily" | "hours" | "once" | "weekdays" | "weekly";
|
|
901
|
+
hour?: number | undefined;
|
|
902
|
+
minute?: number | undefined;
|
|
903
|
+
day?: number | undefined;
|
|
904
|
+
every?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | undefined;
|
|
905
|
+
at?: string | undefined;
|
|
906
|
+
timeZone?: string | undefined;
|
|
907
|
+
latestStartMinutes?: number | undefined;
|
|
908
|
+
} | undefined;
|
|
909
|
+
task: {
|
|
910
|
+
archiveWhenDone?: boolean | undefined;
|
|
911
|
+
autoMergePr?: boolean | undefined;
|
|
912
|
+
allowWorkers?: boolean | undefined;
|
|
913
|
+
allowMessaging?: boolean | undefined;
|
|
914
|
+
prompt: string;
|
|
915
|
+
workflow?: string | undefined;
|
|
916
|
+
steps?: {
|
|
917
|
+
id: string;
|
|
918
|
+
name?: string | undefined;
|
|
919
|
+
prompt?: string | undefined;
|
|
920
|
+
skill?: string | undefined;
|
|
921
|
+
model?: string | undefined;
|
|
922
|
+
effort?: string | undefined;
|
|
923
|
+
timeoutMs?: number | undefined;
|
|
924
|
+
runner?: "claude" | "codex" | "omp" | "opencode" | "pi" | undefined;
|
|
925
|
+
agentProfile?: string | undefined;
|
|
926
|
+
allowedTools?: string[] | undefined;
|
|
927
|
+
bashAllowlist?: string[] | undefined;
|
|
928
|
+
command?: string | undefined;
|
|
929
|
+
onFail?: {
|
|
930
|
+
retry: string;
|
|
931
|
+
max?: number | undefined;
|
|
932
|
+
} | undefined;
|
|
933
|
+
}[] | undefined;
|
|
934
|
+
runner?: "claude" | "codex" | "omp" | "opencode" | "pi" | undefined;
|
|
935
|
+
model?: string | undefined;
|
|
936
|
+
effort?: string | undefined;
|
|
937
|
+
worktree?: boolean | undefined;
|
|
938
|
+
autonomous?: boolean | undefined;
|
|
939
|
+
systemPrompt?: string | undefined;
|
|
940
|
+
};
|
|
941
|
+
};
|
|
942
|
+
} | {
|
|
943
|
+
action: "show";
|
|
944
|
+
id: string;
|
|
945
|
+
} | {
|
|
946
|
+
action: "preview";
|
|
947
|
+
id: string;
|
|
948
|
+
} | {
|
|
949
|
+
action: "enable";
|
|
950
|
+
id: string;
|
|
951
|
+
explicit?: boolean | undefined;
|
|
952
|
+
};
|
|
953
|
+
};
|
|
954
|
+
};
|
|
955
|
+
};
|
|
956
|
+
} & {
|
|
957
|
+
"/api/v1/tools/schedule-task": {
|
|
958
|
+
$post: {
|
|
959
|
+
output: {
|
|
960
|
+
ok: false;
|
|
961
|
+
code: import('../contract/index.js').ScheduledTaskRefusalCode;
|
|
962
|
+
message: string;
|
|
963
|
+
};
|
|
964
|
+
outputFormat: "json";
|
|
965
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
618
966
|
input: {
|
|
619
967
|
json: {
|
|
620
968
|
at?: string | undefined;
|
|
@@ -631,12 +979,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
631
979
|
};
|
|
632
980
|
} | {
|
|
633
981
|
output: {
|
|
634
|
-
|
|
635
|
-
code: import('../contract/index.js').ScheduledTaskRefusalCode;
|
|
982
|
+
code: 'capability_revoked';
|
|
636
983
|
message: string;
|
|
637
984
|
};
|
|
638
985
|
outputFormat: "json";
|
|
639
|
-
status:
|
|
986
|
+
status: 401;
|
|
640
987
|
input: {
|
|
641
988
|
json: {
|
|
642
989
|
at?: string | undefined;
|
|
@@ -653,10 +1000,6 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
653
1000
|
};
|
|
654
1001
|
} | {
|
|
655
1002
|
output: {
|
|
656
|
-
ok: false;
|
|
657
|
-
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
658
|
-
message: string;
|
|
659
|
-
} | {
|
|
660
1003
|
ok: true;
|
|
661
1004
|
task: {
|
|
662
1005
|
id: string;
|
|
@@ -668,6 +1011,10 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
668
1011
|
url?: string | undefined;
|
|
669
1012
|
};
|
|
670
1013
|
note: string;
|
|
1014
|
+
} | {
|
|
1015
|
+
ok: false;
|
|
1016
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
1017
|
+
message: string;
|
|
671
1018
|
};
|
|
672
1019
|
outputFormat: "json";
|
|
673
1020
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -691,11 +1038,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
691
1038
|
"/api/v1/tools/scheduled-tasks": {
|
|
692
1039
|
$post: {
|
|
693
1040
|
output: {
|
|
694
|
-
|
|
1041
|
+
ok: false;
|
|
1042
|
+
code: import('../contract/index.js').ScheduledTaskRefusalCode;
|
|
695
1043
|
message: string;
|
|
696
1044
|
};
|
|
697
1045
|
outputFormat: "json";
|
|
698
|
-
status:
|
|
1046
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
699
1047
|
input: {
|
|
700
1048
|
json: {
|
|
701
1049
|
at?: string | undefined;
|
|
@@ -728,12 +1076,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
728
1076
|
};
|
|
729
1077
|
} | {
|
|
730
1078
|
output: {
|
|
731
|
-
|
|
732
|
-
code: import('../contract/index.js').ScheduledTaskRefusalCode;
|
|
1079
|
+
code: 'capability_revoked';
|
|
733
1080
|
message: string;
|
|
734
1081
|
};
|
|
735
1082
|
outputFormat: "json";
|
|
736
|
-
status:
|
|
1083
|
+
status: 401;
|
|
737
1084
|
input: {
|
|
738
1085
|
json: {
|
|
739
1086
|
at?: string | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { automationToolRequestSchema, automationToolAnswerSchema } from '../contract/index.js';
|
|
1
2
|
import { productEnvEntries } from '../core/product-env.js';
|
|
2
3
|
import { randomBytes, randomUUID } from 'node:crypto';
|
|
3
4
|
import { chmod, mkdtemp, rm } from 'node:fs/promises';
|
|
@@ -261,6 +262,18 @@ export function ciToolRoutes(capabilities) {
|
|
|
261
262
|
catch {
|
|
262
263
|
return capabilityRevoked(c, capability, () => c.json(previewRefusal('unavailable')));
|
|
263
264
|
}
|
|
265
|
+
})
|
|
266
|
+
.use('/api/v1/tools/automation', requireCapability)
|
|
267
|
+
.post('/api/v1/tools/automation', bodyLimit({ maxSize: SCHEDULED_TASK_LIMITS.wireBytes, onError: c => c.json(scheduleRefusal('invalid_request', 'The arguments exceed 1 MiB.')) }), async (c, next) => {
|
|
268
|
+
if (!automationsToolEnabled())
|
|
269
|
+
return c.json(scheduleRefusal('automations_off'));
|
|
270
|
+
await next();
|
|
271
|
+
}, jsonZodValidator(automationToolRequestSchema, { invalid: (c, error) => c.json(scheduleRefusal('invalid_request', scheduleInvalidInput(error))) }), async (c) => {
|
|
272
|
+
const capability = c.get('capability');
|
|
273
|
+
const automation = capability.automation;
|
|
274
|
+
if (!automation)
|
|
275
|
+
return c.json(scheduleRefusal('unavailable'));
|
|
276
|
+
return capabilityAnswer(c, capability, async () => automationToolAnswerSchema.parse(await automation.call(capability, c.req.valid('json'), capability.lifetime.signal)), answer => c.json(answer), () => c.json(scheduleRefusal('unavailable')));
|
|
264
277
|
})
|
|
265
278
|
.use('/api/v1/tools/schedule-task', requireCapability)
|
|
266
279
|
// A prompt takes up to 100 000 characters, so these bodies get their own limit. The flag gate
|