@hearsay-tools/squawk 0.18.0-pr4358.8559 → 0.18.0-pr4358.8568
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/contract/index.js +23 -2
- package/dist/contract/session-context.d.ts +54 -8
- package/dist/data-gitignore.js +1 -0
- package/dist/data-gitignore.js.map +1 -1
- package/dist/delegation/routes.d.ts +65 -65
- package/dist/server/projects-routes.d.ts +45 -45
- package/dist/server/repo-routes.d.ts +13 -13
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +16 -16
- package/dist/server/server.d.ts +122 -82
- package/dist/server/session-context-routes.d.ts +35 -15
- package/dist/server/session-context-routes.js +6 -6
- package/dist/server/session-context-routes.js.map +1 -1
- package/dist/session-context-file.d.ts +3 -3
- package/dist/session-context-file.js +45 -16
- package/dist/session-context-file.js.map +1 -1
- package/dist/session-context.d.ts +18 -9
- package/dist/session-context.js +118 -47
- package/dist/session-context.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-AHiwnrqA.js → accounts-section-VLKEYGPj.js} +1 -1
- package/web/dist/assets/{activity-motion-DuUXo_fX.js → activity-motion-IiyiWtXq.js} +1 -1
- package/web/dist/assets/{activity-route-BFl6F4Lu.js → activity-route-QCPCR9kZ.js} +1 -1
- package/web/dist/assets/{agent-config-section-B9ij5XUt.js → agent-config-section-BK0gs0uc.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-BL5axoK7.js → agent-defaults-section-BoluhHkE.js} +1 -1
- package/web/dist/assets/{appearance-BdF0mo9V.js → appearance-CEFPwlnq.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-BKFGWhTW.js → archive-on-merge-field-BEt4jVZt.js} +1 -1
- package/web/dist/assets/{automations-route-Xusdh9RP.js → automations-route-F58YdVbC.js} +1 -1
- package/web/dist/assets/{commit-list-DNXq8Wgs.js → commit-list-BZ6wfGPz.js} +1 -1
- package/web/dist/assets/{diff-C1wKJ5AH.js → diff-BbD04q_C.js} +2 -2
- package/web/dist/assets/{diff-controls-Du09ZD1K.js → diff-controls-CW1hOWET.js} +1 -1
- package/web/dist/assets/{diff-view-D5esnwHT.js → diff-view-C3XewBZ4.js} +1 -1
- package/web/dist/assets/{file-preview-DmgDJn82.js → file-preview-B3r8zavn.js} +1 -1
- package/web/dist/assets/{folder-browser-Dg4CmonF.js → folder-browser-6LK4AIPp.js} +1 -1
- package/web/dist/assets/{git-toolbar-D2uMxLAD.js → git-toolbar-CCZtGd6H.js} +1 -1
- package/web/dist/assets/{github-2g3W6ycO.js → github-CzZZ-wwm.js} +1 -1
- package/web/dist/assets/{global-activity-route-9lfwsKE2.js → global-activity-route-BNyhS-a8.js} +1 -1
- package/web/dist/assets/{image-preview-DK8CeCRn.js → image-preview-CMk53HOX.js} +1 -1
- package/web/dist/assets/{index-D06X-OoO.js → index-DaJ5iats.js} +5 -5
- package/web/dist/assets/{label-D1xUdJjL.js → label-YDZzSz0S.js} +1 -1
- package/web/dist/assets/{markdown-D-hVmnwQ.js → markdown-q0pVKAO0.js} +1 -1
- package/web/dist/assets/{notifications-section-fNt0kDTB.js → notifications-section-n3Xb47pL.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-ClJma202.js → preview-pane-connected-VmfC04wB.js} +1 -1
- package/web/dist/assets/{project-location-CDQm9Gul.js → project-location-GPzDWXuH.js} +1 -1
- package/web/dist/assets/{projects-section-LfAk73FY.js → projects-section-BotQxpQ6.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-BGPpireM.js → prompt-templates-section-B8pr6Ue3.js} +1 -1
- package/web/dist/assets/queries-DDhFFTvR.js +1 -0
- package/web/dist/assets/{reference-chip-Clhghu8I.js → reference-chip-90x9Bq44.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-EZ382VXA.js → remote-settings-notice-F_onp6Yr.js} +1 -1
- package/web/dist/assets/{repo-git-3BV6yXp9.js → repo-git-B5Bse6ld.js} +1 -1
- package/web/dist/assets/{report-reader-BtMDZSxx.js → report-reader-B_kyYgIY.js} +1 -1
- package/web/dist/assets/{reports-CJIw7o8_.js → reports-D0E8DWXQ.js} +1 -1
- package/web/dist/assets/{resources-section-D2xgeg1K.js → resources-section-DcfHTNpN.js} +1 -1
- package/web/dist/assets/{run-header-B65PhE5J.js → run-header-OhEYfuQX.js} +1 -1
- package/web/dist/assets/{select-BQ0b8D0M.js → select-r1KS5cjs.js} +1 -1
- package/web/dist/assets/session-context-section-PCOCiOTV.js +119 -0
- package/web/dist/assets/{settings-agent-picker-rRKtgEym.js → settings-agent-picker-D0UKjmOj.js} +1 -1
- package/web/dist/assets/{settings-shell-CbXRegSQ.js → settings-shell-BiPh5fg6.js} +1 -1
- package/web/dist/assets/{sidebar-section-y3wevbWE.js → sidebar-section-DmOlTUs8.js} +1 -1
- package/web/dist/assets/{skills-D9rmPjwB.js → skills-CSLg7E0x.js} +1 -1
- package/web/dist/assets/{task-changes-1M-8Nih4.js → task-changes-DuOb61QV.js} +1 -1
- package/web/dist/assets/{task-commits-DbJNq4EA.js → task-commits-CiGYJpqo.js} +1 -1
- package/web/dist/assets/{task-files-Bq5k3QiX.js → task-files-fJSQ4Abg.js} +1 -1
- package/web/dist/assets/{task-github-item-B4EEYok0.js → task-github-item-CRxN82Yw.js} +1 -1
- package/web/dist/assets/{task-groups-fk4Gq4hX.js → task-groups-B3Z2qfE6.js} +1 -1
- package/web/dist/assets/task-thread-CqjKwRuV.js +9 -0
- package/web/dist/assets/{tasks-table-JFvtNCc1.js → tasks-table-Cm6YZBUB.js} +1 -1
- package/web/dist/assets/{thread-state-CgZtq0-9.js → thread-state-DcHyKcQ-.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-BCjj7r3n.js → use-hand-to-agent-state-DuefXU2m.js} +1 -1
- package/web/dist/assets/{workflows-CuNxWGhE.js → workflows-CC3TZmBS.js} +1 -1
- package/web/dist/assets/{workspace-tools-BmyQFlI8.js → workspace-tools-kscvD6KC.js} +1 -1
- package/web/dist/assets/{worktrees-section-CByb6iJZ.js → worktrees-section-CoKimDBt.js} +1 -1
- package/web/dist/index.html +7 -7
- package/web/dist/assets/queries-BvWsZhaH.js +0 -1
- package/web/dist/assets/session-context-section-BTWK-HXW.js +0 -119
- package/web/dist/assets/task-thread-B-yxE86v.js +0 -9
|
@@ -12273,20 +12273,20 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
|
|
|
12273
12273
|
} & {
|
|
12274
12274
|
"/runs/:id/handoff": {
|
|
12275
12275
|
$get: {
|
|
12276
|
-
output:
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
outputFormat: "json";
|
|
12280
|
-
status: 404;
|
|
12276
|
+
output: string;
|
|
12277
|
+
outputFormat: "text";
|
|
12278
|
+
status: 200;
|
|
12281
12279
|
input: {
|
|
12282
12280
|
param: {
|
|
12283
12281
|
id: string;
|
|
12284
12282
|
};
|
|
12285
12283
|
};
|
|
12286
12284
|
} | {
|
|
12287
|
-
output:
|
|
12288
|
-
|
|
12289
|
-
|
|
12285
|
+
output: {
|
|
12286
|
+
error: string;
|
|
12287
|
+
};
|
|
12288
|
+
outputFormat: "json";
|
|
12289
|
+
status: 404;
|
|
12290
12290
|
input: {
|
|
12291
12291
|
param: {
|
|
12292
12292
|
id: string;
|
|
@@ -12324,20 +12324,20 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
|
|
|
12324
12324
|
} & {
|
|
12325
12325
|
"/runs/:id/diff": {
|
|
12326
12326
|
$get: {
|
|
12327
|
-
output:
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
outputFormat: "json";
|
|
12331
|
-
status: 404 | 409;
|
|
12327
|
+
output: string;
|
|
12328
|
+
outputFormat: "text";
|
|
12329
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
12332
12330
|
input: {
|
|
12333
12331
|
param: {
|
|
12334
12332
|
id: string;
|
|
12335
12333
|
};
|
|
12336
12334
|
};
|
|
12337
12335
|
} | {
|
|
12338
|
-
output:
|
|
12339
|
-
|
|
12340
|
-
|
|
12336
|
+
output: {
|
|
12337
|
+
error: string;
|
|
12338
|
+
};
|
|
12339
|
+
outputFormat: "json";
|
|
12340
|
+
status: 404 | 409;
|
|
12341
12341
|
input: {
|
|
12342
12342
|
param: {
|
|
12343
12343
|
id: string;
|
package/dist/server/server.d.ts
CHANGED
|
@@ -4188,12 +4188,21 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
4188
4188
|
"/session-context": {
|
|
4189
4189
|
$get: {
|
|
4190
4190
|
output: {
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4191
|
+
local: {
|
|
4192
|
+
path: string;
|
|
4193
|
+
exists: boolean;
|
|
4194
|
+
content: string;
|
|
4195
|
+
version: string | null;
|
|
4196
|
+
writable: boolean;
|
|
4197
|
+
readOnlyReason: string | null;
|
|
4198
|
+
};
|
|
4199
|
+
shared: {
|
|
4200
|
+
path: string;
|
|
4201
|
+
exists: boolean;
|
|
4202
|
+
content: string;
|
|
4203
|
+
tracked: boolean;
|
|
4204
|
+
unreadableReason: string | null;
|
|
4205
|
+
};
|
|
4197
4206
|
};
|
|
4198
4207
|
outputFormat: "json";
|
|
4199
4208
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -4211,8 +4220,10 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
4211
4220
|
}[];
|
|
4212
4221
|
blocks: {
|
|
4213
4222
|
id: string;
|
|
4223
|
+
source: 'built-in' | import("../session-context.ts").SessionContextRuleSource;
|
|
4214
4224
|
target: import("../session-context.ts").SessionContextRule['target'] | 'built-in' | null;
|
|
4215
4225
|
status: import("../session-context.ts").SessionContextReportStatus | 'not-for-role';
|
|
4226
|
+
overridesShared: boolean;
|
|
4216
4227
|
bytes: number | null;
|
|
4217
4228
|
reason: string | null;
|
|
4218
4229
|
sources: string[];
|
|
@@ -4236,12 +4247,21 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
4236
4247
|
"/session-context": {
|
|
4237
4248
|
$put: {
|
|
4238
4249
|
output: {
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4250
|
+
local: {
|
|
4251
|
+
path: string;
|
|
4252
|
+
exists: boolean;
|
|
4253
|
+
content: string;
|
|
4254
|
+
version: string | null;
|
|
4255
|
+
writable: boolean;
|
|
4256
|
+
readOnlyReason: string | null;
|
|
4257
|
+
};
|
|
4258
|
+
shared: {
|
|
4259
|
+
path: string;
|
|
4260
|
+
exists: boolean;
|
|
4261
|
+
content: string;
|
|
4262
|
+
tracked: boolean;
|
|
4263
|
+
unreadableReason: string | null;
|
|
4264
|
+
};
|
|
4245
4265
|
};
|
|
4246
4266
|
outputFormat: "json";
|
|
4247
4267
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -4697,6 +4717,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
4697
4717
|
} & {
|
|
4698
4718
|
"/repo/commit/:sha": {
|
|
4699
4719
|
$get: {
|
|
4720
|
+
output: string;
|
|
4721
|
+
outputFormat: "text";
|
|
4722
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
4723
|
+
input: {
|
|
4724
|
+
query: {
|
|
4725
|
+
structured?: string | undefined;
|
|
4726
|
+
};
|
|
4727
|
+
} & {
|
|
4728
|
+
param: {
|
|
4729
|
+
sha: string;
|
|
4730
|
+
};
|
|
4731
|
+
};
|
|
4732
|
+
} | {
|
|
4700
4733
|
output: {
|
|
4701
4734
|
error: string;
|
|
4702
4735
|
code?: "invalid_input" | undefined;
|
|
@@ -4760,19 +4793,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
4760
4793
|
sha: string;
|
|
4761
4794
|
};
|
|
4762
4795
|
};
|
|
4763
|
-
} | {
|
|
4764
|
-
output: string;
|
|
4765
|
-
outputFormat: "text";
|
|
4766
|
-
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
4767
|
-
input: {
|
|
4768
|
-
query: {
|
|
4769
|
-
structured?: string | undefined;
|
|
4770
|
-
};
|
|
4771
|
-
} & {
|
|
4772
|
-
param: {
|
|
4773
|
-
sha: string;
|
|
4774
|
-
};
|
|
4775
|
-
};
|
|
4776
4796
|
};
|
|
4777
4797
|
};
|
|
4778
4798
|
} & {
|
|
@@ -19240,20 +19260,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
19240
19260
|
} & {
|
|
19241
19261
|
"/runs/:id/handoff": {
|
|
19242
19262
|
$get: {
|
|
19243
|
-
output:
|
|
19244
|
-
|
|
19245
|
-
|
|
19246
|
-
outputFormat: "json";
|
|
19247
|
-
status: 404;
|
|
19263
|
+
output: string;
|
|
19264
|
+
outputFormat: "text";
|
|
19265
|
+
status: 200;
|
|
19248
19266
|
input: {
|
|
19249
19267
|
param: {
|
|
19250
19268
|
id: string;
|
|
19251
19269
|
};
|
|
19252
19270
|
};
|
|
19253
19271
|
} | {
|
|
19254
|
-
output:
|
|
19255
|
-
|
|
19256
|
-
|
|
19272
|
+
output: {
|
|
19273
|
+
error: string;
|
|
19274
|
+
};
|
|
19275
|
+
outputFormat: "json";
|
|
19276
|
+
status: 404;
|
|
19257
19277
|
input: {
|
|
19258
19278
|
param: {
|
|
19259
19279
|
id: string;
|
|
@@ -19291,20 +19311,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
19291
19311
|
} & {
|
|
19292
19312
|
"/runs/:id/diff": {
|
|
19293
19313
|
$get: {
|
|
19294
|
-
output:
|
|
19295
|
-
|
|
19296
|
-
|
|
19297
|
-
outputFormat: "json";
|
|
19298
|
-
status: 404 | 409;
|
|
19314
|
+
output: string;
|
|
19315
|
+
outputFormat: "text";
|
|
19316
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
19299
19317
|
input: {
|
|
19300
19318
|
param: {
|
|
19301
19319
|
id: string;
|
|
19302
19320
|
};
|
|
19303
19321
|
};
|
|
19304
19322
|
} | {
|
|
19305
|
-
output:
|
|
19306
|
-
|
|
19307
|
-
|
|
19323
|
+
output: {
|
|
19324
|
+
error: string;
|
|
19325
|
+
};
|
|
19326
|
+
outputFormat: "json";
|
|
19327
|
+
status: 404 | 409;
|
|
19308
19328
|
input: {
|
|
19309
19329
|
param: {
|
|
19310
19330
|
id: string;
|
|
@@ -20910,12 +20930,21 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
20910
20930
|
"/session-context": {
|
|
20911
20931
|
$get: {
|
|
20912
20932
|
output: {
|
|
20913
|
-
|
|
20914
|
-
|
|
20915
|
-
|
|
20916
|
-
|
|
20917
|
-
|
|
20918
|
-
|
|
20933
|
+
local: {
|
|
20934
|
+
path: string;
|
|
20935
|
+
exists: boolean;
|
|
20936
|
+
content: string;
|
|
20937
|
+
version: string | null;
|
|
20938
|
+
writable: boolean;
|
|
20939
|
+
readOnlyReason: string | null;
|
|
20940
|
+
};
|
|
20941
|
+
shared: {
|
|
20942
|
+
path: string;
|
|
20943
|
+
exists: boolean;
|
|
20944
|
+
content: string;
|
|
20945
|
+
tracked: boolean;
|
|
20946
|
+
unreadableReason: string | null;
|
|
20947
|
+
};
|
|
20919
20948
|
};
|
|
20920
20949
|
outputFormat: "json";
|
|
20921
20950
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -20933,8 +20962,10 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
20933
20962
|
}[];
|
|
20934
20963
|
blocks: {
|
|
20935
20964
|
id: string;
|
|
20965
|
+
source: 'built-in' | import("../session-context.ts").SessionContextRuleSource;
|
|
20936
20966
|
target: import("../session-context.ts").SessionContextRule['target'] | 'built-in' | null;
|
|
20937
20967
|
status: import("../session-context.ts").SessionContextReportStatus | 'not-for-role';
|
|
20968
|
+
overridesShared: boolean;
|
|
20938
20969
|
bytes: number | null;
|
|
20939
20970
|
reason: string | null;
|
|
20940
20971
|
sources: string[];
|
|
@@ -20958,12 +20989,21 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
20958
20989
|
"/session-context": {
|
|
20959
20990
|
$put: {
|
|
20960
20991
|
output: {
|
|
20961
|
-
|
|
20962
|
-
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20992
|
+
local: {
|
|
20993
|
+
path: string;
|
|
20994
|
+
exists: boolean;
|
|
20995
|
+
content: string;
|
|
20996
|
+
version: string | null;
|
|
20997
|
+
writable: boolean;
|
|
20998
|
+
readOnlyReason: string | null;
|
|
20999
|
+
};
|
|
21000
|
+
shared: {
|
|
21001
|
+
path: string;
|
|
21002
|
+
exists: boolean;
|
|
21003
|
+
content: string;
|
|
21004
|
+
tracked: boolean;
|
|
21005
|
+
unreadableReason: string | null;
|
|
21006
|
+
};
|
|
20967
21007
|
};
|
|
20968
21008
|
outputFormat: "json";
|
|
20969
21009
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -21419,6 +21459,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
21419
21459
|
} & {
|
|
21420
21460
|
"/repo/commit/:sha": {
|
|
21421
21461
|
$get: {
|
|
21462
|
+
output: string;
|
|
21463
|
+
outputFormat: "text";
|
|
21464
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
21465
|
+
input: {
|
|
21466
|
+
query: {
|
|
21467
|
+
structured?: string | undefined;
|
|
21468
|
+
};
|
|
21469
|
+
} & {
|
|
21470
|
+
param: {
|
|
21471
|
+
sha: string;
|
|
21472
|
+
};
|
|
21473
|
+
};
|
|
21474
|
+
} | {
|
|
21422
21475
|
output: {
|
|
21423
21476
|
error: string;
|
|
21424
21477
|
code?: "invalid_input" | undefined;
|
|
@@ -21482,19 +21535,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
21482
21535
|
sha: string;
|
|
21483
21536
|
};
|
|
21484
21537
|
};
|
|
21485
|
-
} | {
|
|
21486
|
-
output: string;
|
|
21487
|
-
outputFormat: "text";
|
|
21488
|
-
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
21489
|
-
input: {
|
|
21490
|
-
query: {
|
|
21491
|
-
structured?: string | undefined;
|
|
21492
|
-
};
|
|
21493
|
-
} & {
|
|
21494
|
-
param: {
|
|
21495
|
-
sha: string;
|
|
21496
|
-
};
|
|
21497
|
-
};
|
|
21498
21538
|
};
|
|
21499
21539
|
};
|
|
21500
21540
|
} & {
|
|
@@ -35962,20 +36002,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
35962
36002
|
} & {
|
|
35963
36003
|
"/runs/:id/handoff": {
|
|
35964
36004
|
$get: {
|
|
35965
|
-
output:
|
|
35966
|
-
|
|
35967
|
-
|
|
35968
|
-
outputFormat: "json";
|
|
35969
|
-
status: 404;
|
|
36005
|
+
output: string;
|
|
36006
|
+
outputFormat: "text";
|
|
36007
|
+
status: 200;
|
|
35970
36008
|
input: {
|
|
35971
36009
|
param: {
|
|
35972
36010
|
id: string;
|
|
35973
36011
|
};
|
|
35974
36012
|
};
|
|
35975
36013
|
} | {
|
|
35976
|
-
output:
|
|
35977
|
-
|
|
35978
|
-
|
|
36014
|
+
output: {
|
|
36015
|
+
error: string;
|
|
36016
|
+
};
|
|
36017
|
+
outputFormat: "json";
|
|
36018
|
+
status: 404;
|
|
35979
36019
|
input: {
|
|
35980
36020
|
param: {
|
|
35981
36021
|
id: string;
|
|
@@ -36013,20 +36053,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
36013
36053
|
} & {
|
|
36014
36054
|
"/runs/:id/diff": {
|
|
36015
36055
|
$get: {
|
|
36016
|
-
output:
|
|
36017
|
-
|
|
36018
|
-
|
|
36019
|
-
outputFormat: "json";
|
|
36020
|
-
status: 404 | 409;
|
|
36056
|
+
output: string;
|
|
36057
|
+
outputFormat: "text";
|
|
36058
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
36021
36059
|
input: {
|
|
36022
36060
|
param: {
|
|
36023
36061
|
id: string;
|
|
36024
36062
|
};
|
|
36025
36063
|
};
|
|
36026
36064
|
} | {
|
|
36027
|
-
output:
|
|
36028
|
-
|
|
36029
|
-
|
|
36065
|
+
output: {
|
|
36066
|
+
error: string;
|
|
36067
|
+
};
|
|
36068
|
+
outputFormat: "json";
|
|
36069
|
+
status: 404 | 409;
|
|
36030
36070
|
input: {
|
|
36031
36071
|
param: {
|
|
36032
36072
|
id: string;
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import type { ProjectApiEnv } from './server-types.ts';
|
|
2
2
|
/**
|
|
3
|
-
* Settings → Session context (hearsay-tools/squawk#4308). Writing `context.yaml`
|
|
4
|
-
* `settingsAdmin`: the file runs no host command, and its file includes
|
|
5
|
-
* (ADR 0055 gates only settings that persist host commands).
|
|
3
|
+
* Settings → Session context (hearsay-tools/squawk#4308, hearsay-tools/squawk#4341). Writing `context.local.yaml`
|
|
4
|
+
* needs no `settingsAdmin`: the file runs no host command, is gitignored, and its file includes
|
|
5
|
+
* stay inside the worktree (ADR 0055 gates only settings that persist host commands).
|
|
6
6
|
*/
|
|
7
7
|
export declare function createSessionContextRoutes(): import("hono/hono-base").HonoBase<ProjectApiEnv, {
|
|
8
8
|
"/session-context": {
|
|
9
9
|
$get: {
|
|
10
10
|
output: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
local: {
|
|
12
|
+
path: string;
|
|
13
|
+
exists: boolean;
|
|
14
|
+
content: string;
|
|
15
|
+
version: string | null;
|
|
16
|
+
writable: boolean;
|
|
17
|
+
readOnlyReason: string | null;
|
|
18
|
+
};
|
|
19
|
+
shared: {
|
|
20
|
+
path: string;
|
|
21
|
+
exists: boolean;
|
|
22
|
+
content: string;
|
|
23
|
+
tracked: boolean;
|
|
24
|
+
unreadableReason: string | null;
|
|
25
|
+
};
|
|
17
26
|
};
|
|
18
27
|
outputFormat: "json";
|
|
19
28
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -31,8 +40,10 @@ export declare function createSessionContextRoutes(): import("hono/hono-base").H
|
|
|
31
40
|
}[];
|
|
32
41
|
blocks: {
|
|
33
42
|
id: string;
|
|
43
|
+
source: 'built-in' | import("../session-context.ts").SessionContextRuleSource;
|
|
34
44
|
target: import("../session-context.ts").SessionContextRule['target'] | 'built-in' | null;
|
|
35
45
|
status: import("../session-context.ts").SessionContextReportStatus | 'not-for-role';
|
|
46
|
+
overridesShared: boolean;
|
|
36
47
|
bytes: number | null;
|
|
37
48
|
reason: string | null;
|
|
38
49
|
sources: string[];
|
|
@@ -56,12 +67,21 @@ export declare function createSessionContextRoutes(): import("hono/hono-base").H
|
|
|
56
67
|
"/session-context": {
|
|
57
68
|
$put: {
|
|
58
69
|
output: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
local: {
|
|
71
|
+
path: string;
|
|
72
|
+
exists: boolean;
|
|
73
|
+
content: string;
|
|
74
|
+
version: string | null;
|
|
75
|
+
writable: boolean;
|
|
76
|
+
readOnlyReason: string | null;
|
|
77
|
+
};
|
|
78
|
+
shared: {
|
|
79
|
+
path: string;
|
|
80
|
+
exists: boolean;
|
|
81
|
+
content: string;
|
|
82
|
+
tracked: boolean;
|
|
83
|
+
unreadableReason: string | null;
|
|
84
|
+
};
|
|
65
85
|
};
|
|
66
86
|
outputFormat: "json";
|
|
67
87
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
2
|
import { sessionContextPreviewRequestSchema, setSessionContextSchema } from '../contract/index.js';
|
|
3
3
|
import { previewSessionContext } from '../session-context.js';
|
|
4
|
-
import {
|
|
4
|
+
import { readSessionContextState, writeSessionContextFile } from '../session-context-file.js';
|
|
5
5
|
import { jsonZodValidator } from './validators.js';
|
|
6
6
|
/**
|
|
7
|
-
* Settings → Session context (hearsay-tools/squawk#4308). Writing `context.yaml`
|
|
8
|
-
* `settingsAdmin`: the file runs no host command, and its file includes
|
|
9
|
-
* (ADR 0055 gates only settings that persist host commands).
|
|
7
|
+
* Settings → Session context (hearsay-tools/squawk#4308, hearsay-tools/squawk#4341). Writing `context.local.yaml`
|
|
8
|
+
* needs no `settingsAdmin`: the file runs no host command, is gitignored, and its file includes
|
|
9
|
+
* stay inside the worktree (ADR 0055 gates only settings that persist host commands).
|
|
10
10
|
*/
|
|
11
11
|
export function createSessionContextRoutes() {
|
|
12
12
|
return new Hono()
|
|
13
|
-
.get('/session-context', async (c) => c.json(await
|
|
13
|
+
.get('/session-context', async (c) => c.json(await readSessionContextState(c.get('project').root)))
|
|
14
14
|
.post('/session-context/preview', jsonZodValidator(sessionContextPreviewRequestSchema), (c) => {
|
|
15
15
|
const body = c.req.valid('json');
|
|
16
16
|
return c.json(previewSessionContext({ projectRoot: c.get('project').root, content: body.content, role: body.role }));
|
|
@@ -20,7 +20,7 @@ export function createSessionContextRoutes() {
|
|
|
20
20
|
const out = await writeSessionContextFile(c.get('project').root, body.content, body.version);
|
|
21
21
|
if (!out.ok)
|
|
22
22
|
return c.json({ error: out.error }, out.status);
|
|
23
|
-
return c.json(out.
|
|
23
|
+
return c.json(out.state);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=session-context-routes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-context-routes.js","sourceRoot":"","sources":["../../src/server/session-context-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,kCAAkC,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAC3H,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"session-context-routes.js","sourceRoot":"","sources":["../../src/server/session-context-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,kCAAkC,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAC3H,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,IAAI,IAAI,EAAiB;SAC7B,GAAG,CAAC,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;SAElG,IAAI,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QAC5F,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACjC,OAAO,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACvH,CAAC,CAAC;SAED,GAAG,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,uBAAuB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAC9E,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACjC,MAAM,GAAG,GAAG,MAAM,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7F,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7D,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare function
|
|
1
|
+
import { type SessionContextState } from './contract/index.js';
|
|
2
|
+
export declare function readSessionContextState(projectRoot: string): Promise<SessionContextState>;
|
|
3
3
|
export type SessionContextWrite = {
|
|
4
4
|
ok: true;
|
|
5
|
-
|
|
5
|
+
state: SessionContextState;
|
|
6
6
|
} | {
|
|
7
7
|
ok: false;
|
|
8
8
|
status: 400 | 409 | 500;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
2
|
import { lstat, mkdir, readFile, realpath, rename, rm, stat, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { dirname, join, relative } from 'node:path';
|
|
4
|
-
import { SESSION_CONTEXT_FILE_MAX_BYTES } from './contract/index.js';
|
|
4
|
+
import { SESSION_CONTEXT_FILE_MAX_BYTES, } from './contract/index.js';
|
|
5
|
+
import { ensureDataGitignore } from './data-gitignore.js';
|
|
6
|
+
import { runGit } from './git-command.js';
|
|
5
7
|
import { fallbackProjectWriteError, readProjectPath } from './project-paths.js';
|
|
6
8
|
import { parseSessionContextText } from './session-context.js';
|
|
7
9
|
/**
|
|
8
|
-
* The cockpit's read
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* file
|
|
10
|
+
* The cockpit's read of both `context.yaml` (shared, read-only) and `context.local.yaml` (local,
|
|
11
|
+
* editable), and atomic write of `context.local.yaml` (hearsay-tools/squawk#4308, hearsay-tools/squawk#4341). Writing
|
|
12
|
+
* ensures `context.local.yaml` is gitignored so host edits never dirty `git status`. Fallback
|
|
13
|
+
* project data and symlinks stay read only so a remote user cannot redirect writes onto another
|
|
14
|
+
* file such as `config.json`.
|
|
13
15
|
*/
|
|
16
|
+
const SHARED_FILE = 'context.yaml';
|
|
17
|
+
const LOCAL_FILE = 'context.local.yaml';
|
|
14
18
|
function hashBytes(content) {
|
|
15
19
|
return createHash('sha256').update(content, 'utf8').digest('hex');
|
|
16
20
|
}
|
|
@@ -73,6 +77,15 @@ async function readCurrent(projectRoot, path) {
|
|
|
73
77
|
return { exists: true, unreadable: `it cannot be read (${error.code ?? 'error'})` };
|
|
74
78
|
}
|
|
75
79
|
}
|
|
80
|
+
async function isGitTracked(projectRoot, relPath) {
|
|
81
|
+
try {
|
|
82
|
+
const { stdout } = await runGit(['ls-files', '--cached', '--', relPath.replace(/\\/g, '/')], { cwd: projectRoot, timeout: 10_000 });
|
|
83
|
+
return stdout.trim().length > 0;
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
76
89
|
function answer(projectRoot, path, current) {
|
|
77
90
|
const shown = relative(projectRoot, path);
|
|
78
91
|
const fallback = fallbackProjectWriteError(path);
|
|
@@ -90,14 +103,29 @@ function answer(projectRoot, path, current) {
|
|
|
90
103
|
writable: fallback === undefined, readOnlyReason: fallback ?? null,
|
|
91
104
|
};
|
|
92
105
|
}
|
|
93
|
-
|
|
94
|
-
const path = readProjectPath(projectRoot,
|
|
95
|
-
|
|
106
|
+
async function readSharedFile(projectRoot) {
|
|
107
|
+
const path = readProjectPath(projectRoot, SHARED_FILE);
|
|
108
|
+
const shown = relative(projectRoot, path);
|
|
109
|
+
const current = await readCurrent(projectRoot, path);
|
|
110
|
+
if (!current.exists) {
|
|
111
|
+
const unreadableReason = current.unwritable ? `Squawk cannot read ${shown}: ${current.unwritable}.` : null;
|
|
112
|
+
return { path: shown, exists: false, content: '', tracked: false, unreadableReason };
|
|
113
|
+
}
|
|
114
|
+
const tracked = await isGitTracked(projectRoot, shown);
|
|
115
|
+
if ('unreadable' in current) {
|
|
116
|
+
return { path: shown, exists: true, content: '', tracked, unreadableReason: `Squawk cannot read ${shown}: ${current.unreadable}.` };
|
|
117
|
+
}
|
|
118
|
+
return { path: shown, exists: true, content: current.content, tracked, unreadableReason: null };
|
|
119
|
+
}
|
|
120
|
+
export async function readSessionContextState(projectRoot) {
|
|
121
|
+
const localPath = readProjectPath(projectRoot, LOCAL_FILE);
|
|
122
|
+
const [localCurrent, shared] = await Promise.all([readCurrent(projectRoot, localPath), readSharedFile(projectRoot)]);
|
|
123
|
+
return { local: answer(projectRoot, localPath, localCurrent), shared };
|
|
96
124
|
}
|
|
97
125
|
/** One save at a time per file, so two saves over one version cannot both pass the check. */
|
|
98
126
|
const writing = new Map();
|
|
99
127
|
export function writeSessionContextFile(projectRoot, content, version) {
|
|
100
|
-
const path = readProjectPath(projectRoot,
|
|
128
|
+
const path = readProjectPath(projectRoot, LOCAL_FILE);
|
|
101
129
|
const previous = writing.get(path) ?? Promise.resolve();
|
|
102
130
|
const next = previous.then(() => writeChecked(projectRoot, path, content, version));
|
|
103
131
|
const settled = next.catch(() => undefined);
|
|
@@ -112,15 +140,16 @@ async function writeChecked(projectRoot, path, content, version) {
|
|
|
112
140
|
return { ok: false, status: 409, error: before.readOnlyReason ?? `${before.path} is read only` };
|
|
113
141
|
if (before.version !== version) {
|
|
114
142
|
const error = before.exists
|
|
115
|
-
? 'context.yaml changed on disk since you opened it. Show the disk version, or overwrite it.'
|
|
116
|
-
: 'context.yaml was deleted on disk since you opened it. Show the disk version, or overwrite it.';
|
|
143
|
+
? 'context.local.yaml changed on disk since you opened it. Show the disk version, or overwrite it.'
|
|
144
|
+
: 'context.local.yaml was deleted on disk since you opened it. Show the disk version, or overwrite it.';
|
|
117
145
|
return { ok: false, status: 409, error };
|
|
118
146
|
}
|
|
119
|
-
const first = parseSessionContextText(content).problems[0];
|
|
147
|
+
const first = parseSessionContextText(content, 'local', before.path).problems[0];
|
|
120
148
|
if (first) {
|
|
121
149
|
const where = first.line === null ? '' : `line ${first.line}: `;
|
|
122
|
-
return { ok: false, status: 400, error: `context.yaml has problems; fix them to save (${where}${first.message})` };
|
|
150
|
+
return { ok: false, status: 400, error: `context.local.yaml has problems; fix them to save (${where}${first.message})` };
|
|
123
151
|
}
|
|
152
|
+
ensureDataGitignore(projectRoot);
|
|
124
153
|
// The rename replaces the path itself, never a file a link points to: the check above refuses links.
|
|
125
154
|
const tmp = `${path}.hsq-tmp-${process.pid}-${randomUUID()}`;
|
|
126
155
|
try {
|
|
@@ -131,7 +160,7 @@ async function writeChecked(projectRoot, path, content, version) {
|
|
|
131
160
|
const staged = answer(projectRoot, path, await readCurrent(projectRoot, path));
|
|
132
161
|
if (staged.version !== version || !staged.writable) {
|
|
133
162
|
await rm(tmp, { force: true });
|
|
134
|
-
return { ok: false, status: 409, error: 'context.yaml changed on disk since you opened it. Show the disk version, or overwrite it.' };
|
|
163
|
+
return { ok: false, status: 409, error: 'context.local.yaml changed on disk since you opened it. Show the disk version, or overwrite it.' };
|
|
135
164
|
}
|
|
136
165
|
await rename(tmp, path);
|
|
137
166
|
}
|
|
@@ -139,6 +168,6 @@ async function writeChecked(projectRoot, path, content, version) {
|
|
|
139
168
|
await rm(tmp, { force: true });
|
|
140
169
|
return { ok: false, status: 500, error: error.message };
|
|
141
170
|
}
|
|
142
|
-
return { ok: true,
|
|
171
|
+
return { ok: true, state: await readSessionContextState(projectRoot) };
|
|
143
172
|
}
|
|
144
173
|
//# sourceMappingURL=session-context-file.js.map
|