@atolis-hq/wake 0.4.23 → 0.4.25

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.
@@ -401,7 +401,7 @@ ENV WAKE_MAIN_JS=/app/dist/src/main.js
401
401
  # Startup ownership repair is best effort because bind-mounted paths or host
402
402
  # permissions may prevent chown. The bounded direct-child pass avoids traversing
403
403
  # accumulated runtime data.
404
- ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake /wake/workspaces; chown wake:wake /wake/.wake /wake/workspaces || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; if [ -n \\"$WAKE_HOME_INIT_DIRS\\" ]; then printf '%s\\n' \\"$WAKE_HOME_INIT_DIRS\\" | while IFS= read -r directory; do case \\"$directory\\" in \\"$WAKE_HOME_INIT_ROOT\\"/*) mkdir -p \\"$directory\\"; chown wake:wake \\"$directory\\" ;; *) exit 1 ;; esac; done; fi; exec su wake -s /bin/sh -c 'HOME=/home/wake exec node \\"$WAKE_MAIN_JS\\" sandbox-entrypoint --wake-root /wake'"]
404
+ ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake /wake/workspaces /wake/.wake/auth; chown wake:wake /wake/.wake /wake/workspaces /wake/.wake/auth || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; find /wake/.wake/auth -mindepth 1 -maxdepth 1 -type f -exec chown wake:wake {} + || true; if [ -n \\"$WAKE_HOME_INIT_DIRS\\" ]; then printf '%s\\n' \\"$WAKE_HOME_INIT_DIRS\\" | while IFS= read -r directory; do case \\"$directory\\" in \\"$WAKE_HOME_INIT_ROOT\\"/*) mkdir -p \\"$directory\\"; chown wake:wake \\"$directory\\" ;; *) exit 1 ;; esac; done; fi; exec su wake -s /bin/sh -c 'HOME=/home/wake exec node \\"$WAKE_MAIN_JS\\" sandbox-entrypoint --wake-root /wake'"]
405
405
  `;
406
406
  const packagedDockerfile = `# syntax=docker/dockerfile:1
407
407
  FROM node:24-bookworm-slim
@@ -468,7 +468,7 @@ EXPOSE 4317
468
468
  # Startup ownership repair is best effort because bind-mounted paths or host
469
469
  # permissions may prevent chown. The bounded direct-child pass avoids traversing
470
470
  # accumulated runtime data.
471
- ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake /wake/workspaces; chown wake:wake /wake/.wake /wake/workspaces || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; if [ -n \\"$WAKE_HOME_INIT_DIRS\\" ]; then printf '%s\\n' \\"$WAKE_HOME_INIT_DIRS\\" | while IFS= read -r directory; do case \\"$directory\\" in \\"$WAKE_HOME_INIT_ROOT\\"/*) mkdir -p \\"$directory\\"; chown wake:wake \\"$directory\\" ;; *) exit 1 ;; esac; done; fi; exec su wake -s /bin/sh -c 'HOME=/home/wake exec wake sandbox-entrypoint'"]
471
+ ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake /wake/workspaces /wake/.wake/auth; chown wake:wake /wake/.wake /wake/workspaces /wake/.wake/auth || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; find /wake/.wake/auth -mindepth 1 -maxdepth 1 -type f -exec chown wake:wake {} + || true; if [ -n \\"$WAKE_HOME_INIT_DIRS\\" ]; then printf '%s\\n' \\"$WAKE_HOME_INIT_DIRS\\" | while IFS= read -r directory; do case \\"$directory\\" in \\"$WAKE_HOME_INIT_ROOT\\"/*) mkdir -p \\"$directory\\"; chown wake:wake \\"$directory\\" ;; *) exit 1 ;; esac; done; fi; exec su wake -s /bin/sh -c 'HOME=/home/wake exec wake sandbox-entrypoint'"]
472
472
  `;
473
473
  /** Creates an immediately-valid, human-readable target Wake root. */
474
474
  export async function initialiseWakeRoot(wakeRoot) {
@@ -124,6 +124,6 @@ export function resolveWakeVersion(options = {}) {
124
124
  return `g${headHash.slice(0, 7)}`;
125
125
  return '0.1.0-dev';
126
126
  }
127
- export const wakeVersion = "v0.4.23";
127
+ export const wakeVersion = "v0.4.25";
128
128
  /** The registry-installable version used by packaged sandbox images. */
129
129
  export const wakePackageVersion = packageVersion(defaultRepoRoot) ?? wakeVersion;
@@ -5,6 +5,7 @@ import { WorkflowInstanceKind, WorkflowStatus } from '../contracts/vocabulary.js
5
5
  import { validateChildProvenance } from '../domain/child-policy.js';
6
6
  import { workflowEventData } from '../domain/decision-events.js';
7
7
  import { startInstance } from '../domain/interpreter.js';
8
+ import { appendWithIntentRecovery } from './durable-append.js';
8
9
  import { WorkflowDefinitionUnavailableError } from './workflow-definition-registry.js';
9
10
  const TERMINAL_OR_BLOCKED_STATUSES = new Set([
10
11
  WorkflowStatus.Blocked,
@@ -48,8 +49,17 @@ export class StartWorkflow {
48
49
  correlationId: context.correlationId,
49
50
  causationId: context.commandId,
50
51
  });
51
- if (decision.kind === 'append')
52
- await this.repository.append(command.workflowInstanceId, 0, decision.events);
52
+ if (decision.kind === 'append') {
53
+ const recovered = await appendWithIntentRecovery({
54
+ append: async () => {
55
+ await this.repository.append(command.workflowInstanceId, 0, decision.events);
56
+ },
57
+ load: () => this.repository.load(command.workflowInstanceId),
58
+ alreadyApplied: (reloaded) => reloaded.view !== null,
59
+ });
60
+ if (recovered !== undefined)
61
+ return recovered.view;
62
+ }
53
63
  return (await this.repository.loadRequired(command.workflowInstanceId)).view;
54
64
  }
55
65
  async isWorkItemOpen(workItemId) {
@@ -5,6 +5,6 @@ interface WorkspaceSandbox {
5
5
  readonly containerName: string;
6
6
  readonly wakeMountPath?: string;
7
7
  }
8
- /** Ensures the bind-mounted workspace root is usable by the unprivileged sandbox process. */
8
+ /** Ensures the bind-mounted workspace and auth roots are usable by the sandbox process. */
9
9
  export declare function ensureSandboxWorkspaceOwnership(docker: RootDockerExecutor, options: WorkspaceSandbox): Promise<void>;
10
10
  export {};
@@ -1,4 +1,4 @@
1
- /** Ensures the bind-mounted workspace root is usable by the unprivileged sandbox process. */
1
+ /** Ensures the bind-mounted workspace and auth roots are usable by the sandbox process. */
2
2
  export async function ensureSandboxWorkspaceOwnership(docker, options) {
3
3
  await docker.invoke([
4
4
  'exec',
@@ -7,8 +7,9 @@ export async function ensureSandboxWorkspaceOwnership(docker, options) {
7
7
  options.containerName,
8
8
  'sh',
9
9
  '-c',
10
- 'mkdir -p "$1" && chown wake:wake "$1"',
11
- 'wake-workspace-ownership',
10
+ 'mkdir -p "$1" "$2" && chown wake:wake "$1" "$2" && find "$2" -mindepth 1 -maxdepth 1 -type f -exec chown wake:wake {} +',
11
+ 'wake-sandbox-runtime-ownership',
12
12
  `${options.wakeMountPath ?? '/wake'}/workspaces`,
13
+ `${options.wakeMountPath ?? '/wake'}/.wake/auth`,
13
14
  ]);
14
15
  }
package/docker/Dockerfile CHANGED
@@ -82,4 +82,4 @@ ENV WAKE_MAIN_JS=/app/dist/src/main.js
82
82
  # Startup ownership repair is best effort because bind-mounted paths or host
83
83
  # permissions may prevent chown. The bounded direct-child pass avoids traversing
84
84
  # accumulated runtime data.
85
- ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake /wake/workspaces; chown wake:wake /wake/.wake /wake/workspaces || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; exec su wake -s /bin/sh -c 'if [ \"$WAKE_START_ENABLED\" = \"true\" ]; then exec node /app/dist/src/main.js start --wake-root /wake --no-sandbox; else exec sleep infinity; fi'"]
85
+ ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake /wake/workspaces /wake/.wake/auth; chown wake:wake /wake/.wake /wake/workspaces /wake/.wake/auth || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; find /wake/.wake/auth -mindepth 1 -maxdepth 1 -type f -exec chown wake:wake {} + || true; exec su wake -s /bin/sh -c 'if [ \"$WAKE_START_ENABLED\" = \"true\" ]; then exec node /app/dist/src/main.js start --wake-root /wake --no-sandbox; else exec sleep infinity; fi'"]
@@ -65,4 +65,4 @@ EXPOSE 4317
65
65
  # Startup ownership repair is best effort because bind-mounted paths or host
66
66
  # permissions may prevent chown. The bounded direct-child pass avoids traversing
67
67
  # accumulated runtime data.
68
- ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake /wake/workspaces; chown wake:wake /wake/.wake /wake/workspaces || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; exec su wake -s /bin/sh -c 'exec wake sandbox-entrypoint'"]
68
+ ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake /wake/workspaces /wake/.wake/auth; chown wake:wake /wake/.wake /wake/workspaces /wake/.wake/auth || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; find /wake/.wake/auth -mindepth 1 -maxdepth 1 -type f -exec chown wake:wake {} + || true; exec su wake -s /bin/sh -c 'exec wake sandbox-entrypoint'"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atolis-hq/wake",
3
- "version": "0.4.23",
3
+ "version": "0.4.25",
4
4
  "description": "Local autonomous agent control plane for software development",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {