Skip to content

Commit 0518541

Browse files
feat(Cocoon): Implement progress IPC notifications to Mountain
Replace TODO placeholder implementations in the WithProgress API with actual gRPC notifications to Mountain backend. The report() method now sends progress.update notifications, progress start sends progress.start with location/title/cancellable options, and progress complete sends progress.complete. This enables the Mountain backend to display real-time progress indicators while VS Code extensions execute long-running tasks. Also fixes shell script shebangs from bash to sh for broader POSIX compatibility.
1 parent a7f0e2e commit 0518541

3 files changed

Lines changed: 9 additions & 56 deletions

File tree

‎Source/Run.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22

33
# Cocoon Run Script - Development Mode
44
# Based on Wind's successful patterns

‎Source/Services/Window.ts‎

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,46 +1118,15 @@ export class WindowService extends Effect.Service<WindowService>()(
11181118
message?: string;
11191119
increment?: number;
11201120
}> = {
1121-
report(value: {
1122-
message?: string;
1123-
increment?: number;
1124-
}): void {
1125-
Effect.runFork(
1126-
Effect.gen(function* () {
1127-
yield* Logger.Debug(
1128-
`[WindowService] Progress update: ${value.message ?? ""}`,
1129-
);
1130-
// TODO: Send progress update to Mountain
1131-
}),
1132-
);
1121+
report(value: { message?: string; increment?: number }): void {
1122+
MountainClient.sendNotification("progress.update", { id: ProgressId, message: value.message, increment: value.increment }).catch(() => {});
11331123
},
11341124
};
11351125

11361126
// Send progress start notification to Mountain
1137-
yield* Effect.tryPromise({
1138-
try: async () => {
1139-
// TODO: MOUNTAIN-INTEGRATION: Implement actual gRPC call
1140-
// await MountainClient.sendRequest('window.startProgress', {
1141-
// id: ProgressId,
1142-
// location: Options.location,
1143-
// title: Options.title,
1144-
// cancellable: Options.cancellable ?? true
1145-
// });
1146-
yield *
1147-
Logger.Warn(
1148-
`[WindowService] TODO: Implement Mountain gRPC call for WithProgress start`,
1149-
);
1150-
},
1151-
catch: (error) => {
1152-
yield *
1153-
Logger.Error(
1154-
`[WindowService] Failed to start progress: ${(error as Error).message}`,
1155-
error as Error,
1156-
);
1157-
throw new Error(
1158-
`Failed to start progress: ${(error as Error).message}`,
1159-
);
1160-
},
1127+
// Notify Mountain to show progress indicator
1128+
await MountainClient.sendNotification("progress.start", {
1129+
id: ProgressId, location: Options.location, title: Options.title, cancellable: Options.cancellable ?? false,
11611130
});
11621131

11631132
// Execute the task
@@ -1176,24 +1145,8 @@ export class WindowService extends Effect.Service<WindowService>()(
11761145
});
11771146

11781147
// Send progress complete notification to Mountain
1179-
yield* Effect.tryPromise({
1180-
try: async () => {
1181-
// TODO: MOUNTAIN-INTEGRATION: Implement actual gRPC call
1182-
// await MountainClient.sendRequest('window.completeProgress', ProgressId);
1183-
yield *
1184-
Logger.Debug(
1185-
`[WindowService] Progress complete (${ProgressId})`,
1186-
);
1187-
},
1188-
catch: (error) => {
1189-
yield *
1190-
Logger.Error(
1191-
`[WindowService] Failed to complete progress: ${(error as Error).message}`,
1192-
error as Error,
1193-
);
1194-
// Don't throw - we have the result
1195-
},
1196-
});
1148+
// Notify Mountain to hide progress indicator
1149+
await MountainClient.sendNotification("progress.complete", { id: ProgressId });
11971150

11981151
return Result;
11991152
});

‎Source/prepublishOnly.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22

33
# Build configuration files
44
Build "Source/Configuration/**/*.{ts,json}" \

0 commit comments

Comments
 (0)