@fossil-lang/wasm 0.3.0-alpha.10 → 0.3.0-alpha.12

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 CHANGED
@@ -19,7 +19,7 @@ JS/TS wrapper around the `fossil-wasm` Rust crate's wasm-bindgen artefacts. Prov
19
19
  import { openProgram } from '@fossil-lang/wasm';
20
20
  import { fossil } from '@fossil-lang/codemirror-fossil';
21
21
 
22
- const program = await openProgram('job.fossil', { host, text }); // host: SourceHost
22
+ const program = await openProgram('job.fossil', { host, text }); // host: Host
23
23
  const extensions = fossil({ ...program, onNavigate });
24
24
 
25
25
  program.registerDescriptor(descriptor); // a host-introspected source, before a check
@@ -40,11 +40,15 @@ question this surface does not ask, and `close()` frees it.
40
40
 
41
41
  A program names shape documents (`io.shex("@vocab/person.shex")`) and data
42
42
  sources (`io.csv("@lake/users.csv")`). The checker reads no file and no
43
- network: it reports what it is missing, and the host hands back text through a
44
- `SourceHost` (`@fossil-lang/types`) — the connection map, and `sign(locators)`.
43
+ network: it reports what it is missing, and `resolveDocuments`
44
+ (`@fossil-lang/storage`) reads it under the credentials the `Host`
45
+ (`@fossil-lang/types`) vends — `connections()` and `credentials(scope, access)`.
46
+ A document under a connection is read by a GET signed with that connection's
47
+ `read` credential; one with no connection only when it is a public `http(s)` URL.
48
+ A host that already holds a document's text calls `registerDocument` itself.
45
49
 
46
50
  ```typescript
47
- import { resolveDocuments } from '@fossil-lang/types';
51
+ import { resolveDocuments } from '@fossil-lang/storage';
48
52
 
49
53
  const pg = new FossilPlayground();
50
54
  const h = pg.openFile('prog.fossil', text); // edited buffers only
@@ -52,9 +56,9 @@ const { unread } = await resolveDocuments(pg.workspace(h), host); // sets the co
52
56
  const rows = pg.check();
53
57
  ```
54
58
 
55
- - `missingDocuments(h)` — `{ key, locator }` rows. The key is what the program
56
- wrote, so repointing a connection invalidates nothing; the locator is that
57
- key through the map, and it is what `sign` receives.
59
+ - `missingDocuments(h)` — `{ key, locator, connection? }` rows. The key is what
60
+ the program wrote, so repointing a connection invalidates nothing; the locator
61
+ is that key through the map, and `connection` is the one it goes through.
58
62
  - `registerDocument(key, text)` — what `resolveDocuments` calls for each
59
63
  fetched document, until nothing new is missing (a document can name another).
60
64
  It is the one loop; a host does not write a second.
@@ -64,7 +68,7 @@ const rows = pg.check();
64
68
  calls it with `host.connections()`, so a host never does.
65
69
  - `sources(h)` — the `ProgramSource[]` the program reads, through the map the
66
70
  last `resolveDocuments` set: binding, key,
67
- locator, catalogue row, reader option. Introspection DESCRIBEs these and
71
+ locator, connection, catalogue row, reader option. Introspection DESCRIBEs these and
68
72
  registers each descriptor under `key` with `registerInferredDescriptor`.
69
73
 
70
74
  ## Loading: the `.wasm` is an asset of this package
package/dist/client.d.ts CHANGED
@@ -131,7 +131,7 @@ export declare class FossilPlayground {
131
131
  closeFile(handle: FileHandle): void;
132
132
  /**
133
133
  * The connection map `@name/…` expands against — what
134
- * `SourceHost.connections()` answers. It reaches locators only, so setting it
134
+ * `Host.connections()` answers. It reaches locators only, so setting it
135
135
  * re-checks nothing.
136
136
  */
137
137
  setConnections(connections: Record<string, string>): void;
package/dist/client.js CHANGED
@@ -147,7 +147,7 @@ export class FossilPlayground {
147
147
  }
148
148
  /**
149
149
  * The connection map `@name/…` expands against — what
150
- * `SourceHost.connections()` answers. It reaches locators only, so setting it
150
+ * `Host.connections()` answers. It reaches locators only, so setting it
151
151
  * re-checks nothing.
152
152
  */
153
153
  setConnections(connections) {
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * `check`, the three position queries (`hover`, `completions`,
15
15
  * `gotoDefinition`) an editor draws its IDE surface from, and the documents
16
16
  * and sources a program reads (`missingDocuments`, `registerDocument`,
17
- * `sources`) that a host resolves through its `SourceHost`.
17
+ * `sources`) that a host resolves through its `Host`.
18
18
  *
19
19
  * Consumer pattern (wasm-bindgen --target web):
20
20
  *
@@ -160,5 +160,5 @@ export interface InferredDescriptorJson {
160
160
  */
161
161
  freshness_token: string;
162
162
  }
163
- export type { TokenRow, SemanticTokensLegend, SourceHost, MissingDocument, UnreadDocument, DocumentWorkspace, ProgramSource, } from '@fossil-lang/types';
163
+ export type { TokenRow, SemanticTokensLegend, Host, MissingDocument, UnreadDocument, DocumentWorkspace, ProgramSource, } from '@fossil-lang/types';
164
164
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAQH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,IAAI,EACJ,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEtE;;;;4EAI4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;CACzB;AAED;;oEAEoE;AACpE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,QAAQ,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,C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Q,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED;;;;;;;;;;;;;;aAca;AACb,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;gCAMgC;AAChC,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,QAAQ,CAAC;CACjB;AAYD;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GACzB,QAAQ,GACR,SAAS,GACT,OAAO,GACP,MAAM,GACN,MAAM,GACN,WAAW,GACX,MAAM,GACN,QAAQ,GACR,SAAS,CAAC;AAEd,kDAAkD;AAClD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,iBAAiB,CAAC;CAC9B;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAKD,YAAY,EACV,QAAQ,EACR,oBAAoB,EACpB,IAAI,EACJ,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
  * `check`, the three position queries (`hover`, `completions`,
15
15
  * `gotoDefinition`) an editor draws its IDE surface from, and the documents
16
16
  * and sources a program reads (`missingDocuments`, `registerDocument`,
17
- * `sources`) that a host resolves through its `SourceHost`.
17
+ * `sources`) that a host resolves through its `Host`.
18
18
  *
19
19
  * Consumer pattern (wasm-bindgen --target web):
20
20
  *
package/dist/program.d.ts CHANGED
@@ -1,48 +1,13 @@
1
- /**
2
- * One program, open in a workspace, answering an editor — what every host of the checker wrote by
3
- * hand before this existed.
4
- *
5
- * `FossilPlayground` is the workspace and it is right that it stays general: it holds any number
6
- * of files and answers about each. What a host with ONE program in ONE editor needs on top of it
7
- * is always the same protocol, and two copies of it had already diverged in their comments:
8
- *
9
- * 1. **Push before you ask.** Four callers at four rates — the debounced linter, hover on pointer
10
- * rest, completion on nearly every keystroke, goto-def on a key — share one workspace, and all
11
- * four answer about the text of the last `updateFile`. So every entry point takes the text and
12
- * pushes it first, and a string comparison against what was last pushed makes that free in the
13
- * common case. `updateFile` is the one call that bumps the Salsa revision; calling it per
14
- * mouse-move would invalidate the memoised check the squiggles came from for nothing.
15
- * 2. **Read what the program names before you check it.** The compiler performs no IO. An edit
16
- * can name a shape document the workspace has not read, so a check first runs
17
- * `resolveDocuments` over the host's {@link SourceHost} — which reads nothing when nothing is
18
- * missing.
19
- *
20
- * The result is shaped for `@fossil-lang/codemirror-fossil`'s `fossil()`: `tokenize`,
21
- * `tokenKinds`, `uri`, `check`, `hover`, `complete` and `definition` are exactly its option
22
- * names, so a host spreads it and adds what is its own to decide:
23
- *
24
- * ```ts
25
- * const program = await openProgram('job.fossil', { host, text });
26
- * const extensions = fossil({ ...program, onNavigate });
27
- * ```
28
- *
29
- * One workspace rather than one per rate, for the reason `fossil()`'s own header gives: a second
30
- * workspace for the position queries would answer from a different revision than the squiggles on
31
- * screen. The position methods take a SHARED borrow on the Rust side, so they nest inside a live
32
- * check rather than poisoning it.
33
- */
34
- import { type ProgramSource, type SourceHost } from '@fossil-lang/types';
1
+ import type { Host, ProgramSource } from '@fossil-lang/types';
35
2
  import { FossilPlayground, tokenize, tokenKinds } from './client.js';
36
3
  import type { CheckRow, CompletionRow, DefinitionRow, HoverRow, InferredDescriptorJson } from './index.js';
37
4
  import { type InitInput } from './load.js';
38
5
  /** What {@link openProgram} takes beside the key. */
39
6
  export interface OpenProgramOptions {
40
- /** The host's one capability: the connection map, and signing what the program names. */
41
- host: SourceHost;
7
+ /** The connection map, and the credentials a document the program names is read with. */
8
+ host: Host;
42
9
  /** The buffer's text at open. Defaults to empty; every entry point takes the text anyway. */
43
10
  text?: string;
44
- /** How a signed document is read. Defaults to the global `fetch`. */
45
- fetch?: typeof fetch;
46
11
  /** The module's `.wasm`, for a host with no bundler — see {@link initFossilWasm}. */
47
12
  wasm?: InitInput;
48
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAoB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,aAAa,EACb,QAAQ,EACR,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3D,qDAAqD;AACrD,MAAM,WAAW,kBAAkB;IACjC,yFAAyF;IACzF,IAAI,EAAE,UAAU,CAAC;IACjB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,qFAAqF;IACrF,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,2FAA2F;IAC3F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,mGAAmG;IACnG,QAAQ,CAAC,QAAQ,EAAE,OAAO,QAAQ,CAAC;IACnC,uCAAuC;IACvC,QAAQ,CAAC,UAAU,EAAE,OAAO,UAAU,CAAC;IACvC;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzC,0FAA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@@
14
14
  * mouse-move would invalidate the memoised check the squiggles came from for nothing.
15
15
  * 2. **Read what the program names before you check it.** The compiler performs no IO. An edit
16
16
  * can name a shape document the workspace has not read, so a check first runs
17
- * `resolveDocuments` over the host's {@link SourceHost} — which reads nothing when nothing is
17
+ * `resolveDocuments` over the host's {@link Host} — which reads nothing when nothing is
18
18
  * missing.
19
19
  *
20
20
  * The result is shaped for `@fossil-lang/codemirror-fossil`'s `fossil()`: `tokenize`,
@@ -31,7 +31,7 @@
31
31
  * screen. The position methods take a SHARED borrow on the Rust side, so they nest inside a live
32
32
  * check rather than poisoning it.
33
33
  */
34
- import { resolveDocuments } from '@fossil-lang/types';
34
+ import { resolveDocuments } from '@fossil-lang/storage';
35
35
  import { FossilPlayground, tokenize, tokenKinds } from './client.js';
36
36
  import { initFossilWasm } from './load.js';
37
37
  /**
@@ -41,7 +41,7 @@ import { initFossilWasm } from './load.js';
41
41
  * in the same tab costs a workspace and nothing else.
42
42
  */
43
43
  export async function openProgram(uri, options) {
44
- const { host, text = '', fetch: fetchImpl = globalThis.fetch, wasm } = options;
44
+ const { host, text = '', wasm } = options;
45
45
  await initFossilWasm(wasm);
46
46
  const workspace = new FossilPlayground();
47
47
  const handle = workspace.openFile(uri, text);
@@ -54,7 +54,7 @@ export async function openProgram(uri, options) {
54
54
  };
55
55
  const settle = async (next) => {
56
56
  sync(next);
57
- await resolveDocuments(workspace.workspace(handle), host, fetchImpl);
57
+ await resolveDocuments(workspace.workspace(handle), host);
58
58
  };
59
59
  await settle(text);
60
60
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,gBAAgB,EAAuC,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQrE,OAAO,EAAE,cA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E,SAAS,CAAC,CAAC;QAC3D,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,IAAI;YAChB,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;YACnB,OAAO,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QACD,kBAAkB,CAAC,UAAU;YAC3B,SAAS,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;QACnD,CAAC;QACD,SAAS;QACT,KAAK;YACH,SAAS,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fossil-lang/wasm",
3
- "version": "0.3.0-alpha.10",
3
+ "version": "0.3.0-alpha.12",
4
4
  "description": "JS/TS wrapper around the fossil-wasm wasm-bindgen artifacts (--target web). Exposes initFossilWasm + tokenize + semanticLegend + FossilPlayground class for downstream @fossil-lang/* packages.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -33,7 +33,8 @@
33
33
  ],
34
34
  "sideEffects": false,
35
35
  "dependencies": {
36
- "@fossil-lang/types": "0.3.0-alpha.10"
36
+ "@fossil-lang/storage": "0.3.0-alpha.12",
37
+ "@fossil-lang/types": "0.3.0-alpha.12"
37
38
  },
38
39
  "devDependencies": {
39
40
  "typescript": "^5.6.0",
@@ -221,7 +221,7 @@ export class FossilPlayground {
221
221
  registerInferredDescriptor(descriptor_json: string): void;
222
222
  /**
223
223
  * Replace the connection map `@name/…` expands against, as
224
- * `SourceHost.connections()` answers it.
224
+ * `Host.connections()` answers it.
225
225
  *
226
226
  * # Errors
227
227
  *
@@ -344,7 +344,7 @@ export class FossilPlayground {
344
344
  }
345
345
  /**
346
346
  * Replace the connection map `@name/…` expands against, as
347
- * `SourceHost.connections()` answers it.
347
+ * `Host.connections()` answers it.
348
348
  *
349
349
  * # Errors
350
350
  *
Binary file