@negotium/adapter-sdk 0.1.0 → 0.1.2

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Stable lifecycle contract implemented by every first-party channel adapter. */
2
- export declare const NEGOTIUM_ADAPTER_API_VERSION: 2;
2
+ export declare const NEGOTIUM_ADAPTER_API_VERSION: 3;
3
3
  export type Awaitable<T> = T | Promise<T>;
4
4
  export interface NegotiumAdapterHandle<Name extends string = string> {
5
5
  /** Stable adapter key used in logs, configuration, and contract tests. */
@@ -16,9 +16,19 @@ export interface NegotiumAdapterProjectionCapabilities {
16
16
  /** How authors originating in another adapter are represented. */
17
17
  readonly externalAuthors: "native" | "relayed";
18
18
  }
19
+ /** Optional behavioral surfaces are declared independently from lifecycle. */
20
+ export interface NegotiumAdapterCapabilities {
21
+ /** Accepts a human message originating on this adapter. */
22
+ readonly localUserInput: boolean;
23
+ /** Exposes create/delete/reset/compact topic commands. */
24
+ readonly topicManagement: boolean;
25
+ /** Executes a turn placed by an external peer runtime. */
26
+ readonly externalPlacedTurn: boolean;
27
+ }
19
28
  export interface NegotiumAdapterDefinition<Name extends string, Options, Handle extends NegotiumAdapterHandle<Name>> {
20
29
  readonly apiVersion: typeof NEGOTIUM_ADAPTER_API_VERSION;
21
30
  readonly name: Name;
31
+ readonly capabilities: NegotiumAdapterCapabilities;
22
32
  readonly projection: NegotiumAdapterProjectionCapabilities;
23
33
  start(options: Options): Awaitable<Handle>;
24
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAElF,eAAO,MAAM,4BAA4B,EAAG,CAAU,CAAC;AAEvD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAE1C,MAAM,WAAW,qBAAqB,CAAC,IAAI,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AC,GAC/E,yBAAyB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAElD"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // src/index.ts
3
- var NEGOTIUM_ADAPTER_API_VERSION = 2;
3
+ var NEGOTIUM_ADAPTER_API_VERSION = 3;
4
4
  function defineNegotiumAdapter(definition) {
5
5
  return { apiVersion: NEGOTIUM_ADAPTER_API_VERSION, ...definition };
6
6
  }
@@ -9,4 +9,4 @@ export {
9
9
  NEGOTIUM_ADAPTER_API_VERSION
10
10
  };
11
11
 
12
- //# debugId=58D74754492A3D5F64756E2164756E21
12
+ //# debugId=DD84162A70258A8064756E2164756E21
package/dist/index.js.map CHANGED
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": [
5
- "/** Stable lifecycle contract implemented by every first-party channel adapter. */\n\nexport const NEGOTIUM_ADAPTER_API_VERSION = 2 as const;\n\nexport type Awaitable<T> = T | Promise<T>;\n\nexport interface NegotiumAdapterHandle<Name extends string = string> {\n /** Stable adapter key used in logs, configuration, and contract tests. */\n readonly name: Name;\n /** Stop accepting channel input and release every owned resource. Idempotent. */\n stop(): Awaitable<void>;\n}\n\n/** User-facing transcript semantics; transport gaps stay explicit metadata. */\nexport interface NegotiumAdapterProjectionCapabilities {\n /** Whether the surface can render a room timeline or only newly delivered events. */\n readonly transcript: \"full\" | \"live-only\";\n /** Whether pre-existing topic messages can populate the surface on binding. */\n readonly historyBackfill: boolean;\n /** How authors originating in another adapter are represented. */\n readonly externalAuthors: \"native\" | \"relayed\";\n}\n\nexport interface NegotiumAdapterDefinition<\n Name extends string,\n Options,\n Handle extends NegotiumAdapterHandle<Name>,\n> {\n readonly apiVersion: typeof NEGOTIUM_ADAPTER_API_VERSION;\n readonly name: Name;\n readonly projection: NegotiumAdapterProjectionCapabilities;\n start(options: Options): Awaitable<Handle>;\n}\n\nexport function defineNegotiumAdapter<\n const Name extends string,\n Options,\n Handle extends NegotiumAdapterHandle<Name>,\n>(\n definition: Omit<NegotiumAdapterDefinition<Name, Options, Handle>, \"apiVersion\">,\n): NegotiumAdapterDefinition<Name, Options, Handle> {\n return { apiVersion: NEGOTIUM_ADAPTER_API_VERSION, ...definition };\n}\n"
5
+ "/** Stable lifecycle contract implemented by every first-party channel adapter. */\n\nexport const NEGOTIUM_ADAPTER_API_VERSION = 3 as const;\n\nexport type Awaitable<T> = T | Promise<T>;\n\nexport interface NegotiumAdapterHandle<Name extends string = string> {\n /** Stable adapter key used in logs, configuration, and contract tests. */\n readonly name: Name;\n /** Stop accepting channel input and release every owned resource. Idempotent. */\n stop(): Awaitable<void>;\n}\n\n/** User-facing transcript semantics; transport gaps stay explicit metadata. */\nexport interface NegotiumAdapterProjectionCapabilities {\n /** Whether the surface can render a room timeline or only newly delivered events. */\n readonly transcript: \"full\" | \"live-only\";\n /** Whether pre-existing topic messages can populate the surface on binding. */\n readonly historyBackfill: boolean;\n /** How authors originating in another adapter are represented. */\n readonly externalAuthors: \"native\" | \"relayed\";\n}\n\n/** Optional behavioral surfaces are declared independently from lifecycle. */\nexport interface NegotiumAdapterCapabilities {\n /** Accepts a human message originating on this adapter. */\n readonly localUserInput: boolean;\n /** Exposes create/delete/reset/compact topic commands. */\n readonly topicManagement: boolean;\n /** Executes a turn placed by an external peer runtime. */\n readonly externalPlacedTurn: boolean;\n}\n\nexport interface NegotiumAdapterDefinition<\n Name extends string,\n Options,\n Handle extends NegotiumAdapterHandle<Name>,\n> {\n readonly apiVersion: typeof NEGOTIUM_ADAPTER_API_VERSION;\n readonly name: Name;\n readonly capabilities: NegotiumAdapterCapabilities;\n readonly projection: NegotiumAdapterProjectionCapabilities;\n start(options: Options): Awaitable<Handle>;\n}\n\nexport function defineNegotiumAdapter<\n const Name extends string,\n Options,\n Handle extends NegotiumAdapterHandle<Name>,\n>(\n definition: Omit<NegotiumAdapterDefinition<Name, Options, Handle>, \"apiVersion\">,\n): NegotiumAdapterDefinition<Name, Options, Handle> {\n return { apiVersion: NEGOTIUM_ADAPTER_API_VERSION, ...definition };\n}\n"
6
6
  ],
7
- "mappings": ";;AAEO,IAAM,+BAA+B;AAgCrC,SAAS,qBAIf,CACC,YACkD;AAAA,EAClD,OAAO,EAAE,YAAY,iCAAiC,WAAW;AAAA;",
8
- "debugId": "58D74754492A3D5F64756E2164756E21",
7
+ "mappings": ";;AAEO,IAAM,+BAA+B;AA2CrC,SAAS,qBAIf,CACC,YACkD;AAAA,EAClD,OAAO,EAAE,YAAY,iCAAiC,WAAW;AAAA;",
8
+ "debugId": "DD84162A70258A8064756E2164756E21",
9
9
  "names": []
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@negotium/adapter-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Shared lifecycle contract for Negotium channel adapters",
6
6
  "license": "Apache-2.0",