@intentic/extension-api 1.225.0 → 1.226.1
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/README.md +10 -1
- package/dist/api.d.ts +1 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/background.d.ts.map +1 -1
- package/dist/background.js +32 -1
- package/dist/background.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
- package/src/api.ts +20 -0
- package/src/background.ts +73 -5
- package/src/surface.json +78 -0
- package/src/version.ts +9 -1
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ need `sandboxRef` directly for one:
|
|
|
110
110
|
```ts
|
|
111
111
|
const { state: unseen, start } = sandboxPoll<readonly Finding[]>({
|
|
112
112
|
host, // your hostSlot's accessor — nothing is bound until activate()
|
|
113
|
-
everyMs: 60_000,
|
|
113
|
+
everyMs: 10 * 60_000, // a backstop here: the file binding below is what actually refreshes this
|
|
114
114
|
initial: () => [],
|
|
115
115
|
read: async (api) => findings(await api.sandbox.fetch(query())),
|
|
116
116
|
});
|
|
@@ -123,6 +123,15 @@ failure, stop the clock on disposal, are the poll's, not yours. Pass `immediate:
|
|
|
123
123
|
worth asking until something else tells you what to ask about, and read `previous` in `read` if a round
|
|
124
124
|
accumulates onto what you already hold rather than replacing it.
|
|
125
125
|
|
|
126
|
+
**If the answer lives in a file, the write is the feed and the interval is only a backstop.** `start()`
|
|
127
|
+
subscribes to your own `contributes.files` paths being written (`api.workspace.onDidChangeFiles`), so a
|
|
128
|
+
declaration you already made is what moves the tile, within a frame of the file changing rather than at the next
|
|
129
|
+
tick. Nothing to opt into: declare the paths your views derive from and the badge over them reacts; declare none
|
|
130
|
+
and the poll is the timer it always was. Bursts coalesce, so a run writing a file per story costs one read, and a
|
|
131
|
+
reconnect wakes it too, because a frame pushed while the stream was down is a frame nobody resends. Pick
|
|
132
|
+
`everyMs` accordingly: minutes for a file-backed badge (it is covering a dropped event, not carrying the news),
|
|
133
|
+
and the honest cadence of the source for anything behind somebody else's API, where nothing can push at all.
|
|
134
|
+
|
|
126
135
|
What the tile SAYS stays yours: `badge()` is the judgement each surface exists to make, and no two of them
|
|
127
136
|
agree about tone or wording.
|
|
128
137
|
|
package/dist/api.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ export interface IntenticApi {
|
|
|
102
102
|
capabilities(): readonly CapabilityFacts[];
|
|
103
103
|
onDidChange(listener: () => void): Disposable;
|
|
104
104
|
onDidChangeRefs(listener: (repos: readonly string[]) => void): Disposable;
|
|
105
|
+
onDidChangeFiles(listener: (paths: readonly string[]) => void): Disposable;
|
|
105
106
|
openDiff(payload: DiffPayload): void;
|
|
106
107
|
fillDiff(payload: DiffPayload): void;
|
|
107
108
|
file(path: string): Promise<string | undefined>;
|
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,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,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,MAA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IAAI,OAAO,GAAG,MAAM,CAAC;QACzB,WAAW,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,GAAG,UAAU,CAAC;KACvE,CAAC;CACL;AAED,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,aAAa,EAAE,UAAU,EAAE,CAAC;CACxC;AAID,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC"}
|
package/dist/background.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../src/background.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../src/background.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAsCxD,MAAM,WAAW,WAAW,CAAC,CAAC;IAI1B,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAQvB,KAAK,IAAI,UAAU,CAAC;IAGpB,OAAO,IAAI,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC;IAGjC,QAAQ,CAAC,IAAI,EAAE,MAAM,WAAW,CAAC;IAQjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAK1B,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAI7D,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,IAAI,CAAC;CAC5C;AAyCD,eAAO,MAAM,WAAW,GAAI,CAAC,WAAW,kBAAkB,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAsC5E,CAAC;AA0BF,MAAM,WAAW,aAAa;IAE1B,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAIlD,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAKlE,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE;AAKD,eAAO,MAAM,aAAa,SAAU,MAAM,WAAW,QAAQ,MAAM,KAAG,aAgCrE,CAAC"}
|
package/dist/background.js
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
import { sandboxRef, sandboxScopeGuard } from "./scope.js";
|
|
2
|
+
const WAKE_MS = 400;
|
|
3
|
+
const wakeOnFiles = (host, read) => {
|
|
4
|
+
let pending;
|
|
5
|
+
let subscription;
|
|
6
|
+
try {
|
|
7
|
+
subscription = host().workspace.onDidChangeFiles(() => {
|
|
8
|
+
pending ??= setTimeout(() => {
|
|
9
|
+
pending = undefined;
|
|
10
|
+
read();
|
|
11
|
+
}, WAKE_MS);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
subscription = undefined;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
dispose: () => {
|
|
19
|
+
if (pending !== undefined) {
|
|
20
|
+
clearTimeout(pending);
|
|
21
|
+
pending = undefined;
|
|
22
|
+
}
|
|
23
|
+
subscription?.dispose();
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
};
|
|
2
27
|
export const sandboxPoll = (options) => {
|
|
3
28
|
const state = sandboxRef(options.initial, options.dispose);
|
|
4
29
|
const once = async () => {
|
|
@@ -25,7 +50,13 @@ export const sandboxPoll = (options) => {
|
|
|
25
50
|
void once();
|
|
26
51
|
}
|
|
27
52
|
const timer = setInterval(() => void once(), options.everyMs);
|
|
28
|
-
|
|
53
|
+
const wake = wakeOnFiles(options.host, () => void once());
|
|
54
|
+
return {
|
|
55
|
+
dispose: () => {
|
|
56
|
+
clearInterval(timer);
|
|
57
|
+
wake.dispose();
|
|
58
|
+
},
|
|
59
|
+
};
|
|
29
60
|
},
|
|
30
61
|
};
|
|
31
62
|
};
|
package/dist/background.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background.js","sourceRoot":"","sources":["../src/background.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"background.js","sourceRoot":"","sources":["../src/background.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAyF3D,MAAM,OAAO,GAAG,GAAG,CAAC;AAQpB,MAAM,WAAW,GAAG,CAAC,IAAuB,EAAE,IAAgB,EAAc,EAAE;IAC1E,IAAI,OAAkD,CAAC;IACvD,IAAI,YAAoC,CAAC;IACzC,IAAI,CAAC;QACD,YAAY,GAAG,IAAI,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE;YAClD,OAAO,KAAK,UAAU,CA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AC,CAAC;IAMF,MAAM,MAAM,GAAG,KAAK,EAAE,IAAkF,EAAoB,EAAE;QAC1H,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,MAAM,IAAI,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAE1B,IAAI,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;YACb,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAChF,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO;QACH,IAAI;QACJ,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QACpE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;KACpD,CAAC;AACN,CAAC,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const extensionApiVersion = "2.
|
|
1
|
+
export declare const extensionApiVersion = "2.10.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAqEA,eAAO,MAAM,mBAAmB,WAAW,CAAC"}
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const extensionApiVersion = "2.
|
|
1
|
+
export const extensionApiVersion = "2.10.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAqEA,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/extension-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.226.1",
|
|
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",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@orpc/contract": "1.14.13",
|
|
46
46
|
"tslib": "2.8.1",
|
|
47
|
-
"@intentic/sandbox-contract": "1.
|
|
47
|
+
"@intentic/sandbox-contract": "1.226.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"vue": "3"
|
package/src/api.ts
CHANGED
|
@@ -347,6 +347,26 @@ export interface IntenticApi {
|
|
|
347
347
|
* as the last thing the user clicked. `repos` are root-relative ids ("root" is the workspace repo itself).
|
|
348
348
|
*/
|
|
349
349
|
onDidChangeRefs(listener: (repos: readonly string[]) => void): Disposable;
|
|
350
|
+
/* ONE OF YOUR OWN `contributes.files` PATHS WAS WRITTEN, scoped to that declaration: the listener is
|
|
351
|
+
* registered with your manifest's prefixes, so it never fires for a write you did not claim and you never
|
|
352
|
+
* write the prefix matching yourself. `paths` are the matching ones, workspace-root-relative.
|
|
353
|
+
*
|
|
354
|
+
* The declaration already made the daemon's push evict the query keys it names, and for anything the
|
|
355
|
+
* user is LOOKING at that is the whole story. It is not the story for what an extension does while none
|
|
356
|
+
* of it is on screen: an eviction only reaches a query something is observing, and a rail badge is by
|
|
357
|
+
* definition read with nothing mounted, so the tile went on saying whatever it last said until its own
|
|
358
|
+
* timer came round. Every badge in the workspace was therefore as fresh as its interval, up to ten
|
|
359
|
+
* minutes for the slowest, and a queue the owner had just emptied kept claiming its old count.
|
|
360
|
+
*
|
|
361
|
+
* You are unlikely to need this directly: `sandboxPoll` already wakes on it (background.ts), which is
|
|
362
|
+
* what turns a declared file binding into a badge that moves with the write. Reach for it when you keep
|
|
363
|
+
* background state some other way.
|
|
364
|
+
*
|
|
365
|
+
* FIRES WITH YOUR WHOLE DECLARATION when the host cannot say what moved: past a few hundred paths the
|
|
366
|
+
* daemon stops listing them, and a reconnected stream may have missed frames outright. Both are "assume
|
|
367
|
+
* yours changed", which is the safe direction for a badge, one re-read against a badge that is silently
|
|
368
|
+
* wrong for as long as the connection was away. */
|
|
369
|
+
onDidChangeFiles(listener: (paths: readonly string[]) => void): Disposable;
|
|
350
370
|
/* OPEN A DIFF IN THE EDITOR AREA, the host's tab strip, beside the files the diff is about.
|
|
351
371
|
*
|
|
352
372
|
* The shell owns the strip, the viewer, the close orchestration and the edit-buffer bookkeeping; the
|
package/src/background.ts
CHANGED
|
@@ -6,8 +6,21 @@ import { sandboxRef, sandboxScopeGuard } from "./scope.js";
|
|
|
6
6
|
* turned out to need, and had been writing out by hand.
|
|
7
7
|
*
|
|
8
8
|
* A tile has to be able to say something before it is opened. That rules out the view's own query, which stops
|
|
9
|
-
* when the component unmounts, and it rules out the file-change push
|
|
10
|
-
* observing. So the state lives at module scope (scope.ts) and
|
|
9
|
+
* when the component unmounts, and it rules out the file-change push AS AN INVALIDATION, because evicting a
|
|
10
|
+
* cache entry only reaches a query something is observing. So the state lives at module scope (scope.ts) and
|
|
11
|
+
* something refreshes it.
|
|
12
|
+
*
|
|
13
|
+
* THAT SOMETHING IS THE WRITE ITSELF WHEREVER THE ANSWER LIVES IN A FILE, and the timer is the backstop. The
|
|
14
|
+
* push was already arriving and already naming this extension's paths, it was simply spent entirely on the cache
|
|
15
|
+
* (`api.workspace.onDidChangeFiles`), so every badge in the workspace was as fresh as its own interval and no
|
|
16
|
+
* fresher: a drafts queue the owner had just emptied went on claiming six items for a minute, and the slowest
|
|
17
|
+
* tile here is ten minutes behind the file it describes. A count that is wrong for minutes at a time is worse
|
|
18
|
+
* than no count, because the owner learns to distrust the one they cannot check without clicking.
|
|
19
|
+
*
|
|
20
|
+
* What the interval is still FOR, and why it did not simply go away: a source that is not a file at all (a CI
|
|
21
|
+
* provider, a Komodo deployment) has nothing to push, so for those it remains the only feed; and for the rest it
|
|
22
|
+
* covers the gap no push can close, a watcher that dropped an event, an exclusion nobody noticed. Where a file
|
|
23
|
+
* binding carries the news, `everyMs` is honestly a slow safety net and the extensions here say so.
|
|
11
24
|
*
|
|
12
25
|
* Seven modules across six extensions arrived at the identical shape for that timer, and it carries five rules
|
|
13
26
|
* that are each invisible until they are broken:
|
|
@@ -29,7 +42,13 @@ export interface SandboxPoll<T> {
|
|
|
29
42
|
* own computed repaints when it moves; write to it directly for the local fold a "mark as seen" does, which
|
|
30
43
|
* is what clears a tile on the spot instead of at the next tick. */
|
|
31
44
|
readonly state: Ref<T>;
|
|
32
|
-
|
|
45
|
+
/* Begin reading: on the extension's own `contributes.files` being written, and on the interval. Push the
|
|
46
|
+
* Disposable onto `context.subscriptions` and both stop with the extension.
|
|
47
|
+
*
|
|
48
|
+
* The file wake needs nothing declared here. An extension that named the paths its views derive from has
|
|
49
|
+
* already said which writes change this answer, so subscribing is unconditional and an extension that
|
|
50
|
+
* declared none is simply never woken.
|
|
51
|
+
*/
|
|
33
52
|
start(): Disposable;
|
|
34
53
|
// Read now, off-cycle, for the moments that change the answer and should not wait out the interval: a
|
|
35
54
|
// connection appearing, a draft published, a run discarded.
|
|
@@ -42,7 +61,11 @@ export interface SandboxPollOptions<T> {
|
|
|
42
61
|
readonly host: () => IntenticApi;
|
|
43
62
|
/* How often, in milliseconds. There is no default on purpose: the right interval is a claim about how fast
|
|
44
63
|
* the answer actually changes, and a surface that has not thought about it will inherit whatever number
|
|
45
|
-
* happened to be chosen here. A badge is glanced at, so the honest range is minutes, not seconds.
|
|
64
|
+
* happened to be chosen here. A badge is glanced at, so the honest range is minutes, not seconds.
|
|
65
|
+
*
|
|
66
|
+
* Read it against `start()`'s file wake. If the answer lives in a path your manifest declares, the write
|
|
67
|
+
* already refreshes this and the interval is a BACKSTOP for the frame nobody delivered, so the honest number
|
|
68
|
+
* there is slow. If it lives behind somebody else's API, nothing pushes and this is the only feed. */
|
|
46
69
|
readonly everyMs: number;
|
|
47
70
|
// The value before anything has been read, rebuilt on every sandbox switch (sandboxRef).
|
|
48
71
|
readonly initial: () => T;
|
|
@@ -59,6 +82,45 @@ export interface SandboxPollOptions<T> {
|
|
|
59
82
|
readonly dispose?: (previous: T) => void;
|
|
60
83
|
}
|
|
61
84
|
|
|
85
|
+
/* HOW LONG A BURST OF WRITES IS ALLOWED TO COALESCE before the wake reads. The daemon already batches its
|
|
86
|
+
* watcher at 250ms, but one logical event is often several batches, an acceptance run writing a result file per
|
|
87
|
+
* story, a publish rewriting a staging tree, so without this the widest scan in the workspace would be re-run
|
|
88
|
+
* per frame. Trailing rather than leading: the last write in a burst is the one whose answer is true.
|
|
89
|
+
*
|
|
90
|
+
* Short enough that the badge still moves while the owner is looking at the screen that caused the write, which
|
|
91
|
+
* is the entire point of not waiting for the interval. */
|
|
92
|
+
const WAKE_MS = 400;
|
|
93
|
+
|
|
94
|
+
/* Re-read when the extension's own declared files are written.
|
|
95
|
+
*
|
|
96
|
+
* Contained in a try/catch because BOTH of its failure modes are ordinary rather than exceptional: `host()`
|
|
97
|
+
* throws until activate() has bound a handle, and an older host has no `onDidChangeFiles` at all (this arrived in
|
|
98
|
+
* api 2.10.0, and an extension may declare `engines.intentic` wider than that). Either way the poll falls back to
|
|
99
|
+
* exactly the timer it had before, which is a slower badge and never a broken one. */
|
|
100
|
+
const wakeOnFiles = (host: () => IntenticApi, read: () => void): Disposable => {
|
|
101
|
+
let pending: ReturnType<typeof setTimeout> | undefined;
|
|
102
|
+
let subscription: Disposable | undefined;
|
|
103
|
+
try {
|
|
104
|
+
subscription = host().workspace.onDidChangeFiles(() => {
|
|
105
|
+
pending ??= setTimeout(() => {
|
|
106
|
+
pending = undefined;
|
|
107
|
+
read();
|
|
108
|
+
}, WAKE_MS);
|
|
109
|
+
});
|
|
110
|
+
} catch {
|
|
111
|
+
subscription = undefined;
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
dispose: (): void => {
|
|
115
|
+
if (pending !== undefined) {
|
|
116
|
+
clearTimeout(pending);
|
|
117
|
+
pending = undefined;
|
|
118
|
+
}
|
|
119
|
+
subscription?.dispose();
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
|
|
62
124
|
export const sandboxPoll = <T>(options: SandboxPollOptions<T>): SandboxPoll<T> => {
|
|
63
125
|
const state = sandboxRef(options.initial, options.dispose);
|
|
64
126
|
|
|
@@ -88,7 +150,13 @@ export const sandboxPoll = <T>(options: SandboxPollOptions<T>): SandboxPoll<T> =
|
|
|
88
150
|
void once();
|
|
89
151
|
}
|
|
90
152
|
const timer = setInterval(() => void once(), options.everyMs);
|
|
91
|
-
|
|
153
|
+
const wake = wakeOnFiles(options.host, () => void once());
|
|
154
|
+
return {
|
|
155
|
+
dispose: () => {
|
|
156
|
+
clearInterval(timer);
|
|
157
|
+
wake.dispose();
|
|
158
|
+
},
|
|
159
|
+
};
|
|
92
160
|
},
|
|
93
161
|
};
|
|
94
162
|
};
|
package/src/surface.json
CHANGED
|
@@ -533,5 +533,83 @@
|
|
|
533
533
|
"sandboxValue",
|
|
534
534
|
"satisfiesEngines"
|
|
535
535
|
]
|
|
536
|
+
},
|
|
537
|
+
"2.10.0": {
|
|
538
|
+
"manifest": [
|
|
539
|
+
"$schema",
|
|
540
|
+
"art",
|
|
541
|
+
"category",
|
|
542
|
+
"contributes",
|
|
543
|
+
"engines",
|
|
544
|
+
"entry",
|
|
545
|
+
"icon",
|
|
546
|
+
"logo",
|
|
547
|
+
"name",
|
|
548
|
+
"permissions",
|
|
549
|
+
"publisher",
|
|
550
|
+
"server",
|
|
551
|
+
"version"
|
|
552
|
+
],
|
|
553
|
+
"contributes": [
|
|
554
|
+
"agent",
|
|
555
|
+
"automationTemplates",
|
|
556
|
+
"bin",
|
|
557
|
+
"capabilities",
|
|
558
|
+
"commands",
|
|
559
|
+
"documents",
|
|
560
|
+
"environment",
|
|
561
|
+
"files",
|
|
562
|
+
"listener",
|
|
563
|
+
"processes",
|
|
564
|
+
"settings",
|
|
565
|
+
"viewers",
|
|
566
|
+
"views"
|
|
567
|
+
],
|
|
568
|
+
"api": [
|
|
569
|
+
"apiVersion",
|
|
570
|
+
"chat",
|
|
571
|
+
"commands",
|
|
572
|
+
"documents",
|
|
573
|
+
"href",
|
|
574
|
+
"models",
|
|
575
|
+
"navigate",
|
|
576
|
+
"processes",
|
|
577
|
+
"route",
|
|
578
|
+
"sandbox",
|
|
579
|
+
"settings",
|
|
580
|
+
"terminal",
|
|
581
|
+
"theme",
|
|
582
|
+
"viewers",
|
|
583
|
+
"views",
|
|
584
|
+
"workspace"
|
|
585
|
+
],
|
|
586
|
+
"listener": ["automation", "events", "provider"],
|
|
587
|
+
"sandboxApi": ["fetch", "json", "key", "origin", "reachable", "request", "role", "rpc"],
|
|
588
|
+
"moduleExports": [
|
|
589
|
+
"extensionApiVersion",
|
|
590
|
+
"flattenQuery",
|
|
591
|
+
"hostSlot",
|
|
592
|
+
"mergeQuery",
|
|
593
|
+
"readDaemonStream",
|
|
594
|
+
"resetSandboxScope",
|
|
595
|
+
"sandboxLedger",
|
|
596
|
+
"sandboxPoll",
|
|
597
|
+
"sandboxRef",
|
|
598
|
+
"sandboxScopeGuard",
|
|
599
|
+
"sandboxValue",
|
|
600
|
+
"satisfiesEngines"
|
|
601
|
+
],
|
|
602
|
+
"workspaceApi": [
|
|
603
|
+
"capabilities",
|
|
604
|
+
"file",
|
|
605
|
+
"fillDiff",
|
|
606
|
+
"onDidChange",
|
|
607
|
+
"onDidChangeFiles",
|
|
608
|
+
"onDidChangeRefs",
|
|
609
|
+
"openDiff",
|
|
610
|
+
"readJson",
|
|
611
|
+
"repos",
|
|
612
|
+
"write"
|
|
613
|
+
]
|
|
536
614
|
}
|
|
537
615
|
}
|
package/src/version.ts
CHANGED
|
@@ -59,4 +59,12 @@
|
|
|
59
59
|
// moving the tab the reader is in instead of opening a second one. Six views across three packs had each drawn
|
|
60
60
|
// a place that way, so the fix has to be reachable from the API rather than repeated per pack. Additive:
|
|
61
61
|
// `navigate` is unchanged, and it is still what a plain click calls.
|
|
62
|
-
|
|
62
|
+
// 2.10.0 adds `api.workspace.onDidChangeFiles`: the extension's own `contributes.files` being written, as an
|
|
63
|
+
// EVENT rather than only as a cache eviction, and `sandboxPoll` wakes on it. The declaration already reached the
|
|
64
|
+
// host and the host already invalidated the query keys it named, but an eviction only reaches a query something
|
|
65
|
+
// is observing, and a rail badge is read with nothing mounted by definition. So every tile in the workspace was
|
|
66
|
+
// exactly as fresh as its own interval: a drafts queue the owner had just emptied kept claiming six items, and
|
|
67
|
+
// the slowest tile sat ten minutes behind the file it described. Additive, and the recorded surface grew a
|
|
68
|
+
// `workspaceApi` member list with this release, the same grain `sandboxApi` got at 2.3.0 and for the same
|
|
69
|
+
// reason: this is where the addition happened, and nothing could see it.
|
|
70
|
+
export const extensionApiVersion = "2.10.0";
|