pi-harness-runtime 1.1.335 → 1.1.337

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.
Files changed (180) hide show
  1. package/index.ts +21 -12
  2. package/package.json +1 -1
  3. package/packages/a2a-adapter/package.json +1 -1
  4. package/packages/agent-policy/package.json +1 -1
  5. package/packages/architecture-generator/package.json +1 -1
  6. package/packages/auth/package.json +1 -1
  7. package/packages/autonomous-refactor/package.json +1 -1
  8. package/packages/autonomous-runtime/package.json +1 -1
  9. package/packages/cache-strategy/package.json +1 -1
  10. package/packages/capability-registry/package.json +1 -1
  11. package/packages/checkpoint/package.json +1 -1
  12. package/packages/cli-plugin-sdk/package.json +1 -1
  13. package/packages/clipboard/package.json +1 -1
  14. package/packages/clipboard-plugin/package.json +1 -1
  15. package/packages/code-generation/package.json +1 -1
  16. package/packages/code-review/package.json +1 -1
  17. package/packages/codex-adapter/package.json +1 -1
  18. package/packages/codex-watcher/package.json +1 -1
  19. package/packages/config-capture/package.json +1 -1
  20. package/packages/connection-runtime/dist/index.d.ts +11 -0
  21. package/packages/connection-runtime/dist/index.js +11 -0
  22. package/packages/connection-runtime/dist/registry.d.ts +69 -0
  23. package/packages/connection-runtime/dist/registry.js +117 -0
  24. package/packages/connection-runtime/dist/supervisor.d.ts +89 -0
  25. package/packages/connection-runtime/dist/supervisor.js +169 -0
  26. package/packages/connection-runtime/dist/types.d.ts +70 -0
  27. package/packages/connection-runtime/dist/types.js +16 -0
  28. package/packages/connection-runtime/package.json +24 -0
  29. package/packages/connection-runtime/src/index.ts +12 -0
  30. package/packages/connection-runtime/src/registry.ts +142 -0
  31. package/packages/connection-runtime/src/supervisor.ts +224 -0
  32. package/packages/connection-runtime/src/types.ts +88 -0
  33. package/packages/context-compiler/package.json +1 -1
  34. package/packages/context-discovery/package.json +1 -1
  35. package/packages/context-manager/package.json +1 -1
  36. package/packages/contracts/dist/approvals.d.ts +273 -0
  37. package/packages/contracts/dist/approvals.js +93 -0
  38. package/packages/contracts/dist/base.d.ts +78 -0
  39. package/packages/contracts/dist/base.js +82 -0
  40. package/packages/contracts/dist/events.d.ts +99 -0
  41. package/packages/contracts/dist/events.js +65 -0
  42. package/packages/contracts/dist/index.d.ts +20 -0
  43. package/packages/contracts/dist/index.js +20 -0
  44. package/packages/contracts/dist/jobs.d.ts +234 -0
  45. package/packages/contracts/dist/jobs.js +79 -0
  46. package/packages/contracts/dist/notifications.d.ts +317 -0
  47. package/packages/contracts/dist/notifications.js +85 -0
  48. package/packages/contracts/dist/projects.d.ts +171 -0
  49. package/packages/contracts/dist/projects.js +62 -0
  50. package/packages/contracts/dist/sessions.d.ts +226 -0
  51. package/packages/contracts/dist/sessions.js +82 -0
  52. package/packages/contracts/package.json +24 -0
  53. package/packages/contracts/src/approvals.ts +115 -0
  54. package/packages/contracts/src/base.ts +126 -0
  55. package/packages/contracts/src/events.ts +78 -0
  56. package/packages/contracts/src/index.ts +21 -0
  57. package/packages/contracts/src/jobs.ts +101 -0
  58. package/packages/contracts/src/notifications.ts +104 -0
  59. package/packages/contracts/src/projects.ts +81 -0
  60. package/packages/contracts/src/sessions.ts +104 -0
  61. package/packages/cookie-sanitizer/package.json +1 -1
  62. package/packages/cost-optimizer/package.json +1 -1
  63. package/packages/dependency-analyzer/package.json +1 -1
  64. package/packages/django-plugin/package.json +1 -1
  65. package/packages/doc-generator/package.json +1 -1
  66. package/packages/durable-review/package.json +1 -1
  67. package/packages/e2e-tester/package.json +1 -1
  68. package/packages/evaluation-engine/package.json +1 -1
  69. package/packages/evaluation-runner/package.json +1 -1
  70. package/packages/event-bus/package.json +1 -1
  71. package/packages/event-sink/dist/index.d.ts +12 -0
  72. package/packages/event-sink/dist/index.js +12 -0
  73. package/packages/event-sink/dist/outbox.d.ts +51 -0
  74. package/packages/event-sink/dist/outbox.js +88 -0
  75. package/packages/event-sink/dist/projection.d.ts +41 -0
  76. package/packages/event-sink/dist/projection.js +62 -0
  77. package/packages/event-sink/dist/sink.d.ts +81 -0
  78. package/packages/event-sink/dist/sink.js +106 -0
  79. package/packages/event-sink/package.json +28 -0
  80. package/packages/event-sink/src/index.ts +15 -0
  81. package/packages/event-sink/src/outbox.ts +119 -0
  82. package/packages/event-sink/src/projection.ts +84 -0
  83. package/packages/event-sink/src/sink.ts +167 -0
  84. package/packages/event-store/package.json +1 -1
  85. package/packages/experience-replay/package.json +1 -1
  86. package/packages/feedback-collector/package.json +1 -1
  87. package/packages/file-copy-helper/package.json +1 -1
  88. package/packages/framework-detector/package.json +1 -1
  89. package/packages/framework-plugin-sdk/package.json +1 -1
  90. package/packages/frappe-plugin/package.json +1 -1
  91. package/packages/generic-web-plugin/package.json +1 -1
  92. package/packages/health-monitor/package.json +1 -1
  93. package/packages/intent-analyzer/package.json +1 -1
  94. package/packages/jev-judge/package.json +1 -1
  95. package/packages/knowledge-graph/package.json +1 -1
  96. package/packages/knowledge-retrieval/package.json +1 -1
  97. package/packages/laravel-plugin/package.json +1 -1
  98. package/packages/learning-engine/package.json +1 -1
  99. package/packages/mcp-adapter/package.json +1 -1
  100. package/packages/memory-engine/package.json +1 -1
  101. package/packages/milestone-manager/package.json +1 -1
  102. package/packages/model-registry/package.json +1 -1
  103. package/packages/nextjs-plugin/package.json +1 -1
  104. package/packages/notification/package.json +1 -1
  105. package/packages/observability/package.json +1 -1
  106. package/packages/okf-indexer/package.json +1 -1
  107. package/packages/paperclip-integration/package.json +1 -1
  108. package/packages/performance-optimizer/package.json +1 -1
  109. package/packages/permission-mode/dist/checker.d.ts +66 -0
  110. package/packages/permission-mode/dist/checker.js +64 -0
  111. package/packages/permission-mode/dist/index.d.ts +12 -0
  112. package/packages/permission-mode/dist/index.js +11 -0
  113. package/packages/permission-mode/dist/manager.d.ts +65 -0
  114. package/packages/permission-mode/dist/manager.js +91 -0
  115. package/packages/permission-mode/dist/mode.d.ts +31 -0
  116. package/packages/permission-mode/dist/mode.js +47 -0
  117. package/packages/permission-mode/package.json +24 -0
  118. package/packages/permission-mode/src/checker.ts +103 -0
  119. package/packages/permission-mode/src/index.ts +13 -0
  120. package/packages/permission-mode/src/manager.ts +154 -0
  121. package/packages/permission-mode/src/mode.ts +73 -0
  122. package/packages/privilege-broker/package.json +1 -1
  123. package/packages/project-analyzer/package.json +1 -1
  124. package/packages/project-bootstrap/package.json +1 -1
  125. package/packages/projection-engine/package.json +1 -1
  126. package/packages/prompt-compiler/package.json +1 -1
  127. package/packages/prompt-versioning/package.json +1 -1
  128. package/packages/provider-adapter-sdk/package.json +1 -1
  129. package/packages/provider-router/package.json +1 -1
  130. package/packages/provider-selector/package.json +1 -1
  131. package/packages/providers/package.json +1 -1
  132. package/packages/qdrant-skills/package.json +1 -1
  133. package/packages/quota-manager/package.json +1 -1
  134. package/packages/rate-limiter/package.json +1 -1
  135. package/packages/react-vite-plugin/package.json +1 -1
  136. package/packages/relay/dist/client.d.ts +53 -0
  137. package/packages/relay/dist/client.js +95 -0
  138. package/packages/relay/dist/index.d.ts +9 -0
  139. package/packages/relay/dist/index.js +8 -0
  140. package/packages/relay/dist/server.d.ts +58 -0
  141. package/packages/relay/dist/server.js +93 -0
  142. package/packages/relay/dist/types.d.ts +35 -0
  143. package/packages/relay/dist/types.js +4 -0
  144. package/packages/relay/package.json +24 -0
  145. package/packages/relay/src/client.ts +119 -0
  146. package/packages/relay/src/index.ts +10 -0
  147. package/packages/relay/src/server.ts +120 -0
  148. package/packages/relay/src/types.ts +38 -0
  149. package/packages/release-manager/package.json +1 -1
  150. package/packages/requirement-compiler/package.json +1 -1
  151. package/packages/runtime/package.json +1 -1
  152. package/packages/scheduler/package.json +1 -1
  153. package/packages/scheduler-adapter/package.json +1 -1
  154. package/packages/session/package.json +1 -1
  155. package/packages/session-api/package.json +1 -1
  156. package/packages/session-export/package.json +1 -1
  157. package/packages/shared-context/package.json +1 -1
  158. package/packages/skill-mcp-client/package.json +1 -1
  159. package/packages/skill-registry/package.json +1 -1
  160. package/packages/skills/package.json +1 -1
  161. package/packages/sprint-planner/package.json +1 -1
  162. package/packages/subscription-engine/package.json +1 -1
  163. package/packages/task-compiler/package.json +1 -1
  164. package/packages/telegram/package.json +1 -1
  165. package/packages/tencentdb-memory/package.json +1 -1
  166. package/packages/tencentdb-sync/package.json +1 -1
  167. package/packages/test-data-generator/package.json +1 -1
  168. package/packages/test-generator/package.json +1 -1
  169. package/packages/todo-bd-sync/package.json +1 -1
  170. package/packages/token-estimation/package.json +1 -1
  171. package/packages/token-optimizer/package.json +1 -1
  172. package/packages/trajectory/package.json +1 -1
  173. package/packages/tui/package.json +1 -1
  174. package/packages/types/package.json +1 -1
  175. package/packages/webmcp-tester/package.json +1 -1
  176. package/packages/wiki/package.json +1 -1
  177. package/packages/workflow-events/package.json +1 -1
  178. package/packages/workspace-scanner/package.json +1 -1
  179. package/packages/worktree/package.json +1 -1
  180. package/packages/write-review/package.json +1 -1
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Job schemas for pi-harness
3
+ */
4
+
5
+ import { z } from 'zod';
6
+ import { Timestamp, UUID, NonEmptyString } from './base.js';
7
+
8
+ /**
9
+ * Job status
10
+ */
11
+ export const JobStatus = z.enum([
12
+ 'pending',
13
+ 'running',
14
+ 'completed',
15
+ 'failed',
16
+ 'cancelled',
17
+ ]);
18
+
19
+ export type JobStatus = z.infer<typeof JobStatus>;
20
+
21
+ /**
22
+ * Job priority
23
+ */
24
+ export const JobPriority = z.enum(['low', 'normal', 'high', 'urgent']);
25
+
26
+ export type JobPriority = z.infer<typeof JobPriority>;
27
+
28
+ /**
29
+ * Job definition
30
+ */
31
+ export const Job = z.object({
32
+ id: UUID,
33
+ type: NonEmptyString,
34
+ status: JobStatus,
35
+ priority: JobPriority.default('normal'),
36
+ workspaceId: z.string(),
37
+ sessionId: z.string().optional(),
38
+ requirement: NonEmptyString,
39
+ result: z.unknown().optional(),
40
+ error: z.string().optional(),
41
+ progress: z.number().min(0).max(100).default(0),
42
+ createdAt: Timestamp,
43
+ startedAt: Timestamp.optional(),
44
+ completedAt: Timestamp.optional(),
45
+ metadata: z.record(z.string(), z.unknown()).optional(),
46
+ });
47
+
48
+ export type Job = z.infer<typeof Job>;
49
+
50
+ /**
51
+ * Job creation input
52
+ */
53
+ export const JobCreate = z.object({
54
+ type: NonEmptyString,
55
+ priority: JobPriority.default('normal'),
56
+ workspaceId: z.string(),
57
+ sessionId: z.string().optional(),
58
+ requirement: NonEmptyString,
59
+ metadata: z.record(z.string(), z.unknown()).optional(),
60
+ });
61
+
62
+ export type JobCreate = z.infer<typeof JobCreate>;
63
+
64
+ /**
65
+ * Job update input
66
+ */
67
+ export const JobUpdate = z.object({
68
+ status: JobStatus.optional(),
69
+ progress: z.number().min(0).max(100).optional(),
70
+ result: z.unknown().optional(),
71
+ error: z.string().optional(),
72
+ });
73
+
74
+ export type JobUpdate = z.infer<typeof JobUpdate>;
75
+
76
+ /**
77
+ * Job filter
78
+ */
79
+ export const JobFilter = z.object({
80
+ workspaceId: z.string().optional(),
81
+ sessionId: z.string().optional(),
82
+ status: z.union([JobStatus, z.array(JobStatus)]).optional(),
83
+ priority: JobPriority.optional(),
84
+ since: Timestamp.optional(),
85
+ until: Timestamp.optional(),
86
+ limit: z.number().int().positive().max(100).default(50),
87
+ cursor: z.string().optional(),
88
+ });
89
+
90
+ export type JobFilter = z.infer<typeof JobFilter>;
91
+
92
+ /**
93
+ * Job list response
94
+ */
95
+ export const JobList = z.object({
96
+ items: z.array(Job),
97
+ nextCursor: z.string().optional(),
98
+ total: z.number().optional(),
99
+ });
100
+
101
+ export type JobList = z.infer<typeof JobList>;
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Notification schemas for pi-harness
3
+ */
4
+
5
+ import { z } from 'zod';
6
+ import { Timestamp, UUID, NonEmptyString } from './base.js';
7
+
8
+ /**
9
+ * Notification channel
10
+ */
11
+ export const NotificationChannel = z.enum([
12
+ 'telegram',
13
+ 'email',
14
+ 'webhook',
15
+ 'desktop',
16
+ ]);
17
+
18
+ export type NotificationChannel = z.infer<typeof NotificationChannel>;
19
+
20
+ /**
21
+ * Notification priority
22
+ */
23
+ export const NotificationPriority = z.enum(['low', 'normal', 'high', 'urgent']);
24
+
25
+ export type NotificationPriority = z.infer<typeof NotificationPriority>;
26
+
27
+ /**
28
+ * Notification definition
29
+ */
30
+ export const Notification = z.object({
31
+ id: UUID,
32
+ event: NonEmptyString,
33
+ channel: NotificationChannel,
34
+ priority: NotificationPriority.default('normal'),
35
+ workspaceId: z.string().optional(),
36
+ sessionId: z.string().optional(),
37
+ jobId: z.string().optional(),
38
+ title: NonEmptyString,
39
+ message: NonEmptyString,
40
+ data: z.record(z.string(), z.unknown()).optional(),
41
+ buttons: z.array(z.object({
42
+ text: NonEmptyString,
43
+ action: NonEmptyString,
44
+ targetId: z.string().optional(),
45
+ url: z.string().url().optional(),
46
+ })).optional(),
47
+ sentAt: Timestamp.optional(),
48
+ readAt: Timestamp.optional(),
49
+ metadata: z.record(z.string(), z.unknown()).optional(),
50
+ });
51
+
52
+ export type Notification = z.infer<typeof Notification>;
53
+
54
+ /**
55
+ * Notification creation input
56
+ */
57
+ export const NotificationCreate = z.object({
58
+ event: NonEmptyString,
59
+ channel: NotificationChannel.default('telegram'),
60
+ priority: NotificationPriority.default('normal'),
61
+ workspaceId: z.string().optional(),
62
+ sessionId: z.string().optional(),
63
+ jobId: z.string().optional(),
64
+ title: NonEmptyString,
65
+ message: NonEmptyString,
66
+ data: z.record(z.string(), z.unknown()).optional(),
67
+ buttons: z.array(z.object({
68
+ text: NonEmptyString,
69
+ action: NonEmptyString,
70
+ targetId: z.string().optional(),
71
+ url: z.string().url().optional(),
72
+ })).optional(),
73
+ metadata: z.record(z.string(), z.unknown()).optional(),
74
+ });
75
+
76
+ export type NotificationCreate = z.infer<typeof NotificationCreate>;
77
+
78
+ /**
79
+ * Notification filter
80
+ */
81
+ export const NotificationFilter = z.object({
82
+ workspaceId: z.string().optional(),
83
+ sessionId: z.string().optional(),
84
+ jobId: z.string().optional(),
85
+ channel: NotificationChannel.optional(),
86
+ priority: NotificationPriority.optional(),
87
+ since: Timestamp.optional(),
88
+ until: Timestamp.optional(),
89
+ limit: z.number().int().positive().max(100).default(50),
90
+ cursor: z.string().optional(),
91
+ });
92
+
93
+ export type NotificationFilter = z.infer<typeof NotificationFilter>;
94
+
95
+ /**
96
+ * Notification list response
97
+ */
98
+ export const NotificationList = z.object({
99
+ items: z.array(Notification),
100
+ nextCursor: z.string().optional(),
101
+ total: z.number().optional(),
102
+ });
103
+
104
+ export type NotificationList = z.infer<typeof NotificationList>;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Project schemas for pi-harness
3
+ */
4
+
5
+ import { z } from 'zod';
6
+ import { Timestamp, UUID, NonEmptyString } from './base.js';
7
+
8
+ /**
9
+ * Project status
10
+ */
11
+ export const ProjectStatus = z.enum([
12
+ 'active',
13
+ 'archived',
14
+ 'deleted',
15
+ ]);
16
+
17
+ export type ProjectStatus = z.infer<typeof ProjectStatus>;
18
+
19
+ /**
20
+ * Project definition
21
+ */
22
+ export const Project = z.object({
23
+ id: UUID,
24
+ name: NonEmptyString,
25
+ path: NonEmptyString,
26
+ status: ProjectStatus.default('active'),
27
+ workspaceId: z.string(),
28
+ createdAt: Timestamp,
29
+ updatedAt: Timestamp,
30
+ lastAccessedAt: Timestamp.optional(),
31
+ metadata: z.record(z.string(), z.unknown()).optional(),
32
+ });
33
+
34
+ export type Project = z.infer<typeof Project>;
35
+
36
+ /**
37
+ * Project creation input
38
+ */
39
+ export const ProjectCreate = z.object({
40
+ name: NonEmptyString,
41
+ path: NonEmptyString,
42
+ workspaceId: z.string(),
43
+ metadata: z.record(z.string(), z.unknown()).optional(),
44
+ });
45
+
46
+ export type ProjectCreate = z.infer<typeof ProjectCreate>;
47
+
48
+ /**
49
+ * Project update input
50
+ */
51
+ export const ProjectUpdate = z.object({
52
+ name: NonEmptyString.optional(),
53
+ status: ProjectStatus.optional(),
54
+ metadata: z.record(z.string(), z.unknown()).optional(),
55
+ });
56
+
57
+ export type ProjectUpdate = z.infer<typeof ProjectUpdate>;
58
+
59
+ /**
60
+ * Project filter
61
+ */
62
+ export const ProjectFilter = z.object({
63
+ workspaceId: z.string().optional(),
64
+ status: ProjectStatus.optional(),
65
+ search: z.string().optional(),
66
+ limit: z.number().int().positive().max(100).default(50),
67
+ cursor: z.string().optional(),
68
+ });
69
+
70
+ export type ProjectFilter = z.infer<typeof ProjectFilter>;
71
+
72
+ /**
73
+ * Project list response
74
+ */
75
+ export const ProjectList = z.object({
76
+ items: z.array(Project),
77
+ nextCursor: z.string().optional(),
78
+ total: z.number().optional(),
79
+ });
80
+
81
+ export type ProjectList = z.infer<typeof ProjectList>;
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Session schemas for pi-harness
3
+ */
4
+
5
+ import { z } from 'zod';
6
+ import { Timestamp, UUID, NonEmptyString } from './base.js';
7
+
8
+ /**
9
+ * Session status
10
+ */
11
+ export const SessionStatus = z.enum([
12
+ 'active',
13
+ 'idle',
14
+ 'suspended',
15
+ 'ended',
16
+ ]);
17
+
18
+ export type SessionStatus = z.infer<typeof SessionStatus>;
19
+
20
+ /**
21
+ * Session type
22
+ */
23
+ export const SessionType = z.enum([
24
+ 'interactive',
25
+ 'batch',
26
+ 'background',
27
+ 'review',
28
+ ]);
29
+
30
+ export type SessionType = z.infer<typeof SessionType>;
31
+
32
+ /**
33
+ * Session definition
34
+ */
35
+ export const Session = z.object({
36
+ id: UUID,
37
+ type: SessionType,
38
+ status: SessionStatus,
39
+ workspaceId: z.string(),
40
+ provider: NonEmptyString,
41
+ model: z.string().optional(),
42
+ startedAt: Timestamp,
43
+ endedAt: Timestamp.optional(),
44
+ lastActivityAt: Timestamp.optional(),
45
+ promptTokens: z.number().int().nonnegative().default(0),
46
+ completionTokens: z.number().int().nonnegative().default(0),
47
+ cost: z.number().nonnegative().default(0),
48
+ metadata: z.record(z.string(), z.unknown()).optional(),
49
+ });
50
+
51
+ export type Session = z.infer<typeof Session>;
52
+
53
+ /**
54
+ * Session creation input
55
+ */
56
+ export const SessionCreate = z.object({
57
+ type: SessionType.default('interactive'),
58
+ workspaceId: z.string(),
59
+ provider: NonEmptyString,
60
+ model: z.string().optional(),
61
+ metadata: z.record(z.string(), z.unknown()).optional(),
62
+ });
63
+
64
+ export type SessionCreate = z.infer<typeof SessionCreate>;
65
+
66
+ /**
67
+ * Session update input
68
+ */
69
+ export const SessionUpdate = z.object({
70
+ status: SessionStatus.optional(),
71
+ lastActivityAt: Timestamp.optional(),
72
+ promptTokens: z.number().int().nonnegative().optional(),
73
+ completionTokens: z.number().int().nonnegative().optional(),
74
+ cost: z.number().nonnegative().optional(),
75
+ metadata: z.record(z.string(), z.unknown()).optional(),
76
+ });
77
+
78
+ export type SessionUpdate = z.infer<typeof SessionUpdate>;
79
+
80
+ /**
81
+ * Session filter
82
+ */
83
+ export const SessionFilter = z.object({
84
+ workspaceId: z.string().optional(),
85
+ type: SessionType.optional(),
86
+ status: SessionStatus.optional(),
87
+ since: Timestamp.optional(),
88
+ until: Timestamp.optional(),
89
+ limit: z.number().int().positive().max(100).default(50),
90
+ cursor: z.string().optional(),
91
+ });
92
+
93
+ export type SessionFilter = z.infer<typeof SessionFilter>;
94
+
95
+ /**
96
+ * Session list response
97
+ */
98
+ export const SessionList = z.object({
99
+ items: z.array(Session),
100
+ nextCursor: z.string().optional(),
101
+ total: z.number().optional(),
102
+ });
103
+
104
+ export type SessionList = z.infer<typeof SessionList>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cookie-sanitizer",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "description": "pi-harness-runtime — cookie sanitizer (provider-quota cookie file normaliser)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cost-optimizer",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "description": "Cost Optimizer for pi-harness-runtime — budget tracking, forecasting, and model selection optimization",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/dependency-analyzer",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/django-plugin",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "description": "Django framework analysis — models, management commands, settings",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/doc-generator",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "description": "Auto-Doc Generator — generate documentation from source code (RFC-0014)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/durable-review",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "description": "SQLite-backed durable reviewer using @earendil-works/pi-durable",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/e2e-tester",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "description": "WebMCP-powered E2E testing for pi-harness - natural language test scenarios",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/evaluation-engine",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "description": "Evaluation engine for pi-harness runtime (RFC-0057)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/evaluation-runner",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "type": "module",
5
5
  "description": "Framework-agnostic evaluation framework for AI outputs (RFC-0020)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/event-bus",
3
- "version": "1.1.335",
3
+ "version": "1.1.337",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Event Sink - Atomic Event Sourcing
3
+ *
4
+ * Inspired by T3Code's orchestrator event sourcing:
5
+ * - Commands serialize to event log
6
+ * - EventSink commits events + projections + outbox effects atomically
7
+ * - EffectWorker performs side effects AFTER intent commits
8
+ * - Command acknowledgement = intent committed, not work finished
9
+ */
10
+ export { EventSink } from './sink.js';
11
+ export { ProjectionStore } from './projection.js';
12
+ export { OutboxWorker } from './outbox.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Event Sink - Atomic Event Sourcing
3
+ *
4
+ * Inspired by T3Code's orchestrator event sourcing:
5
+ * - Commands serialize to event log
6
+ * - EventSink commits events + projections + outbox effects atomically
7
+ * - EffectWorker performs side effects AFTER intent commits
8
+ * - Command acknowledgement = intent committed, not work finished
9
+ */
10
+ export { EventSink } from './sink.js';
11
+ export { ProjectionStore } from './projection.js';
12
+ export { OutboxWorker } from './outbox.js';
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Outbox Worker
3
+ *
4
+ * Processes outbox entries after events are committed.
5
+ * Side effects are performed asynchronously.
6
+ */
7
+ import type { OutboxEntry } from './sink.js';
8
+ /**
9
+ * Effect handler function
10
+ */
11
+ export type EffectHandler = (payload: unknown) => Promise<void>;
12
+ /**
13
+ * Outbox Worker options
14
+ */
15
+ export interface OutboxWorkerOptions {
16
+ /** Maximum retry attempts */
17
+ maxRetries?: number;
18
+ /** Retry delay in ms */
19
+ retryDelay?: number;
20
+ /** Effect handlers */
21
+ handlers?: Record<string, EffectHandler>;
22
+ }
23
+ /**
24
+ * Outbox Worker
25
+ *
26
+ * Processes pending outbox entries and executes their effects.
27
+ */
28
+ export declare class OutboxWorker {
29
+ private maxRetries;
30
+ private retryDelay;
31
+ private handlers;
32
+ private running;
33
+ private interval?;
34
+ constructor(options?: OutboxWorkerOptions);
35
+ /**
36
+ * Register an effect handler
37
+ */
38
+ register(effect: string, handler: EffectHandler): void;
39
+ /**
40
+ * Start processing outbox
41
+ */
42
+ start(getPending: () => Promise<OutboxEntry[]>, updateStatus: (id: string, status: OutboxEntry['status'], error?: string) => Promise<void>, pollInterval?: number): void;
43
+ /**
44
+ * Stop processing
45
+ */
46
+ stop(): void;
47
+ /**
48
+ * Check if running
49
+ */
50
+ isRunning(): boolean;
51
+ }
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Outbox Worker
3
+ *
4
+ * Processes outbox entries after events are committed.
5
+ * Side effects are performed asynchronously.
6
+ */
7
+ /**
8
+ * Outbox Worker
9
+ *
10
+ * Processes pending outbox entries and executes their effects.
11
+ */
12
+ export class OutboxWorker {
13
+ maxRetries;
14
+ retryDelay;
15
+ handlers = new Map();
16
+ running = false;
17
+ interval;
18
+ constructor(options = {}) {
19
+ this.maxRetries = options.maxRetries ?? 3;
20
+ this.retryDelay = options.retryDelay ?? 1000;
21
+ if (options.handlers) {
22
+ for (const [name, handler] of Object.entries(options.handlers)) {
23
+ this.handlers.set(name, handler);
24
+ }
25
+ }
26
+ }
27
+ /**
28
+ * Register an effect handler
29
+ */
30
+ register(effect, handler) {
31
+ this.handlers.set(effect, handler);
32
+ }
33
+ /**
34
+ * Start processing outbox
35
+ */
36
+ start(getPending, updateStatus, pollInterval = 1000) {
37
+ if (this.running)
38
+ return;
39
+ this.running = true;
40
+ this.interval = setInterval(async () => {
41
+ if (!this.running)
42
+ return;
43
+ try {
44
+ const entries = await getPending();
45
+ for (const entry of entries) {
46
+ if (!this.running)
47
+ break;
48
+ if (entry.attempts >= this.maxRetries) {
49
+ await updateStatus(entry.id, 'failed', 'Max retries exceeded');
50
+ continue;
51
+ }
52
+ const handler = this.handlers.get(entry.effect);
53
+ if (!handler) {
54
+ await updateStatus(entry.id, 'failed', `No handler for effect: ${entry.effect}`);
55
+ continue;
56
+ }
57
+ try {
58
+ await updateStatus(entry.id, 'processing');
59
+ await handler(entry.payload);
60
+ await updateStatus(entry.id, 'completed');
61
+ }
62
+ catch (error) {
63
+ await updateStatus(entry.id, 'failed', String(error));
64
+ }
65
+ }
66
+ }
67
+ catch (error) {
68
+ console.error('[OutboxWorker] Error processing outbox:', error);
69
+ }
70
+ }, pollInterval);
71
+ }
72
+ /**
73
+ * Stop processing
74
+ */
75
+ stop() {
76
+ this.running = false;
77
+ if (this.interval) {
78
+ clearInterval(this.interval);
79
+ this.interval = undefined;
80
+ }
81
+ }
82
+ /**
83
+ * Check if running
84
+ */
85
+ isRunning() {
86
+ return this.running;
87
+ }
88
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Projection Store
3
+ *
4
+ * Maintains materialized views of events for efficient queries.
5
+ * Projections are updated atomically with events.
6
+ */
7
+ import type { StoredEvent } from './sink.js';
8
+ /**
9
+ * Projection function type
10
+ */
11
+ export type ProjectionFn<T> = (state: T | null, event: StoredEvent) => T;
12
+ /**
13
+ * Projection Store
14
+ */
15
+ export declare class ProjectionStore {
16
+ private projections;
17
+ /**
18
+ * Register a projection
19
+ */
20
+ register<T>(projection: {
21
+ name: string;
22
+ initialState: T;
23
+ reduce: ProjectionFn<T>;
24
+ }): void;
25
+ /**
26
+ * Apply events to all projections
27
+ */
28
+ apply(events: StoredEvent[]): void;
29
+ /**
30
+ * Get projection state
31
+ */
32
+ get<T>(name: string): T | null;
33
+ /**
34
+ * Reset projection to initial state
35
+ */
36
+ reset(name: string): void;
37
+ /**
38
+ * List all projection names
39
+ */
40
+ list(): string[];
41
+ }