@manehorizons/cadence-types 1.8.0 → 1.10.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/dist/handoff.d.ts CHANGED
@@ -37,7 +37,7 @@ export declare const ResumeResultZ: z.ZodUnion<readonly [z.ZodObject<{
37
37
  handoffPath: z.ZodString;
38
38
  generatedAt: z.ZodNullable<z.ZodString>;
39
39
  doc: z.ZodString;
40
- context: z.ZodObject<{
40
+ context: z.ZodNullable<z.ZodObject<{
41
41
  schemaVersion: z.ZodLiteral<1>;
42
42
  scope: z.ZodEnum<{
43
43
  phase: "phase";
@@ -134,11 +134,15 @@ export declare const ResumeResultZ: z.ZodUnion<readonly [z.ZodObject<{
134
134
  files: z.ZodNumber;
135
135
  recommendationsOmitted: z.ZodNumber;
136
136
  }, z.core.$strip>;
137
- }, z.core.$strip>;
137
+ }, z.core.$strip>>;
138
138
  drift: z.ZodNullable<z.ZodObject<{
139
139
  docLoopPosition: z.ZodString;
140
140
  liveLoopPosition: z.ZodString;
141
141
  }, z.core.$strip>>;
142
+ mode: z.ZodEnum<{
143
+ brief: "brief";
144
+ full: "full";
145
+ }>;
142
146
  }, z.core.$strip>]>;
143
147
  export type ResumeResult = z.infer<typeof ResumeResultZ>;
144
148
  //# sourceMappingURL=handoff.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handoff.d.ts","sourceRoot":"","sources":["../src/handoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;oEACoE;AACpE,eAAO,MAAM,SAAS;;;;;;;;;;;mBAYpB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAEjD;wDACwD;AACxD,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,CAAC,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAaxB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
package/dist/handoff.js CHANGED
@@ -23,10 +23,11 @@ export const ResumeResultZ = z.union([
23
23
  handoffPath: z.string(),
24
24
  generatedAt: z.string().nullable(),
25
25
  doc: z.string(),
26
- context: ContextPacketZ,
26
+ context: ContextPacketZ.nullable(),
27
27
  drift: z
28
28
  .object({ docLoopPosition: z.string(), liveLoopPosition: z.string() })
29
29
  .nullable(),
30
+ mode: z.enum(['brief', 'full']),
30
31
  }),
31
32
  ]);
32
33
  //# sourceMappingURL=handoff.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handoff.js","sourceRoot":"","sources":["../src/handoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;oEACoE;AACpE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC;IAC/B,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;IACzC,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QAC1B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;QAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACrC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACtC,IAAI,EAAE,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CAAC,CAAC,OAAO,EAAE;QAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACrC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;QACzB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;KACrB,CAAC;CACH,CAAC,CAAC;AAmBH,uCAAuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;IACrC,CAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QACtB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;QACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAClC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,OAAO,EAAE,cAAc,CAAC,QAAQ,EAAE;QAClC,KAAK,EAAE,CAAC;aACL,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;aACrE,QAAQ,EAAE;QACb,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC;CACH,CAAC,CAAC"}
package/dist/host.d.ts CHANGED
@@ -1,10 +1,87 @@
1
- import type { AbstractEvent } from './events.js';
2
- export interface HostCapabilities {
3
- hooks: AbstractEvent[];
4
- slashCommands: boolean;
5
- skillSystem: 'native' | 'prompted' | 'none';
6
- blockingHooks: AbstractEvent[];
7
- subagentSpawn: 'native' | 'shell-out' | 'none';
8
- streamingOutput: boolean;
1
+ import { z } from 'zod';
2
+ import { type AbstractEvent } from './events.js';
3
+ /**
4
+ * Capability descriptor a host adapter declares about its environment. The
5
+ * core uses it to decide which abstract events the host can deliver and which
6
+ * of them can block. Zod schema kept in parity with {@link AbstractEventZ}; the
7
+ * `HostCapabilities` type is derived from it so the schema is the single
8
+ * source of truth.
9
+ */
10
+ export declare const HostCapabilitiesZ: z.ZodObject<{
11
+ hooks: z.ZodArray<z.ZodEnum<{
12
+ "session-start": "session-start";
13
+ "user-prompt": "user-prompt";
14
+ "pre-tool-edit": "pre-tool-edit";
15
+ "post-tool-edit": "post-tool-edit";
16
+ "session-stop": "session-stop";
17
+ "subagent-result": "subagent-result";
18
+ "skill-invoke": "skill-invoke";
19
+ }>>;
20
+ slashCommands: z.ZodBoolean;
21
+ skillSystem: z.ZodEnum<{
22
+ none: "none";
23
+ native: "native";
24
+ prompted: "prompted";
25
+ }>;
26
+ blockingHooks: z.ZodArray<z.ZodEnum<{
27
+ "session-start": "session-start";
28
+ "user-prompt": "user-prompt";
29
+ "pre-tool-edit": "pre-tool-edit";
30
+ "post-tool-edit": "post-tool-edit";
31
+ "session-stop": "session-stop";
32
+ "subagent-result": "subagent-result";
33
+ "skill-invoke": "skill-invoke";
34
+ }>>;
35
+ subagentSpawn: z.ZodEnum<{
36
+ none: "none";
37
+ native: "native";
38
+ "shell-out": "shell-out";
39
+ }>;
40
+ streamingOutput: z.ZodBoolean;
41
+ }, z.core.$strip>;
42
+ export type HostCapabilities = z.infer<typeof HostCapabilitiesZ>;
43
+ /**
44
+ * Version of the host-adapter contract (capabilities + event map + payload
45
+ * extraction + install surface). Integer, breaking-only — bumped when an
46
+ * existing adapter would need code changes to keep conforming.
47
+ */
48
+ export declare const ADAPTER_CONTRACT_VERSION = 1;
49
+ /**
50
+ * Normalized payload the core dispatcher consumes, extracted by an adapter
51
+ * from a host's raw event. `files` for edit-tool events; `skill` for
52
+ * skill-invoke events. Host-facing adapters own the extraction; this is the
53
+ * core-facing shape they must produce.
54
+ */
55
+ export interface ExtractedPayload {
56
+ files?: string[];
57
+ skill?: string;
58
+ }
59
+ /**
60
+ * The host-adapter contract. An adapter package translates a host's lifecycle
61
+ * into the abstract events the core already speaks, declares its capabilities,
62
+ * extracts payloads, and installs itself into the host.
63
+ *
64
+ * Only the core-facing surface is pinned here. Install option shapes are
65
+ * intrinsically host-specific, so they are left as type parameters rather than
66
+ * coupled to any one host. Runtime plumbing a host needs internally (request
67
+ * routing, locating its own install) is a documented responsibility, not part
68
+ * of this type — see the "write your own adapter" guide.
69
+ *
70
+ * @typeParam HookOpts - host-specific options for {@link HostAdapter.installHooks}
71
+ * @typeParam CommandOpts - host-specific options for {@link HostAdapter.installCommands}
72
+ */
73
+ export interface HostAdapter<HookOpts = unknown, CommandOpts = unknown> {
74
+ /** Contract version this adapter targets; must equal {@link ADAPTER_CONTRACT_VERSION}. */
75
+ readonly contractVersion: number;
76
+ /** What the host environment can do. */
77
+ readonly capabilities: HostCapabilities;
78
+ /** Map a host lifecycle event name to its abstract event, or null if unmapped. */
79
+ mapEvent(hostEvent: string, toolName?: string): AbstractEvent | null;
80
+ /** Extract the normalized payload from a host's raw event. */
81
+ extractPayload(raw: unknown): ExtractedPayload | undefined;
82
+ /** Wire the host's lifecycle hooks to the cadence shim, under project `root`. */
83
+ installHooks(root: string, options?: HookOpts): Promise<unknown> | unknown;
84
+ /** Install the host's slash-command (or equivalent) surface, under project `root`. */
85
+ installCommands(root: string, options?: CommandOpts): Promise<unknown> | unknown;
9
86
  }
10
87
  //# sourceMappingURL=host.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,aAAa,EAAE,OAAO,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O,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAC3E,sFAAsF;IACtF,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CAClF"}
package/dist/host.js CHANGED
@@ -1,2 +1,24 @@
1
- export {};
1
+ import { z } from 'zod';
2
+ import { AbstractEventZ } from './events.js';
3
+ /**
4
+ * Capability descriptor a host adapter declares about its environment. The
5
+ * core uses it to decide which abstract events the host can deliver and which
6
+ * of them can block. Zod schema kept in parity with {@link AbstractEventZ}; the
7
+ * `HostCapabilities` type is derived from it so the schema is the single
8
+ * source of truth.
9
+ */
10
+ export const HostCapabilitiesZ = z.object({
11
+ hooks: z.array(AbstractEventZ),
12
+ slashCommands: z.boolean(),
13
+ skillSystem: z.enum(['native', 'prompted', 'none']),
14
+ blockingHooks: z.array(AbstractEventZ),
15
+ subagentSpawn: z.enum(['native', 'shell-out', 'none']),
16
+ streamingOutput: z.boolean(),
17
+ });
18
+ /**
19
+ * Version of the host-adapter contract (capabilities + event map + payload
20
+ * extraction + install surface). Integer, breaking-only — bumped when an
21
+ * existing adapter would need code changes to keep conforming.
22
+ */
23
+ export const ADAPTER_CONTRACT_VERSION = 1;
2
24
  //# sourceMappingURL=host.js.map
package/dist/host.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;IAC9B,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;IAC1B,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACnD,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;IACtC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IACtD,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;CAC7B,CAAC,CAAC;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manehorizons/cadence-types",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },