@langspan/client 0.18.2 → 0.21.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/README.md CHANGED
@@ -5,9 +5,9 @@ protocol](https://github.com/Langspan/LangSpan.dev/blob/main/docs/protocol/READM
5
5
  It sends typed commands to a running LangSpan coordinator and returns typed
6
6
  outcomes. It has no runtime dependencies.
7
7
 
8
- The package isn't published to npm yet. To build it, run `npm ci` and then
9
- `npm pack` in `clients/typescript` of the repository, and install the tarball
10
- that writes.
8
+ Install it from npm with `npm install @langspan/client`. To build it from the
9
+ repository instead, run `npm ci` and then `npm pack` in `clients/typescript`,
10
+ and install the tarball that writes.
11
11
 
12
12
  ```ts
13
13
  import { connect } from "@langspan/client";
@@ -1,4 +1,4 @@
1
- import type { ObservedFile, PathRegions, Policy, PolicyCase, RefusalKind, WaitResult } from "../values.ts";
1
+ import type { HeldRename, ObservedFile, PathRegions, Policy, PolicyCase, RefusalKind, WaitResult } from "../values.ts";
2
2
  import type { TokenCounts } from "../records.ts";
3
3
  /** A refusal the hook decided itself, such as a held commit. */
4
4
  export interface RecordRefusalCommand {
@@ -7,6 +7,8 @@ export interface RecordRefusalCommand {
7
7
  kind: RefusalKind;
8
8
  paths: string[];
9
9
  peer_session_id?: string;
10
+ /** The names a `rename_held` refusal held; absent for other kinds. */
11
+ renamed?: HeldRename[];
10
12
  }
11
13
  /** Read-only: the policy table in effect for a workspace. */
12
14
  export interface PolicyCommand {
@@ -14,7 +14,7 @@ export declare const MAX_FRAME_BYTES = 65536;
14
14
  * knows. Pinned to `src/protocol.rs` and `fixtures/capabilities/answer.json`
15
15
  * by the tests.
16
16
  */
17
- export declare const CAPABILITIES: readonly ["anchored_notes", "briefing_memory", "briefing_outcomes", "build_errors", "collisions", "composition_table", "confirmed_briefings", "git_trouble", "inflight_partial", "intent_contracts", "intent_frames", "intent_overlaps", "interface_notices", "landing_held", "landing_rewrites", "message_paths", "notice_recipients", "opaque_events", "outline_reads", "place_told", "push_messages", "recap_since", "refusal_outcomes", "refused_roots", "remote_messages", "rename_holds", "renames", "reservations", "same_task", "sender_source", "session_limits", "standing_decisions", "subscriptions", "symbol_findings", "tolerant_responses", "trails", "unreadable_waits", "usage", "versioned_keys", "withheld_events", "worked_examples"];
17
+ export declare const CAPABILITIES: readonly ["anchored_notes", "briefing_memory", "briefing_outcomes", "build_errors", "chained_events", "collisions", "composition_table", "confirmed_briefings", "git_trouble", "inflight_partial", "intent_contracts", "intent_frames", "intent_overlaps", "interface_notices", "landing_held", "landing_rewrites", "message_paths", "notice_recipients", "opaque_events", "outline_reads", "place_told", "push_messages", "recap_since", "refusal_outcomes", "refused_roots", "remote_messages", "rename_held", "rename_holds", "renames", "reservations", "same_task", "sender_source", "session_limits", "standing_decisions", "subscriptions", "symbol_findings", "tolerant_responses", "trails", "unreadable_waits", "usage", "versioned_keys", "withheld_events", "worked_examples"];
18
18
  /**
19
19
  * What the coordinator serves and this client does not speak yet (ADR 0043,
20
20
  * "Transport"). The client names the `subscriptions` capability, which
@@ -30,6 +30,18 @@ export interface Request {
30
30
  command: Command;
31
31
  capabilities?: readonly string[];
32
32
  }
33
+ /**
34
+ * The fields a page entry or a subscription frame adds for a client that
35
+ * names `chained_events` (docs/protocol "The chain"): `digest` is SHA-256
36
+ * of `prev_digest` and `stored`, the event's JSON exactly as hashed. Both
37
+ * digests are absent on an event not chained yet, and `stored` on one the
38
+ * coordinator shows redacted. Read an entry as `RecordedEvent & EventLink`.
39
+ */
40
+ export interface EventLink {
41
+ digest?: string;
42
+ prev_digest?: string;
43
+ stored?: string;
44
+ }
33
45
  export interface Response {
34
46
  version: number;
35
47
  request_id: string;
package/dist/protocol.js CHANGED
@@ -19,6 +19,7 @@ export const CAPABILITIES = [
19
19
  "briefing_memory",
20
20
  "briefing_outcomes",
21
21
  "build_errors",
22
+ "chained_events",
22
23
  "collisions",
23
24
  "composition_table",
24
25
  "confirmed_briefings",
@@ -40,6 +41,7 @@ export const CAPABILITIES = [
40
41
  "refusal_outcomes",
41
42
  "refused_roots",
42
43
  "remote_messages",
44
+ "rename_held",
43
45
  "rename_holds",
44
46
  "renames",
45
47
  "reservations",
package/dist/values.d.ts CHANGED
@@ -301,7 +301,13 @@ export type SinceFrom = {
301
301
  kind: "away";
302
302
  after_ms: number;
303
303
  };
304
- export type RefusalKind = "conflict" | "stale_base" | "unread_lines" | "commit_held" | "landing_held";
304
+ export type RefusalKind = "conflict" | "stale_base" | "unread_lines" | "commit_held" | "landing_held" | "rename_held";
305
+ /** A name a held write renamed (to `to`) or removed, in `path`. Repository text. */
306
+ export interface HeldRename {
307
+ path: string;
308
+ name: string;
309
+ to?: string;
310
+ }
305
311
  export type PolicyCase = "advisory" | "conflict" | "stale_base" | "unread_lines" | "commit_held" | "landing_not_ready";
306
312
  export type Policy = "advisory" | "wait" | "refuse";
307
313
  export type WaitResult = "admitted" | "refused_conflict" | "refused_stale" | "refused_unread" | "refused_unreadable";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langspan/client",
3
- "version": "0.18.2",
3
+ "version": "0.21.0",
4
4
  "description": "A TypeScript client for the LangSpan coordination protocol",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/Langspan/LangSpan.dev/tree/main/clients/typescript",