@intentic/extension-api 1.169.0 → 1.171.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts CHANGED
@@ -11,7 +11,8 @@ export interface Activation {
11
11
  readonly props?: Record<string, unknown> | undefined;
12
12
  }
13
13
  export interface ViewBadge {
14
- readonly count: number;
14
+ readonly count?: number | undefined;
15
+ readonly mark?: string | undefined;
15
16
  readonly tone?: "info" | "warning" | "danger" | undefined;
16
17
  readonly tooltip?: string | undefined;
17
18
  }
@@ -78,6 +79,12 @@ export interface IntenticApi {
78
79
  openSession(sessionId: string): void;
79
80
  };
80
81
  readonly navigate: (path: string) => void;
82
+ readonly route: {
83
+ query(): Readonly<Record<string, string>>;
84
+ setQuery(patch: Readonly<Record<string, string | undefined>>, options?: {
85
+ readonly push?: boolean;
86
+ }): void;
87
+ };
81
88
  readonly theme: {
82
89
  mode(): "light" | "dark";
83
90
  onDidChange(listener: (mode: "light" | "dark") => void): Disposable;
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM7D,MAAM,WAAW,UAAU;IACvB,OAAO,IAAI,IAAI,CAAC;CACnB;AAKD,MAAM,WAAW,UAAU;IAEvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAGnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,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GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./api.js";
2
2
  export * from "./facts.js";
3
3
  export * from "./manifest.js";
4
4
  export * from "./permissions.js";
5
+ export * from "./route.js";
5
6
  export * from "./stream.js";
6
7
  export * from "./version.js";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export * from "./api.js";
2
2
  export * from "./facts.js";
3
3
  export * from "./manifest.js";
4
4
  export * from "./permissions.js";
5
+ export * from "./route.js";
5
6
  export * from "./stream.js";
6
7
  export * from "./version.js";
7
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type RawQuery = Readonly<Record<string, string | readonly (string | null)[] | null | undefined>>;
2
+ export declare const flattenQuery: (query: RawQuery) => Record<string, string>;
3
+ export declare const mergeQuery: (current: RawQuery, patch: Readonly<Record<string, string | undefined>>) => Record<string, string>;
4
+ //# sourceMappingURL=route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC;AAMxG,eAAO,MAAM,YAAY,UAAW,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAWnE,CAAC;AAMF,eAAO,MAAM,UAAU,YAAa,QAAQ,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAUxH,CAAC"}
package/dist/route.js ADDED
@@ -0,0 +1,26 @@
1
+ export const flattenQuery = (query) => {
2
+ const out = {};
3
+ for (const [key, value] of Object.entries(query)) {
4
+ if (Array.isArray(value)) {
5
+ const first = value[0];
6
+ out[key] = typeof first === `string` ? first : ``;
7
+ }
8
+ else {
9
+ out[key] = typeof value === `string` ? value : ``;
10
+ }
11
+ }
12
+ return out;
13
+ };
14
+ export const mergeQuery = (current, patch) => {
15
+ const next = flattenQuery(current);
16
+ for (const [key, value] of Object.entries(patch)) {
17
+ if (value === undefined) {
18
+ delete next[key];
19
+ }
20
+ else {
21
+ next[key] = value;
22
+ }
23
+ }
24
+ return next;
25
+ };
26
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.js","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAe,EAA0B,EAAE;IACpE,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,CAAC;aAAM,CAAC;YACJ,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAiB,EAAE,KAAmD,EAA0B,EAAE;IACzH,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentic/extension-api",
3
- "version": "1.169.0",
3
+ "version": "1.171.0",
4
4
  "description": "The versioned public API intentic extensions compile against — manifest schema, detection facts and the host API",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/api.ts CHANGED
@@ -31,13 +31,21 @@ export interface Activation {
31
31
  // themselves to: it must mean "something happened here that you don't already know about", never "here is a
32
32
  // statistic". A count that is lit most of the day teaches the user to stop seeing the rail.
33
33
  export interface ViewBadge {
34
- // Omitted or 0 ⇒ no badge. The host renders anything above 99 as "99+".
35
- readonly count: number;
34
+ // How many, for work whose SIZE is what the user acts on — two files to review and two hundred are
35
+ // different afternoons. Omitted or 0 ⇒ no number. The host renders anything above 99 as "99+".
36
+ readonly count?: number | undefined;
37
+ // A glyph from the host's icon set, rendered INSTEAD of a number, for a pending action whose size changes
38
+ // nothing about what the user does with it: one click either way. "There is committed work here waiting to
39
+ // be sent" is the whole message, and a number beside it would be read in the unit `count` established —
40
+ // so the amount goes in the tooltip and the glyph carries the kind. A badge with neither renders nothing.
41
+ readonly mark?: string | undefined;
36
42
  // `info` is the resting tone every core count uses (unread agents, uncommitted changes, live terminals);
37
43
  // `warning` marks a risk the user is carrying (an exposed port); `danger` means something is BROKEN.
38
44
  // Reach for danger sparingly — its whole value is that it is rare enough to still mean something.
39
45
  readonly tone?: "info" | "warning" | "danger" | undefined;
40
- // Hover text. Say what happened and how much, not just the number the user can already see.
46
+ // Say what happened and how much, not just the number the user can already see. The host renders it
47
+ // AFTER the view's own name — "Agents · 3 need you" on the rail, the chip's text in the mobile menu — so
48
+ // phrase it as the continuation of a label, not as a standalone sentence that repeats the view.
41
49
  readonly tooltip?: string | undefined;
42
50
  }
43
51
 
@@ -164,6 +172,24 @@ export interface IntenticApi {
164
172
  };
165
173
  // Navigate the shell to an app path (e.g. "/capabilities", "/ext/<view>/<key>").
166
174
  readonly navigate: (path: string) => void;
175
+ /* THE URL AS A VIEW'S STATE, so what a reader is looking at can be linked to.
176
+ *
177
+ * A view's own route space is the QUERY, not extra path segments: `/ext/:ext/:key?` is the whole route, and
178
+ * the `:key` segment already means "which activation" (one per repo). A view with internal navigation — a
179
+ * document browser, a selected run, an open file — therefore has nowhere in the path to put it, and without
180
+ * this it could only hold that state in memory, where a reload loses it and a link cannot carry it.
181
+ *
182
+ * Reading is reactive: read inside a computed and the view re-renders when the URL moves, which lets a view
183
+ * DERIVE its state from the query rather than mirror it in a ref (mirroring needs two watchers that can fight
184
+ * each other). Back and forward then work for free, because the URL is the state. */
185
+ readonly route: {
186
+ // The current query, flattened — a repeated key takes its first value, since a view's state is scalar.
187
+ query(): Readonly<Record<string, string>>;
188
+ /* Merge a patch in; a key set to `undefined` is removed. Replaces the history entry by default and pushes
189
+ * a new one when asked: a filter or a display toggle should not fill the back stack, while moving to
190
+ * another document is exactly what Back ought to undo. Other views' params are left alone. */
191
+ setQuery(patch: Readonly<Record<string, string | undefined>>, options?: { readonly push?: boolean }): void;
192
+ };
167
193
  readonly theme: {
168
194
  mode(): "light" | "dark";
169
195
  onDidChange(listener: (mode: "light" | "dark") => void): Disposable;
package/src/index.ts CHANGED
@@ -2,5 +2,6 @@ export * from "./api.js";
2
2
  export * from "./facts.js";
3
3
  export * from "./manifest.js";
4
4
  export * from "./permissions.js";
5
+ export * from "./route.js";
5
6
  export * from "./stream.js";
6
7
  export * from "./version.js";
package/src/route.ts ADDED
@@ -0,0 +1,42 @@
1
+ /* The URL-query rules behind `api.route`, as pure functions — the same split `permissions.ts` uses: the host owns
2
+ * the router, this owns the rule, and the rule is testable without one.
3
+ *
4
+ * A view's internal navigation lives in the QUERY because the path is already spoken for: `/ext/:ext/:key?` has
5
+ * exactly one free segment and it means "which activation". So several views can be addressing the same query
6
+ * string at once, and the one rule that matters is that none of them may clobber another's key. */
7
+
8
+ // What the router hands back for a query: vue-router yields `string | null` per key, or an array when a key repeats.
9
+ export type RawQuery = Readonly<Record<string, string | readonly (string | null)[] | null | undefined>>;
10
+
11
+ /* Flatten a router query to the scalar record extensions read. A repeated key takes its FIRST value rather than
12
+ * its last: a view's state is singular, and the first occurrence is the one a hand-written or shared link means.
13
+ * A valueless key (`?draft`) reads as the empty string, which is falsy-ish for the caller to test but never
14
+ * `undefined` — absent and present-but-empty are different answers. */
15
+ export const flattenQuery = (query: RawQuery): Record<string, string> => {
16
+ const out: Record<string, string> = {};
17
+ for (const [key, value] of Object.entries(query)) {
18
+ if (Array.isArray(value)) {
19
+ const first = value[0];
20
+ out[key] = typeof first === `string` ? first : ``;
21
+ } else {
22
+ out[key] = typeof value === `string` ? value : ``;
23
+ }
24
+ }
25
+ return out;
26
+ };
27
+
28
+ /* Merge a patch into the live query. `undefined` REMOVES its key — that is how a view says "I am no longer on a
29
+ * page" without leaving `?doc=` behind, so the tidy URL is the one you get by default rather than one you have to
30
+ * construct. Every key the patch does not mention is carried through untouched, which is the whole invariant:
31
+ * a documentation view setting `doc` must not drop the terminal's or another view's parameters. */
32
+ export const mergeQuery = (current: RawQuery, patch: Readonly<Record<string, string | undefined>>): Record<string, string> => {
33
+ const next = flattenQuery(current);
34
+ for (const [key, value] of Object.entries(patch)) {
35
+ if (value === undefined) {
36
+ delete next[key];
37
+ } else {
38
+ next[key] = value;
39
+ }
40
+ }
41
+ return next;
42
+ };