@astrosheep/square 0.3.70 → 0.3.72

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 (126) hide show
  1. package/dist/activity-feed.d.ts +4 -5
  2. package/dist/activity-feed.js +14 -10
  3. package/dist/artifact.d.ts +26 -33
  4. package/dist/artifact.js +346 -317
  5. package/dist/attention-presentation.js +2 -9
  6. package/dist/automatic-session.js +6 -6
  7. package/dist/boundary-presentation.js +3 -3
  8. package/dist/catch-decisions.d.ts +19 -12
  9. package/dist/catch-decisions.js +32 -68
  10. package/dist/claude-delivery.js +7 -7
  11. package/dist/claude-mod.js +18 -7
  12. package/dist/cli/catch-presentation.d.ts +7 -0
  13. package/dist/cli/catch-presentation.js +55 -0
  14. package/dist/cli/context.d.ts +1 -1
  15. package/dist/cli/context.js +5 -23
  16. package/dist/cli/express-presentation.d.ts +10 -0
  17. package/dist/cli/express-presentation.js +196 -0
  18. package/dist/cli/maintenance-commands.d.ts +4 -0
  19. package/dist/cli/maintenance-commands.js +29 -6
  20. package/dist/cli/observation-commands.d.ts +7 -5
  21. package/dist/cli/observation-commands.js +275 -262
  22. package/dist/cli/program.d.ts +1 -1
  23. package/dist/cli/program.js +43 -56
  24. package/dist/cli/registry.js +2 -1
  25. package/dist/cli/square-commands.d.ts +3 -9
  26. package/dist/cli/square-commands.js +134 -255
  27. package/dist/codex-queue.js +4 -1
  28. package/dist/decisions.d.ts +26 -74
  29. package/dist/decisions.js +190 -335
  30. package/dist/delivery-health.js +13 -22
  31. package/dist/delivery-operations.d.ts +0 -11
  32. package/dist/delivery-operations.js +44 -33
  33. package/dist/delivery.d.ts +33 -32
  34. package/dist/delivery.js +70 -81
  35. package/dist/help.js +6 -1
  36. package/dist/inbox.d.ts +27 -0
  37. package/dist/inbox.js +55 -18
  38. package/dist/index.d.ts +2 -4
  39. package/dist/index.js +1 -1
  40. package/dist/list.d.ts +7 -1
  41. package/dist/list.js +49 -122
  42. package/dist/mcp.d.ts +1 -1
  43. package/dist/mcp.js +7 -37
  44. package/dist/model.d.ts +4 -44
  45. package/dist/model.js +1 -3
  46. package/dist/notifications.d.ts +1 -1
  47. package/dist/notifications.js +13 -7
  48. package/dist/open-square.d.ts +16 -2
  49. package/dist/open-square.js +40 -1
  50. package/dist/packages/agent-delivery/src/claude.d.ts +2 -11
  51. package/dist/packages/agent-delivery/src/index.d.ts +2 -42
  52. package/dist/packages/agent-delivery/src/opencode.d.ts +2 -11
  53. package/dist/packages/agent-delivery/src/paseo.d.ts +2 -13
  54. package/dist/packages/agent-delivery/src/pi-client.d.ts +2 -9
  55. package/dist/packages/agent-delivery/src/types.d.ts +42 -0
  56. package/dist/participant-host.d.ts +6 -3
  57. package/dist/participant-host.js +44 -38
  58. package/dist/perception-projection.d.ts +6 -15
  59. package/dist/perception-projection.js +6 -26
  60. package/dist/plugins/opencode/delivery.js +9 -9
  61. package/dist/plugins/opencode/index.js +3 -3
  62. package/dist/ports.d.ts +156 -11
  63. package/dist/presentation-operations.d.ts +1 -1
  64. package/dist/presentation-operations.js +35 -44
  65. package/dist/presentation.d.ts +12 -19
  66. package/dist/presentation.js +33 -54
  67. package/dist/registry.d.ts +2 -0
  68. package/dist/registry.js +1 -1
  69. package/dist/routes.d.ts +7 -14
  70. package/dist/routes.js +34 -72
  71. package/dist/runtime.d.ts +12 -39
  72. package/dist/runtime.js +33 -164
  73. package/dist/square-actions.d.ts +11 -21
  74. package/dist/square-actions.js +171 -275
  75. package/dist/square-application.d.ts +31 -55
  76. package/dist/square-application.js +625 -141
  77. package/dist/square-core.d.ts +3 -94
  78. package/dist/square-core.js +8 -353
  79. package/dist/square-domain.d.ts +24 -0
  80. package/dist/square-domain.js +77 -0
  81. package/dist/square-facade.d.ts +360 -9
  82. package/dist/square-migration.d.ts +24 -0
  83. package/dist/square-migration.js +211 -0
  84. package/dist/square-projections.d.ts +2 -42
  85. package/dist/square-projections.js +1 -37
  86. package/dist/square-sqlite.d.ts +59 -0
  87. package/dist/square-sqlite.js +702 -0
  88. package/dist/stream.d.ts +3 -10
  89. package/dist/stream.js +81 -52
  90. package/dist/views.d.ts +27 -95
  91. package/dist/views.js +217 -87
  92. package/dist/wake-eligibility.d.ts +15 -5
  93. package/dist/wake-eligibility.js +32 -16
  94. package/dist/wakes.d.ts +3 -3
  95. package/dist/wakes.js +31 -27
  96. package/guides/application-facade-delivery-evidence.md +200 -0
  97. package/guides/application-facade-design.md +95 -0
  98. package/guides/change-waits.md +4 -4
  99. package/guides/migration.md +77 -0
  100. package/guides/postcommit-simplification-performance.md +36 -0
  101. package/guides/primitive-catch-consolidation.md +85 -0
  102. package/guides/primitive-history-consolidation.md +76 -0
  103. package/guides/primitive-status-consolidation.md +87 -0
  104. package/guides/primitive-storage-consolidation.md +128 -0
  105. package/guides/row-runtime-delivery-evidence.md +160 -0
  106. package/guides/row-storage-design.md +567 -0
  107. package/package.json +1 -1
  108. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  109. package/plugins/codex/.codex-plugin/plugin.json +1 -1
  110. package/plugins/opencode/delivery.ts +11 -11
  111. package/plugins/opencode/index.ts +3 -3
  112. package/plugins/paseo/client/square-message.tsx +77 -64
  113. package/plugins/paseo/shared/message.ts +16 -0
  114. package/plugins/pi/square-pi.js +5 -1
  115. package/dist/activity.d.ts +0 -14
  116. package/dist/activity.js +0 -248
  117. package/dist/square-file-adapter.d.ts +0 -26
  118. package/dist/square-file-adapter.js +0 -85
  119. package/dist/square-state.d.ts +0 -6
  120. package/dist/square-state.js +0 -138
  121. package/dist/square-storage.d.ts +0 -14
  122. package/dist/square-storage.js +0 -188
  123. package/dist/square-wiring.d.ts +0 -33
  124. package/dist/square-wiring.js +0 -109
  125. package/dist/watch.d.ts +0 -8
  126. package/dist/watch.js +0 -252
@@ -1,58 +1,34 @@
1
- import type { HostLedgerPort, WakeTransportPort } from './ports.js';
2
- import { statusPresentation, participantsPresentation } from './views.js';
3
- import type { Activity, CatchOptions, CatchResult, ExpressOptions, ExpressResult, HistoryQuery, ListenerChangeResult, ParticipantStatus, PerceivedActivity, OperationControl } from './square-facade.js';
4
- /** Final control coordinate shared by facade, actions, and application adapters. */
5
- export interface SquareApplicationContext {
6
- readonly cwd: string;
7
- readonly env: NodeJS.ProcessEnv;
8
- readonly squarePath?: string;
9
- readonly participant?: string;
10
- readonly clock?: () => number;
11
- readonly hostLedger?: HostLedgerPort;
12
- readonly wakeTransport?: WakeTransportPort;
13
- }
14
- export interface JoinApplicationOptions {
15
- readonly takeover?: boolean;
16
- }
17
- export interface JoinApplicationResult {
18
- readonly participant: string;
19
- readonly activity: Activity | null;
20
- readonly kind: 'joined' | 'reconnected' | 'taken-over';
21
- readonly participantCount: number;
22
- }
23
- export interface ExpressApplicationOptions extends ExpressOptions {
24
- readonly noWait?: boolean;
25
- }
26
- export interface ExpressApplicationResult extends ExpressResult {
27
- readonly waited: boolean;
28
- }
29
- export interface ApplicationStatus {
30
- readonly context: string;
31
- readonly actCount: number;
32
- readonly hardCap: number | null;
33
- readonly throttlePerMinute?: number;
34
- readonly held: {
35
- readonly by: string;
36
- readonly reason?: string;
37
- } | null;
38
- readonly participants: readonly ParticipantStatus[];
39
- }
40
- export type ApplicationParticipants = Awaited<ReturnType<typeof participantsPresentation>>;
41
- export type ApplicationStatusProjection = Awaited<ReturnType<typeof statusPresentation>>;
42
- export interface SquareApplication {
43
- join(options?: JoinApplicationOptions, control?: OperationControl): Promise<JoinApplicationResult>;
44
- express(body: string, options?: ExpressApplicationOptions, control?: OperationControl): Promise<ExpressApplicationResult>;
45
- catch(options?: CatchOptions, control?: OperationControl): Promise<CatchResult>;
1
+ import type { Activity, ExpressResult, HistoryQuery, OperationControl, Participant, ParticipantStatus, SquareApplication, SquareApplicationContext, SquareAtInput, SquareBuildInput, SquareSnapshot } from './square-facade.js';
2
+ export type * from './square-facade.js';
3
+ export { formatActivityId, parseActivityId, MAX_IDENTITY_SET_SIZE } from './square-core.js';
4
+ export { CATCH_DEFAULT_LIMIT, CATCH_MAX_LIMIT } from './catch-decisions.js';
5
+ export { HELD_WAIT_BUDGET_MS } from './runtime.js';
6
+ export { HISTORY_DEFAULT_LIMIT, HISTORY_MAX_LIMIT } from './views.js';
7
+ export { DEFAULT_LIST_DEPTH, MAX_LIST_DEPTH, DEFAULT_LIST_LIMIT, MAX_LIST_LIMIT } from './list.js';
8
+ /** Supported SDK resource. It owns one open artifact; application operations use
9
+ * the same owner functions directly, not an application -> SDK -> application chain. */
10
+ export declare class Square {
11
+ readonly location: string;
12
+ private readonly square;
13
+ private readonly transport;
14
+ private constructor();
15
+ static at(input: SquareAtInput, control?: OperationControl): Promise<Square>;
16
+ static build(input: SquareBuildInput): Promise<Square>;
17
+ static inMemory(input: Omit<SquareBuildInput, 'path'>): Square;
18
+ private handle;
19
+ join(name: string, control?: OperationControl): Promise<Participant>;
20
+ takeover(name: string, control?: OperationControl): Promise<Participant>;
21
+ doneOwnedSession(name: string, body: string, expectedEpoch: number, control?: OperationControl): Promise<ExpressResult>;
22
+ implicitJoin(name: string, control?: OperationControl): Promise<{
23
+ readonly state: 'joined' | 'active' | 'done';
24
+ readonly participant?: Participant;
25
+ }>;
26
+ participants(): Promise<ParticipantStatus[]>;
27
+ snapshot(control?: OperationControl): Promise<SquareSnapshot>;
46
28
  history(query?: HistoryQuery, control?: OperationControl): Promise<Activity[]>;
47
- listen(target: string, control?: OperationControl): Promise<ListenerChangeResult>;
48
- ignore(target: string, control?: OperationControl): Promise<ListenerChangeResult>;
49
- listening(control?: OperationControl): Promise<readonly string[]>;
50
- hold(reason?: string, control?: OperationControl): Promise<ExpressResult>;
51
- resume(control?: OperationControl): Promise<ExpressResult>;
52
- /** Leave without a message. Only an omitted or empty body is accepted. */
53
- done(body?: string, control?: OperationControl): Promise<ExpressResult>;
54
- status(): Promise<ApplicationStatusProjection>;
55
- participants(): Promise<ApplicationParticipants>;
29
+ recognize(env: NodeJS.ProcessEnv): Promise<Participant | null>;
30
+ close(): Promise<void>;
31
+ endOwnedSession(name: string, sessionId: string, expectedEpoch?: number): Promise<ExpressResult | null>;
32
+ retireEndedSessionRoutes(sessionId: string): Promise<void>;
56
33
  }
57
34
  export declare function createSquareApplication(context: SquareApplicationContext): SquareApplication;
58
- export type { CatchResult, PerceivedActivity };