@maiaos/sdk 0.1.0-canary.8 → 0.1.0-canary.9

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.
@@ -0,0 +1,16 @@
1
+ import type { NodeApiObservationFrame, NodeApiObservationSubscribe } from "@maiaos/protocol";
2
+ export type ChangedAggregate = {
3
+ readonly id: string;
4
+ readonly revision: string;
5
+ readonly type: string;
6
+ };
7
+ export type NodeChange = {
8
+ readonly aggregateTypes: readonly string[];
9
+ readonly changed?: readonly ChangedAggregate[];
10
+ readonly kind: "records";
11
+ } | {
12
+ readonly kind: "resync";
13
+ };
14
+ export type NodeChangesSubscribe = Omit<NodeApiObservationSubscribe, "authentication">;
15
+ export declare const reduceNodeChanges: (frame: NodeApiObservationFrame) => NodeChange | undefined;
16
+ //# sourceMappingURL=change.d.ts.map
@@ -0,0 +1,16 @@
1
+ export const reduceNodeChanges = (frame) => {
2
+ if (frame.kind === "event")
3
+ return {
4
+ aggregateTypes: frame.data.records.map((record) => record.aggregateType),
5
+ changed: frame.data.records.map((record) => ({
6
+ id: record.aggregateId,
7
+ revision: record.aggregateRevision,
8
+ type: record.aggregateType,
9
+ })),
10
+ kind: "records",
11
+ };
12
+ if (frame.kind === "snapshot")
13
+ return { kind: "resync" };
14
+ return undefined;
15
+ };
16
+ //# sourceMappingURL=change.js.map
@@ -2,7 +2,7 @@ import type * as Effect from "effect/Effect";
2
2
  import * as Stream from "effect/Stream";
3
3
  import type { MaiaClientError } from "../request/index.js";
4
4
  import type { StreamRelay } from "../stream/index.js";
5
- import { type NodeChange, type NodeChangesSubscribe } from "./node-changes.js";
5
+ import { type NodeChange, type NodeChangesSubscribe } from "./change.js";
6
6
  export declare const nodeChangesSubscribe: (instanceId: string, messageId: string, afterCursor: string | undefined) => NodeChangesSubscribe;
7
7
  export declare const watchNodeChangesStream: (relay: StreamRelay<NodeChangesSubscribe>, options: {
8
8
  readonly instanceId: string;
@@ -3,7 +3,7 @@ import * as Option from "effect/Option";
3
3
  import * as Schema from "effect/Schema";
4
4
  import * as Stream from "effect/Stream";
5
5
  import { RESNAPSHOT, resumeStream } from "../stream/effect.js";
6
- import { reduceNodeChanges, } from "./node-changes.js";
6
+ import { reduceNodeChanges, } from "./change.js";
7
7
  const utf8 = new TextEncoder();
8
8
  const decodeJson = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
9
9
  export const nodeChangesSubscribe = (instanceId, messageId, afterCursor) => ({
@@ -1,2 +1,3 @@
1
- export { type ChangedAggregate, type NodeChange, type NodeChangesSubscribe, reduceNodeChanges, watchNodeChanges, } from "./node-changes.js";
1
+ export { type ChangedAggregate, type NodeChange, type NodeChangesSubscribe, reduceNodeChanges, } from "./change.js";
2
+ export { watchNodeChanges } from "./node-changes.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,3 @@
1
- export { reduceNodeChanges, watchNodeChanges, } from "./node-changes.js";
1
+ export { reduceNodeChanges, } from "./change.js";
2
+ export { watchNodeChanges } from "./node-changes.js";
2
3
  //# sourceMappingURL=index.js.map
@@ -1,19 +1,5 @@
1
- import type { NodeApiObservationFrame, NodeApiObservationSubscribe } from "@maiaos/protocol";
2
1
  import type { StreamRelay } from "../stream/index.js";
3
- export type ChangedAggregate = {
4
- readonly id: string;
5
- readonly revision: string;
6
- readonly type: string;
7
- };
8
- export type NodeChange = {
9
- readonly aggregateTypes: readonly string[];
10
- readonly changed?: readonly ChangedAggregate[];
11
- readonly kind: "records";
12
- } | {
13
- readonly kind: "resync";
14
- };
15
- export type NodeChangesSubscribe = Omit<NodeApiObservationSubscribe, "authentication">;
16
- export declare const reduceNodeChanges: (frame: NodeApiObservationFrame) => NodeChange | undefined;
2
+ import type { NodeChange, NodeChangesSubscribe } from "./change.js";
17
3
  export declare const watchNodeChanges: (relay: StreamRelay<NodeChangesSubscribe>, options: {
18
4
  readonly instanceId: string;
19
5
  readonly newId: (prefix: "request") => string;
@@ -1,21 +1,6 @@
1
1
  import * as Effect from "effect/Effect";
2
2
  import * as Stream from "effect/Stream";
3
3
  import { watchNodeChangesStream } from "./effect.js";
4
- export const reduceNodeChanges = (frame) => {
5
- if (frame.kind === "event")
6
- return {
7
- aggregateTypes: frame.data.records.map((record) => record.aggregateType),
8
- changed: frame.data.records.map((record) => ({
9
- id: record.aggregateId,
10
- revision: record.aggregateRevision,
11
- type: record.aggregateType,
12
- })),
13
- kind: "records",
14
- };
15
- if (frame.kind === "snapshot")
16
- return { kind: "resync" };
17
- return undefined;
18
- };
19
4
  export const watchNodeChanges = (relay, options) => Stream.toAsyncIterable(watchNodeChangesStream(relay, {
20
5
  instanceId: options.instanceId,
21
6
  nextId: (prefix) => Effect.sync(() => options.newId(prefix)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiaos/sdk",
3
- "version": "0.1.0-canary.8",
3
+ "version": "0.1.0-canary.9",
4
4
  "description": "TypeScript SDK for Maia Node: typed, validated calls to create and drive AI coding agent Sessions (Claude Code, Codex), wait for turns and read receipts.",
5
5
  "keywords": [
6
6
  "maia",
@@ -72,7 +72,7 @@
72
72
  "typescript": "npm:@typescript/typescript6@6.0.2"
73
73
  },
74
74
  "dependencies": {
75
- "@maiaos/protocol": "0.1.0-canary.8",
75
+ "@maiaos/protocol": "0.1.0-canary.9",
76
76
  "effect": "4.0.0"
77
77
  },
78
78
  "scripts": {