@hearsay-tools/squawk 0.18.0-dev.7101 → 0.18.0-dev.7113

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.
Files changed (120) hide show
  1. package/README.md +11 -11
  2. package/dist/agent-config/seed.js +1 -1
  3. package/dist/agent-config/seed.js.map +1 -1
  4. package/dist/automations/prompts.d.ts +0 -3
  5. package/dist/automations/prompts.js +0 -46
  6. package/dist/automations/prompts.js.map +1 -1
  7. package/dist/ci-wait/tools.d.ts +4 -4
  8. package/dist/cli-dispatch.js +0 -1
  9. package/dist/cli-dispatch.js.map +1 -1
  10. package/dist/config.d.ts +2 -26
  11. package/dist/config.js +6 -50
  12. package/dist/config.js.map +1 -1
  13. package/dist/contract/index.d.ts +0 -1
  14. package/dist/contract/index.js +2364 -2437
  15. package/dist/contract/skills.d.ts +1 -33
  16. package/dist/contract/ui-state-requests.d.ts +0 -4
  17. package/dist/contract/workspace.d.ts +0 -4
  18. package/dist/delegation/routes.d.ts +4 -4
  19. package/dist/delegation/service.d.ts +1 -1
  20. package/dist/delegation/transport.d.ts +12 -12
  21. package/dist/project-commands.d.ts +1 -1
  22. package/dist/project-commands.js +2 -18
  23. package/dist/project-commands.js.map +1 -1
  24. package/dist/server/server.d.ts +270 -742
  25. package/dist/server/server.js +0 -2
  26. package/dist/server/server.js.map +1 -1
  27. package/dist/skills.d.ts +0 -69
  28. package/dist/skills.js +0 -202
  29. package/dist/skills.js.map +1 -1
  30. package/dist/ui-state.d.ts +1 -1
  31. package/dist/ui-state.js +1 -1
  32. package/dist/workflows/run/compose.d.ts +0 -2
  33. package/dist/workflows/run/compose.js.map +1 -1
  34. package/dist/workflows/run/continuation-session.js +2 -0
  35. package/dist/workflows/run/continuation-session.js.map +1 -1
  36. package/dist/workflows/run/launch-context.d.ts +1 -4
  37. package/dist/workflows/run/launch-context.js +1 -5
  38. package/dist/workflows/run/launch-context.js.map +1 -1
  39. package/dist/workflows/run/prompts.d.ts +0 -42
  40. package/dist/workflows/run/prompts.js +0 -80
  41. package/dist/workflows/run/prompts.js.map +1 -1
  42. package/dist/workflows/run/step-session.js +2 -0
  43. package/dist/workflows/run/step-session.js.map +1 -1
  44. package/dist/workflows/run.d.ts +1 -3
  45. package/dist/workflows/run.js +1 -3
  46. package/dist/workflows/run.js.map +1 -1
  47. package/dist/worktree-manifest.js +1 -1
  48. package/dist/worktree-manifest.js.map +1 -1
  49. package/dist/worktree-paths.d.ts +3 -0
  50. package/dist/worktree-paths.js +52 -0
  51. package/dist/worktree-paths.js.map +1 -0
  52. package/dist/worktree-skill-cleanup.d.ts +11 -0
  53. package/dist/worktree-skill-cleanup.js +53 -0
  54. package/dist/worktree-skill-cleanup.js.map +1 -0
  55. package/package.json +4 -4
  56. package/web/dist/assets/{activity-motion-YVMdTv1H.js → activity-motion-CRjdIuq0.js} +2 -2
  57. package/web/dist/assets/{activity-route-Bd9LuD0o.js → activity-route-4yon6jwC.js} +1 -1
  58. package/web/dist/assets/{agent-accounts-DetCQbKD.js → agent-accounts-l_Gn-Dja.js} +1 -1
  59. package/web/dist/assets/attention-DcMKBngT.js +1 -0
  60. package/web/dist/assets/{cez-idle-CnPEf2T2.js → cez-idle-BEO5j8ow.js} +1 -1
  61. package/web/dist/assets/{commit-diff-panel-BY9ItExV.js → commit-diff-panel-Cfnt30Tt.js} +1 -1
  62. package/web/dist/assets/{diff-nSqnAkNf.js → diff-Dx1bGt0w.js} +2 -2
  63. package/web/dist/assets/{diff-view-Bp_dyecW.js → diff-view-DJ4iFfkd.js} +1 -1
  64. package/web/dist/assets/{file-preview-Dkl6S-Ej.js → file-preview-6POBIfS-.js} +1 -1
  65. package/web/dist/assets/{git-toolbar-xd4qbEj6.js → git-toolbar-DwK9tJOu.js} +1 -1
  66. package/web/dist/assets/github-shozEZ-Z.js +1 -0
  67. package/web/dist/assets/{global-activity-route-BMBowNcw.js → global-activity-route-D_JqpAAR.js} +1 -1
  68. package/web/dist/assets/index-DMq98FV0.js +14 -0
  69. package/web/dist/assets/{live-protocol-C_Z-JQOy.js → live-protocol-Bn-xWBmZ.js} +1 -1
  70. package/web/dist/assets/{markdown-CZVLEjwk.js → markdown-fN_tqxh3.js} +1 -1
  71. package/web/dist/assets/picker-pill-BuYiT3fS.js +15 -0
  72. package/web/dist/assets/preview-pane-connected-D81HxFOI.js +3 -0
  73. package/web/dist/assets/{project-router-D5aSJsZ7.js → project-router-C68VktrY.js} +1 -1
  74. package/web/dist/assets/{project-scope-context-BUXmC8my.js → project-scope-context-Vv8ygMl6.js} +1 -1
  75. package/web/dist/assets/{prompt-template-menu-De-8v5io.js → prompt-template-menu-hXOsL4ia.js} +1 -1
  76. package/web/dist/assets/{queries-DkipLnOL.js → queries-Drt3XAiW.js} +1 -1
  77. package/web/dist/assets/{reference-chip-BVB5YsfP.js → reference-chip-oVw9Lal9.js} +1 -1
  78. package/web/dist/assets/{repo-git-BdRmck7y.js → repo-git-B295X5Wv.js} +1 -1
  79. package/web/dist/assets/{report-reader-C8_2WEz6.js → report-reader-HocN04sH.js} +1 -1
  80. package/web/dist/assets/{reports-DxAL6BCk.js → reports-B1KiT5at.js} +1 -1
  81. package/web/dist/assets/run-header-DyKGLM8b.js +2 -0
  82. package/web/dist/assets/{skills-C49LGb-4.js → skills-BRDqkbTt.js} +1 -1
  83. package/web/dist/assets/{tab-link-BTFjRC1e.js → tab-link-B4u5eY7O.js} +1 -1
  84. package/web/dist/assets/{task-changes-B0oxkbcW.js → task-changes-Bx8mrihw.js} +1 -1
  85. package/web/dist/assets/{task-commits-DDZcksfZ.js → task-commits-bARHGfsG.js} +1 -1
  86. package/web/dist/assets/{task-files-BTj0Ehlx.js → task-files-_SX670LL.js} +1 -1
  87. package/web/dist/assets/{task-github-item-y1rABsg2.js → task-github-item-Cw8-5BXV.js} +1 -1
  88. package/web/dist/assets/{task-thread-CaRlk42s.js → task-thread-BAeGEFEe.js} +7 -7
  89. package/web/dist/assets/{thread-state-BE9onTdO.js → thread-state-BpW3fVNR.js} +1 -1
  90. package/web/dist/assets/{use-desktop-DWhNBxlY.js → use-desktop-CuYLi0j4.js} +1 -1
  91. package/web/dist/assets/use-hand-to-agent-state-DU4XEkhv.js +1 -0
  92. package/web/dist/assets/{useInfiniteQuery-0WCd35C5.js → useInfiniteQuery-LV3jJNT5.js} +1 -1
  93. package/web/dist/assets/useQuery-DdfGRa2n.js +1 -0
  94. package/web/dist/assets/workflows-B_b47Jog.js +7 -0
  95. package/web/dist/assets/{ws-DJraxHk2.js → ws-DfYRWmd-.js} +1 -1
  96. package/web/dist/index.html +15 -15
  97. package/web/dist/live-worker.js +1 -1
  98. package/dist/automations/builtin-skill.d.ts +0 -7
  99. package/dist/automations/builtin-skill.js +0 -14
  100. package/dist/automations/builtin-skill.js.map +0 -1
  101. package/dist/contract/skill-sources.d.ts +0 -125
  102. package/dist/contract/team-skill-ref.d.ts +0 -10
  103. package/dist/server/skill-sources.d.ts +0 -264
  104. package/dist/server/skill-sources.js +0 -130
  105. package/dist/server/skill-sources.js.map +0 -1
  106. package/dist/skills-provision.d.ts +0 -64
  107. package/dist/skills-provision.js +0 -325
  108. package/dist/skills-provision.js.map +0 -1
  109. package/dist/skills-remote.d.ts +0 -144
  110. package/dist/skills-remote.js +0 -844
  111. package/dist/skills-remote.js.map +0 -1
  112. package/web/dist/assets/attention-Bs96zuwc.js +0 -1
  113. package/web/dist/assets/github-DRMN6FYi.js +0 -1
  114. package/web/dist/assets/index-QM9AFNSj.js +0 -14
  115. package/web/dist/assets/picker-pill-DKbLlGPr.js +0 -18
  116. package/web/dist/assets/preview-pane-connected-DCz8ZSjW.js +0 -3
  117. package/web/dist/assets/run-header-Dhh86q4A.js +0 -2
  118. package/web/dist/assets/use-hand-to-agent-state-D_Yp8YT9.js +0 -1
  119. package/web/dist/assets/useQuery-BifRjEjr.js +0 -1
  120. package/web/dist/assets/workflows-BN66M7yw.js +0 -7
@@ -1,125 +0,0 @@
1
- import { z } from 'zod';
2
- /** The source shapes Squawk accepts, as the cockpit and every refusal name them. */
3
- export declare const SKILLS_REPO_FORMATS = "owner/name, an https, ssh or git URL, git@host:path, or a local or file:// path";
4
- /**
5
- * The kind of a `skillsRepos` `repo` value, or null when Squawk refuses it. One rule for the
6
- * request schema, the cockpit's Add form and the server's git remote (`safeRemoteFor`).
7
- *
8
- * Refused: an empty value, a leading `-` (git would read an option), `::` (remote-helper
9
- * transports run commands) and URL schemes outside https, http, ssh, git and file. Local paths
10
- * are matched before the `owner/name` shorthand, because `./rel` fits the shorthand charset.
11
- */
12
- export declare function skillsRepoKind(repo: string): 'home' | 'local' | 'github' | 'url' | 'scp' | null;
13
- /**
14
- * A ref safe to pass to `git` as a positional revision (hearsay-tools/cezarion#428): a branch, tag or commit SHA. It
15
- * refuses a leading `-`, `..` and anything outside the git ref-name charset.
16
- */
17
- export declare function isSafeSkillsRef(ref: string): boolean;
18
- /**
19
- * One configured source by its identity, exactly as `skillsRepos` spells it. Two refs of one repo
20
- * are two sources. Not shape-checked: a source in a refused format must still be removable.
21
- */
22
- export declare const teamSkillSourceRefSchema: z.ZodObject<{
23
- repo: z.ZodString;
24
- ref: z.ZodString;
25
- }, z.core.$strict>;
26
- export type TeamSkillSourceRef = z.infer<typeof teamSkillSourceRefSchema>;
27
- /** `POST /skills/sources`: the ref defaults to `main`, as in `skillsRepos`. */
28
- export declare const addTeamSkillSourceSchema: z.ZodObject<{
29
- repo: z.ZodString;
30
- ref: z.ZodOptional<z.ZodString>;
31
- }, z.core.$strict>;
32
- export type AddTeamSkillSource = z.infer<typeof addTeamSkillSourceSchema>;
33
- /** `PATCH /skills/sources`. */
34
- export declare const setTeamSkillSourceEnabledSchema: z.ZodObject<{
35
- repo: z.ZodString;
36
- ref: z.ZodString;
37
- enabled: z.ZodBoolean;
38
- }, z.core.$strict>;
39
- export type SetTeamSkillSourceEnabled = z.infer<typeof setTeamSkillSourceEnabledSchema>;
40
- /** Why a source has no fresh skill list. */
41
- export declare const TEAM_SOURCE_FAILURE_CAUSES: readonly ['refused-format', 'fetch-failed', 'ref-not-found'];
42
- export declare const teamSourceFailureCauseSchema: z.ZodEnum<{
43
- "fetch-failed": "fetch-failed";
44
- "ref-not-found": "ref-not-found";
45
- "refused-format": "refused-format";
46
- }>;
47
- export type TeamSourceFailureCause = z.infer<typeof teamSourceFailureCauseSchema>;
48
- /**
49
- * One source's state. `idle` is a disabled source, or one no load has reached yet. A failed
50
- * source keeps the skills an older clone still lists, so `skillCount` can be above 0.
51
- */
52
- export declare const teamSourceStatusSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
53
- state: z.ZodLiteral<"idle">;
54
- }, z.core.$strip>, z.ZodObject<{
55
- state: z.ZodLiteral<"loading">;
56
- }, z.core.$strip>, z.ZodObject<{
57
- state: z.ZodLiteral<"ok">;
58
- skillCount: z.ZodNumber;
59
- }, z.core.$strip>, z.ZodObject<{
60
- state: z.ZodLiteral<"error">;
61
- cause: z.ZodEnum<{
62
- "fetch-failed": "fetch-failed";
63
- "ref-not-found": "ref-not-found";
64
- "refused-format": "refused-format";
65
- }>;
66
- detail: z.ZodString;
67
- skillCount: z.ZodNumber;
68
- }, z.core.$strip>], "state">;
69
- export type TeamSourceStatus = z.infer<typeof teamSourceStatusSchema>;
70
- /** A `skillsRepos` entry as the Skills page shows it. `repo` is kept exactly as configured. */
71
- export declare const teamSkillSourceSchema: z.ZodObject<{
72
- repo: z.ZodString;
73
- ref: z.ZodString;
74
- enabled: z.ZodBoolean;
75
- status: z.ZodDiscriminatedUnion<[z.ZodObject<{
76
- state: z.ZodLiteral<"idle">;
77
- }, z.core.$strip>, z.ZodObject<{
78
- state: z.ZodLiteral<"loading">;
79
- }, z.core.$strip>, z.ZodObject<{
80
- state: z.ZodLiteral<"ok">;
81
- skillCount: z.ZodNumber;
82
- }, z.core.$strip>, z.ZodObject<{
83
- state: z.ZodLiteral<"error">;
84
- cause: z.ZodEnum<{
85
- "fetch-failed": "fetch-failed";
86
- "ref-not-found": "ref-not-found";
87
- "refused-format": "refused-format";
88
- }>;
89
- detail: z.ZodString;
90
- skillCount: z.ZodNumber;
91
- }, z.core.$strip>], "state">;
92
- }, z.core.$strip>;
93
- export type TeamSkillSource = z.infer<typeof teamSkillSourceSchema>;
94
- /**
95
- * `GET /skills/sources` and every write's answer. `editable` is false on a cockpit whose
96
- * settings are admin-only. `configIssue` names why `.ai/cezar/config.json` cannot be read; while
97
- * it is set, every write is refused and `sources` is empty.
98
- */
99
- export declare const teamSkillSourcesResponseSchema: z.ZodObject<{
100
- sources: z.ZodArray<z.ZodObject<{
101
- repo: z.ZodString;
102
- ref: z.ZodString;
103
- enabled: z.ZodBoolean;
104
- status: z.ZodDiscriminatedUnion<[z.ZodObject<{
105
- state: z.ZodLiteral<"idle">;
106
- }, z.core.$strip>, z.ZodObject<{
107
- state: z.ZodLiteral<"loading">;
108
- }, z.core.$strip>, z.ZodObject<{
109
- state: z.ZodLiteral<"ok">;
110
- skillCount: z.ZodNumber;
111
- }, z.core.$strip>, z.ZodObject<{
112
- state: z.ZodLiteral<"error">;
113
- cause: z.ZodEnum<{
114
- "fetch-failed": "fetch-failed";
115
- "ref-not-found": "ref-not-found";
116
- "refused-format": "refused-format";
117
- }>;
118
- detail: z.ZodString;
119
- skillCount: z.ZodNumber;
120
- }, z.core.$strip>], "state">;
121
- }, z.core.$strip>>;
122
- editable: z.ZodBoolean;
123
- configIssue: z.ZodNullable<z.ZodString>;
124
- }, z.core.$strip>;
125
- export type TeamSkillSourcesResponse = z.infer<typeof teamSkillSourcesResponseSchema>;
@@ -1,10 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * One team skill the project switched off, identified by its source repo and name so the same
4
- * name from another source stays on. Strict: an entry with a stray key is a bad write.
5
- */
6
- export declare const teamSkillRefSchema: z.ZodObject<{
7
- repo: z.ZodString;
8
- name: z.ZodString;
9
- }, z.core.$strict>;
10
- export type TeamSkillRef = z.infer<typeof teamSkillRefSchema>;
@@ -1,264 +0,0 @@
1
- import type { Home } from '../home/home.ts';
2
- import { type AddTeamSkillSource, type SetTeamSkillSourceEnabled, type TeamSkillSourceRef, type TeamSkillSourcesResponse } from '../contract/index.js';
3
- import type { ProjectApiEnv } from './server.ts';
4
- /**
5
- * Team skill sources on the Skills page (hearsay-tools/cezarion#279). Every change edits only
6
- * `skillsRepos` in the project's `.ai/cezar/config.json`, through `updateConfigFile`; other keys
7
- * stay as they are. A file that cannot be read is never written.
8
- */
9
- /** Settings are admin-only on this cockpit: the source controls are read-only. */
10
- export declare const SKILL_SOURCES_HOSTED_ERROR: string;
11
- export interface SkillSourcesProject {
12
- home: Home;
13
- root: string;
14
- dataDir: string;
15
- }
16
- type Refusal = {
17
- ok: false;
18
- status: 404 | 409;
19
- error: string;
20
- };
21
- export type SkillSourcesAnswer = {
22
- ok: true;
23
- body: TeamSkillSourcesResponse;
24
- } | Refusal;
25
- /** The page's view: each source, with the state its last load left. */
26
- export declare function readSkillSources(project: SkillSourcesProject, editable: boolean): Promise<TeamSkillSourcesResponse>;
27
- /**
28
- * Add a source, enabled, at the end of the list, then fetch it in the background: the answer
29
- * shows it loading, and the page reads its skills or its error when the fetch ends. A source
30
- * added with no ref is written without one, as a hand-written entry would be.
31
- */
32
- export declare function addSkillSource(project: SkillSourcesProject, editable: boolean, body: AddTeamSkillSource): Promise<SkillSourcesAnswer>;
33
- /** Enable or disable a source. Its per-skill switches stay as they are either way. */
34
- export declare function setSkillSourceEnabled(project: SkillSourcesProject, editable: boolean, body: SetTeamSkillSourceEnabled): Promise<SkillSourcesAnswer>;
35
- /** Remove a source. Its per-skill switches stay in `ui-state.json`, so adding it again restores them. */
36
- export declare function removeSkillSource(project: SkillSourcesProject, editable: boolean, body: TeamSkillSourceRef): Promise<SkillSourcesAnswer>;
37
- /** Fetch one enabled source again, in the background, as the page's Retry. */
38
- export declare function retrySkillSource(project: SkillSourcesProject, editable: boolean, body: TeamSkillSourceRef): Promise<SkillSourcesAnswer>;
39
- /**
40
- * `/skills/sources` (project-scoped). Writes are settings administration, like worktree setup:
41
- * `settingsAdmin` is read per request, so a remote cockpit is read-only until its host allows it.
42
- */
43
- export declare function skillSourcesRoutes(settingsAdmin: () => boolean): import("hono/hono-base").HonoBase<ProjectApiEnv, {
44
- "/skills/sources": {
45
- $get: {
46
- output: {
47
- sources: {
48
- repo: string;
49
- ref: string;
50
- enabled: boolean;
51
- status: {
52
- state: "idle";
53
- } | {
54
- state: "loading";
55
- } | {
56
- state: "ok";
57
- skillCount: number;
58
- } | {
59
- state: "error";
60
- cause: "fetch-failed" | "ref-not-found" | "refused-format";
61
- detail: string;
62
- skillCount: number;
63
- };
64
- }[];
65
- editable: boolean;
66
- configIssue: string | null;
67
- };
68
- outputFormat: "json";
69
- status: 200;
70
- input: {};
71
- };
72
- };
73
- } & {
74
- "/skills/sources": {
75
- $post: {
76
- output: {
77
- sources: {
78
- repo: string;
79
- ref: string;
80
- enabled: boolean;
81
- status: {
82
- state: "idle";
83
- } | {
84
- state: "loading";
85
- } | {
86
- state: "ok";
87
- skillCount: number;
88
- } | {
89
- state: "error";
90
- cause: "fetch-failed" | "ref-not-found" | "refused-format";
91
- detail: string;
92
- skillCount: number;
93
- };
94
- }[];
95
- editable: boolean;
96
- configIssue: string | null;
97
- };
98
- outputFormat: "json";
99
- status: 200;
100
- input: {
101
- json: {
102
- repo: string;
103
- ref?: string | undefined;
104
- };
105
- };
106
- } | {
107
- output: {
108
- error: string;
109
- };
110
- outputFormat: "json";
111
- status: 404 | 409;
112
- input: {
113
- json: {
114
- repo: string;
115
- ref?: string | undefined;
116
- };
117
- };
118
- };
119
- };
120
- } & {
121
- "/skills/sources": {
122
- $patch: {
123
- output: {
124
- sources: {
125
- repo: string;
126
- ref: string;
127
- enabled: boolean;
128
- status: {
129
- state: "idle";
130
- } | {
131
- state: "loading";
132
- } | {
133
- state: "ok";
134
- skillCount: number;
135
- } | {
136
- state: "error";
137
- cause: "fetch-failed" | "ref-not-found" | "refused-format";
138
- detail: string;
139
- skillCount: number;
140
- };
141
- }[];
142
- editable: boolean;
143
- configIssue: string | null;
144
- };
145
- outputFormat: "json";
146
- status: 200;
147
- input: {
148
- json: {
149
- repo: string;
150
- ref: string;
151
- enabled: boolean;
152
- };
153
- };
154
- } | {
155
- output: {
156
- error: string;
157
- };
158
- outputFormat: "json";
159
- status: 404 | 409;
160
- input: {
161
- json: {
162
- repo: string;
163
- ref: string;
164
- enabled: boolean;
165
- };
166
- };
167
- };
168
- };
169
- } & {
170
- "/skills/sources": {
171
- $delete: {
172
- output: {
173
- sources: {
174
- repo: string;
175
- ref: string;
176
- enabled: boolean;
177
- status: {
178
- state: "idle";
179
- } | {
180
- state: "loading";
181
- } | {
182
- state: "ok";
183
- skillCount: number;
184
- } | {
185
- state: "error";
186
- cause: "fetch-failed" | "ref-not-found" | "refused-format";
187
- detail: string;
188
- skillCount: number;
189
- };
190
- }[];
191
- editable: boolean;
192
- configIssue: string | null;
193
- };
194
- outputFormat: "json";
195
- status: 200;
196
- input: {
197
- json: {
198
- repo: string;
199
- ref: string;
200
- };
201
- };
202
- } | {
203
- output: {
204
- error: string;
205
- };
206
- outputFormat: "json";
207
- status: 404 | 409;
208
- input: {
209
- json: {
210
- repo: string;
211
- ref: string;
212
- };
213
- };
214
- };
215
- };
216
- } & {
217
- "/skills/sources/retry": {
218
- $post: {
219
- output: {
220
- sources: {
221
- repo: string;
222
- ref: string;
223
- enabled: boolean;
224
- status: {
225
- state: "idle";
226
- } | {
227
- state: "loading";
228
- } | {
229
- state: "ok";
230
- skillCount: number;
231
- } | {
232
- state: "error";
233
- cause: "fetch-failed" | "ref-not-found" | "refused-format";
234
- detail: string;
235
- skillCount: number;
236
- };
237
- }[];
238
- editable: boolean;
239
- configIssue: string | null;
240
- };
241
- outputFormat: "json";
242
- status: 200;
243
- input: {
244
- json: {
245
- repo: string;
246
- ref: string;
247
- };
248
- };
249
- } | {
250
- output: {
251
- error: string;
252
- };
253
- outputFormat: "json";
254
- status: 404 | 409;
255
- input: {
256
- json: {
257
- repo: string;
258
- ref: string;
259
- };
260
- };
261
- };
262
- };
263
- }, "/", "/skills/sources/retry">;
264
- export {};
@@ -1,130 +0,0 @@
1
- import { productIdentity } from '../home/identity.js';
2
- import { productName } from '../home/display.js';
3
- import { Hono } from 'hono';
4
- import { addTeamSkillSourceSchema, setTeamSkillSourceEnabledSchema, teamSkillSourceRefSchema, } from '../contract/index.js';
5
- import { jsonZodValidator } from './validators.js';
6
- import { readRawConfig, updateConfigFile } from '../config.js';
7
- import { getTeamSourceStatuses, refreshTeamSources, reloadTeamSkills, sourceKey } from '../skills-remote.js';
8
- /**
9
- * Team skill sources on the Skills page (hearsay-tools/cezarion#279). Every change edits only
10
- * `skillsRepos` in the project's `.ai/cezar/config.json`, through `updateConfigFile`; other keys
11
- * stay as they are. A file that cannot be read is never written.
12
- */
13
- /** Settings are admin-only on this cockpit: the source controls are read-only. */
14
- export const SKILL_SOURCES_HOSTED_ERROR = `Team skill sources are read-only on this remote cockpit. To allow remote edits, run \`${productIdentity().command} remote-settings enable\` on the machine running ${productName('cezar')}.`;
15
- function rawSources(raw) {
16
- return Array.isArray(raw.skillsRepos) ? raw.skillsRepos : [];
17
- }
18
- const refOf = (entry) => ({ repo: entry.repo, ref: entry.ref ?? 'main' });
19
- const sameSource = (entry, ref) => sourceKey(refOf(entry)) === sourceKey(ref);
20
- /** The page's view: each source, with the state its last load left. */
21
- export async function readSkillSources(project, editable) {
22
- return answerFor(project.root, await readRawConfig(project.dataDir), editable, project.home);
23
- }
24
- function answerFor(root, read, editable, home) {
25
- if (!read.ok)
26
- return { sources: [], editable, configIssue: read.issue };
27
- const statuses = getTeamSourceStatuses(root, home);
28
- const sources = rawSources(read.raw).map((entry) => {
29
- const ref = refOf(entry);
30
- const enabled = entry.enabled !== false;
31
- return { ...ref, enabled, status: (enabled && statuses.get(sourceKey(ref))) || { state: 'idle' } };
32
- });
33
- return { sources, editable, configIssue: null };
34
- }
35
- /**
36
- * Apply one change to `skillsRepos` under the config lock. Refused, in order: an admin-only
37
- * cockpit, an unreadable file, then whatever `change` refuses. Nothing is written on a refusal.
38
- */
39
- async function changeSources(project, editable, change) {
40
- if (!editable)
41
- return { ok: false, status: 409, error: SKILL_SOURCES_HOSTED_ERROR };
42
- return updateConfigFile(project.dataDir, (current) => {
43
- if (!current.ok)
44
- return { refuse: { ok: false, status: 409, error: current.issue } };
45
- const outcome = change(rawSources(current.raw));
46
- if ('error' in outcome)
47
- return { refuse: { ok: false, ...outcome } };
48
- return { write: { ...current.raw, skillsRepos: outcome.next }, result: { ok: true } };
49
- });
50
- }
51
- async function settle(project, editable, outcome, after) {
52
- if (!outcome.ok)
53
- return outcome;
54
- await after();
55
- return { ok: true, body: await readSkillSources(project, editable) };
56
- }
57
- /**
58
- * Add a source, enabled, at the end of the list, then fetch it in the background: the answer
59
- * shows it loading, and the page reads its skills or its error when the fetch ends. A source
60
- * added with no ref is written without one, as a hand-written entry would be.
61
- */
62
- export async function addSkillSource(project, editable, body) {
63
- const ref = { repo: body.repo, ref: body.ref ?? 'main' };
64
- const outcome = await changeSources(project, editable, (sources) => sources.some((entry) => sameSource(entry, ref))
65
- ? { status: 409, error: `${ref.repo} at ${ref.ref} is already listed.` }
66
- : { next: [...sources, body.ref === undefined ? { repo: ref.repo } : ref] });
67
- return settle(project, editable, outcome, () => {
68
- void refreshTeamSources(project.root, [ref], project.home);
69
- });
70
- }
71
- /** Enable or disable a source. Its per-skill switches stay as they are either way. */
72
- export async function setSkillSourceEnabled(project, editable, body) {
73
- const outcome = await changeSources(project, editable, (sources) => {
74
- if (!sources.some((entry) => sameSource(entry, body)))
75
- return notListed(body);
76
- return { next: sources.map((entry) => (sameSource(entry, body) ? withEnabled(entry, body.enabled) : entry)) };
77
- });
78
- return settle(project, editable, outcome, () => reloadTeamSkills(project.root, project.home));
79
- }
80
- /** Enabled is the default, so an enabled entry carries no `enabled` key, as before hearsay-tools/cezarion#279. */
81
- function withEnabled(entry, enabled) {
82
- const { enabled: _previous, ...rest } = entry;
83
- return enabled ? rest : { ...rest, enabled: false };
84
- }
85
- /** Remove a source. Its per-skill switches stay in `ui-state.json`, so adding it again restores them. */
86
- export async function removeSkillSource(project, editable, body) {
87
- const outcome = await changeSources(project, editable, (sources) => sources.some((entry) => sameSource(entry, body))
88
- ? { next: sources.filter((entry) => !sameSource(entry, body)) }
89
- : notListed(body));
90
- return settle(project, editable, outcome, () => reloadTeamSkills(project.root, project.home));
91
- }
92
- /** Fetch one enabled source again, in the background, as the page's Retry. */
93
- export async function retrySkillSource(project, editable, body) {
94
- const read = await readRawConfig(project.dataDir);
95
- if (!read.ok)
96
- return { ok: false, status: 409, error: read.issue };
97
- const entry = rawSources(read.raw).find((candidate) => sameSource(candidate, body));
98
- if (!entry || entry.enabled === false)
99
- return { ok: false, ...notListed(body) };
100
- void refreshTeamSources(project.root, [body], project.home);
101
- return { ok: true, body: answerFor(project.root, read, editable, project.home) };
102
- }
103
- function notListed(ref) {
104
- return { status: 404, error: `${ref.repo} at ${ref.ref} is not a listed team skill source.` };
105
- }
106
- /**
107
- * `/skills/sources` (project-scoped). Writes are settings administration, like worktree setup:
108
- * `settingsAdmin` is read per request, so a remote cockpit is read-only until its host allows it.
109
- */
110
- export function skillSourcesRoutes(settingsAdmin) {
111
- return new Hono()
112
- .get('/skills/sources', async (c) => c.json(await readSkillSources(c.get('project'), settingsAdmin()), 200))
113
- .post('/skills/sources', jsonZodValidator(() => addTeamSkillSourceSchema), async (c) => {
114
- const answer = await addSkillSource(c.get('project'), settingsAdmin(), c.req.valid('json'));
115
- return answer.ok ? c.json(answer.body, 200) : c.json({ error: answer.error }, answer.status);
116
- })
117
- .patch('/skills/sources', jsonZodValidator(() => setTeamSkillSourceEnabledSchema), async (c) => {
118
- const answer = await setSkillSourceEnabled(c.get('project'), settingsAdmin(), c.req.valid('json'));
119
- return answer.ok ? c.json(answer.body, 200) : c.json({ error: answer.error }, answer.status);
120
- })
121
- .delete('/skills/sources', jsonZodValidator(() => teamSkillSourceRefSchema), async (c) => {
122
- const answer = await removeSkillSource(c.get('project'), settingsAdmin(), c.req.valid('json'));
123
- return answer.ok ? c.json(answer.body, 200) : c.json({ error: answer.error }, answer.status);
124
- })
125
- .post('/skills/sources/retry', jsonZodValidator(() => teamSkillSourceRefSchema), async (c) => {
126
- const answer = await retrySkillSource(c.get('project'), settingsAdmin(), c.req.valid('json'));
127
- return answer.ok ? c.json(answer.body, 200) : c.json({ error: answer.error }, answer.status);
128
- });
129
- }
130
- //# sourceMappingURL=skill-sources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skill-sources.js","sourceRoot":"","sources":["../../src/server/skill-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,wBAAwB,GAMzB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAsB,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE7G;;;;GAIG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,0BAA0B,GACrC,yFAAyF,eAAe,EAAE,CAAC,OAAO,oDAAoD,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC;AAmBhM,SAAS,UAAU,CAAC,GAA4B;IAC9C,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAE,GAAG,CAAC,WAA2B,CAAC,CAAC,CAAC,EAAE,CAAC;AAChF,CAAC;AAED,MAAM,KAAK,GAAG,CAAC,KAAgB,EAAsB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAA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CAAC,CAAC;SACD,MAAM,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QACvF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/F,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/F,CAAC,CAAC;SACD,IAAI,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAC3F,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9F,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,64 +0,0 @@
1
- import type { Home } from './home/home.ts';
2
- import type { Skill } from './skills.ts';
3
- import { type WorktreeFilesOptions } from './worktree-manifest.ts';
4
- /**
5
- * Provision selected skills, the skills a step's prompt names as `/name`, and heuristically
6
- * discovered catalog companions in the run’s own worktree. This is not a promise that every
7
- * enabled skill is installed.
8
- */
9
- /** Bound on one closure's companions: a skill that names the whole catalog must not install all
10
- * of it. Roots are never capped: each one is a skill a human selected or named. */
11
- export declare const MAX_SKILL_CLOSURE = 24;
12
- /** A skill name that is safe as one directory name (no separators, never `.`/`..`). */
13
- export declare const SAFE_SKILL_NAME: RegExp;
14
- /**
15
- * True when `body` names `name` as a skill: hyphenated names by word, plain names only as `/name`,
16
- * `` `name` `` or inside a matched pair of quotes (`"name"`, `'name'`, `“name”`, `‘name’`), which
17
- * is how `call the Skill tool with "grilling"` names one (hearsay-tools/cezarion#1480).
18
- */
19
- export declare function mentionsSkill(body: string, name: string): boolean;
20
- /**
21
- * True when a human's `text` names `name` as a typed `/name`, at the start of a word and never
22
- * as a path segment (`a/name`, `~/name`, `C:/name`, `/name/a`, `/name.ext`, a URL). Stricter than
23
- * `mentionsSkill`: a prompt is prose and paths, where a bare hyphenated word is not a request to
24
- * run a skill (hearsay-tools/cezarion#1672).
25
- */
26
- export declare function namesSkillCommand(text: string, name: string): boolean;
27
- /**
28
- * Every root, then the catalog skills their bodies name, transitively, while the closure holds
29
- * fewer than `MAX_SKILL_CLOSURE`. The first catalog entry for a name wins, so a catalog in
30
- * precedence order (`discoverSkills`, local first) keeps that order. `truncated` names the first
31
- * companion the cap left out; the cap never leaves out a root (hearsay-tools/cezarion#1672).
32
- */
33
- export declare function skillClosure(roots: readonly Skill[], catalog: readonly Skill[]): {
34
- skills: Skill[];
35
- truncated?: string;
36
- };
37
- /** First line of the `.gitignore` Squawk owns inside a worktree skills dir. */
38
- export declare const PROVISION_IGNORE_MARK = "# cezar: skills installed for this task, not part of the repository";
39
- export interface ProvisionResult {
40
- /** Skills with at least one entry created or rewritten by this pass, in closure order. */
41
- installed: string[];
42
- /** The first skill `MAX_SKILL_CLOSURE` left out, if any. */
43
- truncated?: string;
44
- /** Absolute directories that hold Squawk's current copy of a team directory skill, by skill name. */
45
- teamCopies: Record<string, string[]>;
46
- }
47
- export interface ProvisionOptions extends WorktreeFilesOptions {
48
- home: Home;
49
- /** True once the run stopped: the pass writes nothing more from its next step on. */
50
- cancelled?: () => boolean;
51
- }
52
- /**
53
- * Provision roots and companions only in an owned task worktree, through its manifest
54
- * (`worktree-manifest.ts`): replace or remove only Squawk's unchanged entries, and reject escaping
55
- * destinations. Install ignore rules before entries. On failure retain the system-prompt
56
- * fallback; never throw.
57
- */
58
- export declare function provisionSkills(worktree: string, roots: readonly Skill[], catalog: readonly Skill[], options: ProvisionOptions): Promise<ProvisionResult>;
59
- /**
60
- * Remove every entry `provisionSkills` recorded in `worktree` that still is what Squawk left, and
61
- * its owned ignore files, then drop its entries and roots from the manifest. A path the user
62
- * replaced stays. Never throws. A later skills design calls this before it installs its own view.
63
- */
64
- export declare function removeProvisionedSkills(worktree: string): Promise<void>;