@hearsay-tools/squawk 0.18.0-pr3512.6267 → 0.18.0-pr3513.6273
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 +9 -3
- package/dist/contract/run-search.d.ts +20 -18
- package/dist/delegation/transport.d.ts +62 -62
- package/dist/server/server.d.ts +1416 -1416
- package/package.json +4 -4
- package/web/dist/assets/{activity-motion-IP8sS6-U.js → activity-motion-DjMpx0QL.js} +1 -1
- package/web/dist/assets/{activity-route-DIGKB9PQ.js → activity-route-CE2cYbQO.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-DFiSaGQ8.js → commit-diff-panel-DBrsQdXO.js} +1 -1
- package/web/dist/assets/{diff-BN60wGSU.js → diff-D81T6FlH.js} +2 -2
- package/web/dist/assets/{diff-view-lxvRexYH.js → diff-view-Sqk3iny_.js} +1 -1
- package/web/dist/assets/{file-preview-BuhWEbng.js → file-preview-CFvc38AT.js} +1 -1
- package/web/dist/assets/{git-toolbar-CTzewTqu.js → git-toolbar-CZAj0VNk.js} +1 -1
- package/web/dist/assets/{github-DFvOUsxa.js → github-Cdg3-sQK.js} +1 -1
- package/web/dist/assets/{global-activity-route-BdCGpwas.js → global-activity-route-9DUVLRv0.js} +1 -1
- package/web/dist/assets/{index-BquqwaAl.js → index-s7PhnzDS.js} +4 -4
- package/web/dist/assets/{popover-BlBKQSyF.js → popover-G6KGT-qq.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-CLIyjRfl.js → preview-pane-connected-DVlhmoyi.js} +1 -1
- package/web/dist/assets/{prompt-template-menu-Xn29FISj.js → prompt-template-menu-D4-inlE4.js} +1 -1
- package/web/dist/assets/{reference-chip-BwpKSr4H.js → reference-chip-Drpbf-MP.js} +1 -1
- package/web/dist/assets/{repo-git-1gTZVQte.js → repo-git-CwibBYwB.js} +1 -1
- package/web/dist/assets/{report-reader-Dct5U-rK.js → report-reader-BdYHFEdw.js} +1 -1
- package/web/dist/assets/{reports-DiaOsjGo.js → reports-CWlWhffn.js} +1 -1
- package/web/dist/assets/{run-header-CHKNkgGR.js → run-header-Dc5892Cu.js} +1 -1
- package/web/dist/assets/{skills-V8a1rkD7.js → skills-B2Cc1jJi.js} +1 -1
- package/web/dist/assets/{task-changes-DcfH9M7H.js → task-changes-CN0VE5bZ.js} +1 -1
- package/web/dist/assets/{task-commits-CrpLU5BV.js → task-commits-ycrhlORw.js} +1 -1
- package/web/dist/assets/{task-files-DlOF2bjK.js → task-files-CjqaWaul.js} +1 -1
- package/web/dist/assets/{task-github-item-wFRFpNJf.js → task-github-item-CezPgdB9.js} +1 -1
- package/web/dist/assets/{task-thread-BH_JSxVo.js → task-thread-BfsMGE4k.js} +1 -1
- package/web/dist/assets/{thread-state-BjqhYmxY.js → thread-state-B6Ar3fj6.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-B4TH7Jhq.js → use-hand-to-agent-state-BOTjwkGM.js} +1 -1
- package/web/dist/assets/{workflows-Xnfv2Nla.js → workflows-B32GiY9u.js} +1 -1
- package/web/dist/index.html +4 -4
package/dist/contract/index.js
CHANGED
|
@@ -4726,11 +4726,17 @@ var FIELDS = RUN_SEARCH_FIELDS;
|
|
|
4726
4726
|
function searchTokens(query) {
|
|
4727
4727
|
return query.trim().toLowerCase().split(/\s+/).filter((token) => token !== "");
|
|
4728
4728
|
}
|
|
4729
|
+
function queryTokens(query, mode) {
|
|
4730
|
+
if (mode !== "phrase") return searchTokens(query);
|
|
4731
|
+
const phrase = query.trim().toLowerCase();
|
|
4732
|
+
return phrase === "" ? [] : [phrase];
|
|
4733
|
+
}
|
|
4729
4734
|
function storedOrigin(run, names) {
|
|
4730
4735
|
return names && run.automationId !== void 0 ? names.get(run.automationId) ?? run.automationId : void 0;
|
|
4731
4736
|
}
|
|
4732
4737
|
function searchText(run, options) {
|
|
4733
4738
|
const scope = options.scope ?? "stored";
|
|
4739
|
+
const omit = options.scope === "shown" ? options.omit ?? [] : [];
|
|
4734
4740
|
const extras = options.scope === "shown" ? options.extras : { automation: storedOrigin(run, options.automationNames) };
|
|
4735
4741
|
const prose = [];
|
|
4736
4742
|
const ids = [];
|
|
@@ -4738,7 +4744,7 @@ function searchText(run, options) {
|
|
|
4738
4744
|
const buckets = { text: prose, identifier: ids, link: links };
|
|
4739
4745
|
const numberSources = [];
|
|
4740
4746
|
for (const field2 of FIELDS) {
|
|
4741
|
-
if (!field2.scopes.includes(scope)) continue;
|
|
4747
|
+
if (!field2.scopes.includes(scope) || omit.includes(field2.id)) continue;
|
|
4742
4748
|
if (field2.kind === "reference") {
|
|
4743
4749
|
numberSources.push(() => field2.numbers(run, extras));
|
|
4744
4750
|
continue;
|
|
@@ -4756,7 +4762,7 @@ function searchText(run, options) {
|
|
|
4756
4762
|
};
|
|
4757
4763
|
}
|
|
4758
4764
|
function matchesRunSearch(run, query, options = {}) {
|
|
4759
|
-
const tokens =
|
|
4765
|
+
const tokens = queryTokens(query, options.mode);
|
|
4760
4766
|
if (tokens.length === 0) return false;
|
|
4761
4767
|
const { prose, ids, links, references } = searchText(run, options);
|
|
4762
4768
|
return tokens.every((token) => {
|
|
@@ -4770,7 +4776,7 @@ function matchesRunSearch(run, query, options = {}) {
|
|
|
4770
4776
|
}
|
|
4771
4777
|
function sqlPrefilterTokens(query, options = {}) {
|
|
4772
4778
|
const outside = FIELDS.filter((field2) => field2.scopes.includes("stored") && field2.source === "reader").flatMap((field2) => field2.universe?.(options) ?? []).map((text) => text.toLowerCase());
|
|
4773
|
-
return
|
|
4779
|
+
return queryTokens(query, options.mode).map((token) => token.replace(/^#/, "")).filter((token) => token !== "" && /^[\x20-\x7e]+$/.test(token) && !/["\\]/.test(token)).filter((token) => !outside.some((text) => text.includes(token)));
|
|
4774
4780
|
}
|
|
4775
4781
|
|
|
4776
4782
|
// ../contract/src/artifacts.ts
|
|
@@ -2,8 +2,8 @@ import type { RunSummary } from './runs.ts';
|
|
|
2
2
|
/**
|
|
3
3
|
* The one rule for "does this run match what was typed" (hearsay-tools/cezarion#1807). The project
|
|
4
4
|
* list, All tasks, the archived pages, the ⌘K palette and the SQL prefilter under the last two all
|
|
5
|
-
* ask it, so a run found in one place is found in the others
|
|
6
|
-
* searchable field is one entry in `RUN_SEARCH_FIELDS`.
|
|
5
|
+
* ask it, so a run found in one place is found in the others unless a reader says why not, in an
|
|
6
|
+
* option of the call. A new searchable field is one entry in `RUN_SEARCH_FIELDS`.
|
|
7
7
|
*
|
|
8
8
|
* Every whitespace-separated token must match. A token matches a substring of a text field. A
|
|
9
9
|
* number, with a leading `#` stripped, also matches a reference number EXACTLY and an id as a
|
|
@@ -22,6 +22,8 @@ export type RunSearchRun = Pick<RunSummary, 'id' | 'title' | 'titleSummary' | 'b
|
|
|
22
22
|
* hides: pasting a branch name from a terminal to find its task is a deliberate gesture.
|
|
23
23
|
*/
|
|
24
24
|
export type RunSearchScope = 'stored' | 'shown';
|
|
25
|
+
/** `tokens`: every token must match, in any field. `phrase`: the trimmed query is one token. */
|
|
26
|
+
export type RunSearchMode = 'tokens' | 'phrase';
|
|
25
27
|
/**
|
|
26
28
|
* Automation display names by automation id, for a search whose list shows each task's origin line
|
|
27
29
|
* (hearsay-tools/cezarion#1616). With a lookup, a task an automation launched also matches by that
|
|
@@ -41,15 +43,20 @@ export interface RunSearchExtras {
|
|
|
41
43
|
/** The reference numbers the row shows. Called only when a token is a number. */
|
|
42
44
|
references?: (() => readonly number[]) | undefined;
|
|
43
45
|
}
|
|
46
|
+
interface SearchOptionsBase {
|
|
47
|
+
mode?: RunSearchMode;
|
|
48
|
+
}
|
|
44
49
|
/** The server's reach. Without `automationNames` the automation is not searched. */
|
|
45
|
-
export interface StoredRunSearch {
|
|
50
|
+
export interface StoredRunSearch extends SearchOptionsBase {
|
|
46
51
|
scope?: 'stored';
|
|
47
52
|
automationNames?: AutomationNames | undefined;
|
|
48
53
|
}
|
|
49
54
|
/** A list's reach: what it prints, from `extras`. */
|
|
50
|
-
export interface ShownRunSearch {
|
|
55
|
+
export interface ShownRunSearch extends SearchOptionsBase {
|
|
51
56
|
scope: 'shown';
|
|
52
57
|
extras: RunSearchExtras;
|
|
58
|
+
/** Fields this reader's rows do not print. A field added later is searched unless listed here. */
|
|
59
|
+
omit?: readonly RunSearchFieldId[];
|
|
53
60
|
}
|
|
54
61
|
export type RunSearchOptions = StoredRunSearch | ShownRunSearch;
|
|
55
62
|
type Texts = (run: RunSearchRun, extras: RunSearchExtras) => ReadonlyArray<string | undefined>;
|
|
@@ -79,9 +86,9 @@ export type RunSearchField = FieldCommon & ({
|
|
|
79
86
|
export declare function refNumberFromUrl(url: string): number | null;
|
|
80
87
|
declare function heldReferences(run: RunSearchRun): number[];
|
|
81
88
|
/**
|
|
82
|
-
* THE list of searchable fields. Add a field here and every reader
|
|
83
|
-
* summary-sourced entries are what `runs.db`
|
|
84
|
-
* sees (`sqlPrefilterTokens`).
|
|
89
|
+
* THE list of searchable fields. Add a field here and every reader searches it. A reader that
|
|
90
|
+
* must not says so in `omit`, in its own call. The summary-sourced entries are what `runs.db`
|
|
91
|
+
* stores, which is the only thing the SQL prefilter sees (`sqlPrefilterTokens`).
|
|
85
92
|
*/
|
|
86
93
|
export declare const RUN_SEARCH_FIELDS: readonly [{
|
|
87
94
|
readonly id: 'title';
|
|
@@ -163,25 +170,20 @@ export declare const RUN_SEARCH_FIELDS: readonly [{
|
|
|
163
170
|
readonly source: 'reader';
|
|
164
171
|
readonly numbers: (_run: RunSearchRun, extras: RunSearchExtras) => readonly number[];
|
|
165
172
|
}];
|
|
173
|
+
export type RunSearchFieldId = (typeof RUN_SEARCH_FIELDS)[number]['id'];
|
|
166
174
|
/** The query as lowercased, whitespace-split tokens, empties dropped. */
|
|
167
175
|
export declare function searchTokens(query: string): string[];
|
|
168
176
|
/**
|
|
169
|
-
* Whether every token of `query` matches `run`, under `options` (stored scope
|
|
170
|
-
* names when omitted). A blank query matches nothing: a list that shows every
|
|
171
|
-
* query decides that itself.
|
|
177
|
+
* Whether every token of `query` matches `run`, under `options` (stored scope, every-token mode
|
|
178
|
+
* and no automation names when omitted). A blank query matches nothing: a list that shows every
|
|
179
|
+
* row for a blank query decides that itself.
|
|
172
180
|
*/
|
|
173
181
|
export declare function matchesRunSearch(run: RunSearchRun, query: string, options?: RunSearchOptions): boolean;
|
|
174
182
|
/**
|
|
175
183
|
* The tokens SQL may narrow rows with, as `instr(lower(summary), ?) > 0` over the stored summary
|
|
176
184
|
* JSON. Only tokens that read the same there: ASCII, since SQLite's `lower()` folds ASCII alone,
|
|
177
|
-
* and without `"` or `\`, which JSON escapes.
|
|
178
|
-
*
|
|
179
|
-
* token out only widens the prefilter; `matchesRunSearch` still checks it.
|
|
180
|
-
*
|
|
181
|
-
* A known gap stays: JavaScript `toLowerCase()` folds U+212A (Kelvin sign) to `k` and U+0130 to
|
|
182
|
-
* `i` plus a combining dot, and SQLite `lower()` folds ASCII only, so a run whose only match runs
|
|
183
|
-
* through one of them is dropped here. Closing it would change case folding for every reader, or
|
|
184
|
-
* leave the ASCII tokens `k` and `i` out of the prefilter (hearsay-tools/squawk#1884).
|
|
185
|
+
* and without `"` or `\`, which JSON escapes. Leaving a token out only widens the prefilter;
|
|
186
|
+
* `matchesRunSearch` still checks it.
|
|
185
187
|
*
|
|
186
188
|
* A token inside a text a `reader` field could hold is left out too (today, an automation's name):
|
|
187
189
|
* the summary holds the automation's id, not its name, so the row it should find would never
|
|
@@ -2,6 +2,18 @@ import type { DelegationRoutes } from './routes.ts';
|
|
|
2
2
|
export declare function createDelegationApp(routes: DelegationRoutes): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
|
|
3
3
|
"/list": {
|
|
4
4
|
$get: {
|
|
5
|
+
output: {
|
|
6
|
+
error: string;
|
|
7
|
+
code?: "invalid_input" | undefined;
|
|
8
|
+
};
|
|
9
|
+
outputFormat: "json";
|
|
10
|
+
status: 400;
|
|
11
|
+
input: {
|
|
12
|
+
query: {
|
|
13
|
+
offset?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
5
17
|
output: {
|
|
6
18
|
workers: {
|
|
7
19
|
workerId: string;
|
|
@@ -39,18 +51,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
39
51
|
offset?: string | undefined;
|
|
40
52
|
};
|
|
41
53
|
};
|
|
42
|
-
} | {
|
|
43
|
-
output: {
|
|
44
|
-
error: string;
|
|
45
|
-
code?: "invalid_input" | undefined;
|
|
46
|
-
};
|
|
47
|
-
outputFormat: "json";
|
|
48
|
-
status: 400;
|
|
49
|
-
input: {
|
|
50
|
-
query: {
|
|
51
|
-
offset?: string | undefined;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
} & {
|
|
@@ -588,6 +588,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
588
588
|
} & {
|
|
589
589
|
"/:workerId": {
|
|
590
590
|
$get: {
|
|
591
|
+
output: {
|
|
592
|
+
error: string;
|
|
593
|
+
code?: "invalid_input" | undefined;
|
|
594
|
+
};
|
|
595
|
+
outputFormat: "json";
|
|
596
|
+
status: 400;
|
|
597
|
+
input: {
|
|
598
|
+
param: {
|
|
599
|
+
workerId: string;
|
|
600
|
+
};
|
|
601
|
+
};
|
|
602
|
+
} | {
|
|
591
603
|
output: {
|
|
592
604
|
workerId: string;
|
|
593
605
|
parentRunId: string;
|
|
@@ -691,7 +703,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
691
703
|
workerId: string;
|
|
692
704
|
};
|
|
693
705
|
};
|
|
694
|
-
}
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
} & {
|
|
709
|
+
"/:workerId/collect": {
|
|
710
|
+
$post: {
|
|
695
711
|
output: {
|
|
696
712
|
error: string;
|
|
697
713
|
code?: "invalid_input" | undefined;
|
|
@@ -702,12 +718,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
702
718
|
param: {
|
|
703
719
|
workerId: string;
|
|
704
720
|
};
|
|
721
|
+
} & {
|
|
722
|
+
json: Record<string, never>;
|
|
705
723
|
};
|
|
706
|
-
}
|
|
707
|
-
};
|
|
708
|
-
} & {
|
|
709
|
-
"/:workerId/collect": {
|
|
710
|
-
$post: {
|
|
724
|
+
} | {
|
|
711
725
|
output: {
|
|
712
726
|
workerId: string;
|
|
713
727
|
parentRunId: string;
|
|
@@ -809,7 +823,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
809
823
|
} & {
|
|
810
824
|
json: Record<string, never>;
|
|
811
825
|
};
|
|
812
|
-
}
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
} & {
|
|
829
|
+
"/:workerId/steer": {
|
|
830
|
+
$post: {
|
|
813
831
|
output: {
|
|
814
832
|
error: string;
|
|
815
833
|
code?: "invalid_input" | undefined;
|
|
@@ -821,13 +839,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
821
839
|
workerId: string;
|
|
822
840
|
};
|
|
823
841
|
} & {
|
|
824
|
-
json:
|
|
842
|
+
json: {
|
|
843
|
+
text: string;
|
|
844
|
+
};
|
|
825
845
|
};
|
|
826
|
-
}
|
|
827
|
-
};
|
|
828
|
-
} & {
|
|
829
|
-
"/:workerId/steer": {
|
|
830
|
-
$post: {
|
|
846
|
+
} | {
|
|
831
847
|
output: {
|
|
832
848
|
workerId: string;
|
|
833
849
|
state: "delivered" | "queued";
|
|
@@ -843,7 +859,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
843
859
|
text: string;
|
|
844
860
|
};
|
|
845
861
|
};
|
|
846
|
-
}
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
} & {
|
|
865
|
+
"/:workerId/stop": {
|
|
866
|
+
$post: {
|
|
847
867
|
output: {
|
|
848
868
|
error: string;
|
|
849
869
|
code?: "invalid_input" | undefined;
|
|
@@ -855,15 +875,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
855
875
|
workerId: string;
|
|
856
876
|
};
|
|
857
877
|
} & {
|
|
858
|
-
json:
|
|
859
|
-
text: string;
|
|
860
|
-
};
|
|
878
|
+
json: Record<string, never>;
|
|
861
879
|
};
|
|
862
|
-
}
|
|
863
|
-
};
|
|
864
|
-
} & {
|
|
865
|
-
"/:workerId/stop": {
|
|
866
|
-
$post: {
|
|
880
|
+
} | {
|
|
867
881
|
output: {
|
|
868
882
|
workerId: string;
|
|
869
883
|
state: "stopping" | "terminated";
|
|
@@ -877,7 +891,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
877
891
|
} & {
|
|
878
892
|
json: Record<string, never>;
|
|
879
893
|
};
|
|
880
|
-
}
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
} & {
|
|
897
|
+
"/:workerId/destroy": {
|
|
898
|
+
$post: {
|
|
881
899
|
output: {
|
|
882
900
|
error: string;
|
|
883
901
|
code?: "invalid_input" | undefined;
|
|
@@ -891,11 +909,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
891
909
|
} & {
|
|
892
910
|
json: Record<string, never>;
|
|
893
911
|
};
|
|
894
|
-
}
|
|
895
|
-
};
|
|
896
|
-
} & {
|
|
897
|
-
"/:workerId/destroy": {
|
|
898
|
-
$post: {
|
|
912
|
+
} | {
|
|
899
913
|
output: {
|
|
900
914
|
workerId: string;
|
|
901
915
|
state: "complete" | "incomplete";
|
|
@@ -918,20 +932,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
918
932
|
} & {
|
|
919
933
|
json: Record<string, never>;
|
|
920
934
|
};
|
|
921
|
-
} | {
|
|
922
|
-
output: {
|
|
923
|
-
error: string;
|
|
924
|
-
code?: "invalid_input" | undefined;
|
|
925
|
-
};
|
|
926
|
-
outputFormat: "json";
|
|
927
|
-
status: 400;
|
|
928
|
-
input: {
|
|
929
|
-
param: {
|
|
930
|
-
workerId: string;
|
|
931
|
-
};
|
|
932
|
-
} & {
|
|
933
|
-
json: Record<string, never>;
|
|
934
|
-
};
|
|
935
935
|
} | {
|
|
936
936
|
output: {
|
|
937
937
|
workerId: string;
|
|
@@ -961,13 +961,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
961
961
|
"/:workerId/diff": {
|
|
962
962
|
$get: {
|
|
963
963
|
output: {
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
diff: string;
|
|
967
|
-
truncated: boolean;
|
|
964
|
+
error: string;
|
|
965
|
+
code?: "invalid_input" | undefined;
|
|
968
966
|
};
|
|
969
967
|
outputFormat: "json";
|
|
970
|
-
status:
|
|
968
|
+
status: 400;
|
|
971
969
|
input: {
|
|
972
970
|
param: {
|
|
973
971
|
workerId: string;
|
|
@@ -975,11 +973,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
975
973
|
};
|
|
976
974
|
} | {
|
|
977
975
|
output: {
|
|
978
|
-
|
|
979
|
-
|
|
976
|
+
workerId: string;
|
|
977
|
+
baselineSha: string;
|
|
978
|
+
diff: string;
|
|
979
|
+
truncated: boolean;
|
|
980
980
|
};
|
|
981
981
|
outputFormat: "json";
|
|
982
|
-
status:
|
|
982
|
+
status: 200;
|
|
983
983
|
input: {
|
|
984
984
|
param: {
|
|
985
985
|
workerId: string;
|