@bevel-software/platform-shared 0.12.0 → 0.12.1

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.
@@ -93,6 +93,50 @@ export interface FsTreeChangedEvent {
93
93
  workspaceId: string;
94
94
  branch: string;
95
95
  }
96
+ /**
97
+ * A commit landed locally but could not be pushed to the remote.
98
+ *
99
+ * Saving is deliberately not blocked on this: the commit is safe on the
100
+ * workspace volume and the next push may well carry it, so the write still
101
+ * reports success and the recovery paths (cooperative pull-rebase, the
102
+ * pending-commit queue's retries, the agent hand-off) keep running. What this
103
+ * event adds is VISIBILITY. Without it a deployment whose pushes are all
104
+ * failing — a bad token, an expired one, a revoked repo grant — looks
105
+ * completely healthy from the UI while commits pile up locally, which is
106
+ * exactly how one self-hosted install got 136 commits and two days deep
107
+ * before anyone noticed.
108
+ *
109
+ * `reason` is the sanitised git error, for the log-shaped detail line under
110
+ * the banner; anything credential-bearing is already masked out of it. The UI
111
+ * should point at the server logs rather than try to explain git to the user —
112
+ * every actionable cause here is an operator concern, not an author's.
113
+ *
114
+ * Workspace-scoped: everyone editing this branch has work sitting unpushed,
115
+ * not just whoever happened to trigger the failing push.
116
+ *
117
+ * Emitted on every failure rather than only on the first, so a session that
118
+ * connects mid-outage learns about it on the next save instead of waiting for
119
+ * a state it already missed. Clients treat repeats as idempotent.
120
+ */
121
+ export interface GitSyncFailedEvent {
122
+ kind: 'git-sync-failed';
123
+ workspaceId: string;
124
+ branch: string;
125
+ /** Sanitised git error — safe to display, tokens already redacted. */
126
+ reason: string;
127
+ }
128
+ /**
129
+ * A push succeeded on a workspace whose previous push had failed — the
130
+ * counterpart to `git-sync-failed`, and the signal that clears its banner.
131
+ *
132
+ * Only emitted on that transition. A push runs on every save, so announcing
133
+ * each healthy one would put a broadcast on the hot path to say nothing.
134
+ */
135
+ export interface GitSyncRecoveredEvent {
136
+ kind: 'git-sync-recovered';
137
+ workspaceId: string;
138
+ branch: string;
139
+ }
96
140
  /**
97
141
  * Agent called `switch_branch` mid-turn and the target validated +
98
142
  * pre-warmed successfully. Tells the frontend to navigate to the new draft
@@ -205,7 +249,7 @@ export interface ResyncEvent {
205
249
  /** Human-readable reason for logs / debugging. */
206
250
  reason: string;
207
251
  }
208
- export type WorkflowEventPayload = FileChangedEvent | LockAcquiredEvent | LockReleasedEvent | FsTreeChangedEvent | BranchSwitchedEvent | AgentToolCallEvent | ChangeRequestOpenedEvent | ChangeRequestMergedEvent | ChangeRequestRejectedEvent | ChangeRequestMergeFailedEvent | ApprovalChangedEvent | HeartbeatEvent | ResyncEvent;
252
+ export type WorkflowEventPayload = FileChangedEvent | LockAcquiredEvent | LockReleasedEvent | FsTreeChangedEvent | GitSyncFailedEvent | GitSyncRecoveredEvent | BranchSwitchedEvent | AgentToolCallEvent | ChangeRequestOpenedEvent | ChangeRequestMergedEvent | ChangeRequestRejectedEvent | ChangeRequestMergeFailedEvent | ApprovalChangedEvent | HeartbeatEvent | ResyncEvent;
209
253
  export type WorkflowEvent = WorkflowEventEnvelope & WorkflowEventPayload;
210
254
  /** True for events scoped to a workspace — the focus filter applies. */
211
255
  export declare function isWorkspaceScoped(e: WorkflowEventPayload): e is WorkflowEventPayload & {
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/workflow/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,EAAE,EAAE,MAAM,CAAC;CACZ;AAID;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,MAAM,EAAE,MAAM,GAAG,I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AG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAMnD"}
@@ -37,7 +37,9 @@ export function isWorkspaceScoped(e) {
37
37
  return (e.kind === 'file-changed' ||
38
38
  e.kind === 'lock-acquired' ||
39
39
  e.kind === 'lock-released' ||
40
- e.kind === 'fs-tree-changed');
40
+ e.kind === 'fs-tree-changed' ||
41
+ e.kind === 'git-sync-failed' ||
42
+ e.kind === 'git-sync-recovered');
41
43
  }
42
44
  /** True for events scoped to a specific user — the user filter applies. */
43
45
  export function isUserScoped(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/workflow/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAwNH,wEAAwE;AACxE,MAAM,UAAU,iBAAiB,CAC/B,CAAuB;IAEvB,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,cAAc;QACzB,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,iBAAiB,CAC7B,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,YAAY,CAC1B,CAAuB;IAEvB,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,6BAA6B,CACzC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/workflow/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAwQH,wEAAwE;AACxE,MAAM,UAAU,iBAAiB,CAC/B,CAAuB;IAEvB,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,cAAc;QACzB,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,oBAAoB,CAChC,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,YAAY,CAC1B,CAAuB;IAEvB,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,6BAA6B,CACzC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bevel-software/platform-shared",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Shared types and pure domain utilities of the Bevel core platform (auth, workspace, git/workflow contracts, branch registry).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -101,6 +101,52 @@ export interface FsTreeChangedEvent {
101
101
  branch: string;
102
102
  }
103
103
 
104
+ /**
105
+ * A commit landed locally but could not be pushed to the remote.
106
+ *
107
+ * Saving is deliberately not blocked on this: the commit is safe on the
108
+ * workspace volume and the next push may well carry it, so the write still
109
+ * reports success and the recovery paths (cooperative pull-rebase, the
110
+ * pending-commit queue's retries, the agent hand-off) keep running. What this
111
+ * event adds is VISIBILITY. Without it a deployment whose pushes are all
112
+ * failing — a bad token, an expired one, a revoked repo grant — looks
113
+ * completely healthy from the UI while commits pile up locally, which is
114
+ * exactly how one self-hosted install got 136 commits and two days deep
115
+ * before anyone noticed.
116
+ *
117
+ * `reason` is the sanitised git error, for the log-shaped detail line under
118
+ * the banner; anything credential-bearing is already masked out of it. The UI
119
+ * should point at the server logs rather than try to explain git to the user —
120
+ * every actionable cause here is an operator concern, not an author's.
121
+ *
122
+ * Workspace-scoped: everyone editing this branch has work sitting unpushed,
123
+ * not just whoever happened to trigger the failing push.
124
+ *
125
+ * Emitted on every failure rather than only on the first, so a session that
126
+ * connects mid-outage learns about it on the next save instead of waiting for
127
+ * a state it already missed. Clients treat repeats as idempotent.
128
+ */
129
+ export interface GitSyncFailedEvent {
130
+ kind: 'git-sync-failed';
131
+ workspaceId: string;
132
+ branch: string;
133
+ /** Sanitised git error — safe to display, tokens already redacted. */
134
+ reason: string;
135
+ }
136
+
137
+ /**
138
+ * A push succeeded on a workspace whose previous push had failed — the
139
+ * counterpart to `git-sync-failed`, and the signal that clears its banner.
140
+ *
141
+ * Only emitted on that transition. A push runs on every save, so announcing
142
+ * each healthy one would put a broadcast on the hot path to say nothing.
143
+ */
144
+ export interface GitSyncRecoveredEvent {
145
+ kind: 'git-sync-recovered';
146
+ workspaceId: string;
147
+ branch: string;
148
+ }
149
+
104
150
  // ── User-scoped ──────────────────────────────────────────────────────────────
105
151
 
106
152
  /**
@@ -235,6 +281,8 @@ export type WorkflowEventPayload =
235
281
  | LockAcquiredEvent
236
282
  | LockReleasedEvent
237
283
  | FsTreeChangedEvent
284
+ | GitSyncFailedEvent
285
+ | GitSyncRecoveredEvent
238
286
  | BranchSwitchedEvent
239
287
  | AgentToolCallEvent
240
288
  | ChangeRequestOpenedEvent
@@ -255,7 +303,9 @@ export function isWorkspaceScoped(
255
303
  e.kind === 'file-changed' ||
256
304
  e.kind === 'lock-acquired' ||
257
305
  e.kind === 'lock-released' ||
258
- e.kind === 'fs-tree-changed'
306
+ e.kind === 'fs-tree-changed' ||
307
+ e.kind === 'git-sync-failed' ||
308
+ e.kind === 'git-sync-recovered'
259
309
  );
260
310
  }
261
311