@atolis-hq/wake 0.3.15 → 0.3.17

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.
package/README.md CHANGED
@@ -173,6 +173,7 @@ any time for the full command list, or see
173
173
  - [docs/workflows.md](docs/workflows.md) - how stages, prompts, and runner routes are configured.
174
174
  - [docs/prompts.md](docs/prompts.md) - how prompt templates map to workflow stages.
175
175
  - [docs/configuration.md](docs/configuration.md) - `config.yaml`/`config.workflows.yaml` options and the operator correlation escape hatch.
176
+ - [docs/public-ui-access.md](docs/public-ui-access.md) - expose the operator UI through ngrok or another secured ingress.
176
177
  - [docs/development.md](docs/development.md) - source-checkout dev setup (`wake-dev`), npm scripts, formatting, self-update, GitHub polling.
177
178
  - [docs/runner-comparison.md](docs/runner-comparison.md) - capability differences between supported runners.
178
179
 
@@ -204,6 +204,7 @@ async function composeIntegrationRuntime(input) {
204
204
  registry.register(fakeProviderDefinition);
205
205
  registry.register(gitHubProviderDefinition);
206
206
  const { instances, failures: providerFailures } = registry.compose(await hydrateFakeProviderEvidence(input.wakeRoot, input.config.integrations), {
207
+ publicUiUrl: input.config.surfaces.web.publicUrl,
207
208
  work: input.work,
208
209
  resources: input.resources,
209
210
  resourceLookup: input.lookup,
@@ -108,4 +108,4 @@ export function resolveWakeVersion(options = {}) {
108
108
  return `g${headHash.slice(0, 7)}`;
109
109
  return '0.1.0-dev';
110
110
  }
111
- export const wakeVersion = "g41ad0c0";
111
+ export const wakeVersion = "g4cf4a17";
@@ -1,29 +1,29 @@
1
- import { spawn } from 'node:child_process';
1
+ import { execa } from 'execa';
2
2
  export function runProcess(command, args, cwd, signal, timeoutMs) {
3
- const child = spawn(command, args, { cwd, shell: false, stdio: ['ignore', 'pipe', 'pipe'] });
4
- const result = new Promise((resolve, reject) => {
5
- let stdout = '';
6
- let stderr = '';
7
- let timedOut = false;
8
- const timeout = timeoutMs === undefined
9
- ? undefined
10
- : setTimeout(() => {
11
- timedOut = true;
12
- child.kill();
13
- }, timeoutMs);
14
- child.stdout.on('data', (chunk) => (stdout += chunk.toString()));
15
- child.stderr.on('data', (chunk) => (stderr += chunk.toString()));
16
- child.once('error', (error) => {
17
- if (timeout !== undefined)
18
- clearTimeout(timeout);
19
- reject(error);
20
- });
21
- child.once('close', (exitCode) => {
22
- if (timeout !== undefined)
23
- clearTimeout(timeout);
24
- resolve({ stdout, stderr, exitCode, timedOut });
25
- });
3
+ const child = execa(command, args, {
4
+ ...(cwd === undefined ? {} : { cwd }),
5
+ shell: false,
6
+ stdin: 'ignore',
7
+ stdout: 'pipe',
8
+ stderr: 'pipe',
9
+ cancelSignal: signal,
10
+ ...(timeoutMs === undefined ? {} : { timeout: timeoutMs }),
11
+ reject: false,
12
+ stripFinalNewline: false,
26
13
  });
27
- signal.addEventListener('abort', () => child.kill(), { once: true });
28
- return { result, cancel: async () => void child.kill() };
14
+ return {
15
+ result: child.then((result) => ({
16
+ stdout: result.stdout,
17
+ stderr: result.stderr,
18
+ exitCode: result.exitCode,
19
+ timedOut: result.timedOut,
20
+ ...(result.isMaxBuffer
21
+ ? {
22
+ failureKind: 'output-limit',
23
+ ...(result.shortMessage === undefined ? {} : { failureMessage: result.shortMessage }),
24
+ }
25
+ : {}),
26
+ })),
27
+ cancel: async () => void child.kill(),
28
+ };
29
29
  }
@@ -99,10 +99,12 @@ export function cliRunner(name, command, args, options = {}) {
99
99
  output: value.stdout,
100
100
  runner: name,
101
101
  failure: {
102
- kind: value.timedOut ? ExecutionCancellationReason.Timeout : 'process-exit',
102
+ kind: value.timedOut
103
+ ? ExecutionCancellationReason.Timeout
104
+ : (value.failureKind ?? 'process-exit'),
103
105
  message: value.timedOut
104
106
  ? `Runner timed out after ${options.timeoutMs}ms`
105
- : value.stderr || `exit ${value.exitCode}`,
107
+ : (value.failureMessage ?? (value.stderr || `exit ${value.exitCode}`)),
106
108
  },
107
109
  }),
108
110
  cancel: process.cancel,
@@ -3,7 +3,7 @@ export function formatAgentRunComment(value) {
3
3
  const sections = [
4
4
  '<!-- wake:agent -->',
5
5
  `<!-- wake:delivery:${value.idempotencyKey} -->`,
6
- `**Wake** _(Wake${details ? ` - ${details}` : ''})_`,
6
+ `**${wakeHeading(value.publicUiUrl)}** _(Wake${details ? ` - ${details}` : ''})_`,
7
7
  `**Outcome:** ${value.awaitingApproval === true ? '⏳ Awaiting approval' : outcome(value.outcome)}`,
8
8
  value.displayBody.trim() || fallback(value.outcome),
9
9
  ];
@@ -19,6 +19,9 @@ export function formatAgentRunComment(value) {
19
19
  sections.push(marker);
20
20
  return sections.join('\n\n');
21
21
  }
22
+ function wakeHeading(publicUiUrl) {
23
+ return publicUiUrl === undefined ? 'Wake' : `[Wake](${publicUiUrl})`;
24
+ }
22
25
  function watchGateMarkerSection(value) {
23
26
  if (value.watchGateVerdict === undefined)
24
27
  return undefined;
@@ -3,7 +3,7 @@ import { DeliveryIntentKind } from '../../delivery/contracts/vocabulary.js';
3
3
  import { parseGitHubResourceKey } from '../contracts/external-key.js';
4
4
  import { GitHubAdapter, GitHubOutboundAction, } from '../contracts/vocabulary.js';
5
5
  import { formatAgentRunComment } from './agent-run-comment.js';
6
- export function translateGitHubOutbound(resource, intent) {
6
+ export function translateGitHubOutbound(resource, intent, options = {}) {
7
7
  if (resource.externalKey.adapter !== GitHubAdapter)
8
8
  throw new Error('Resource is not a GitHub resource');
9
9
  const { owner, repo, number } = parseGitHubResourceKey(resource.externalKey.key);
@@ -20,6 +20,7 @@ export function translateGitHubOutbound(resource, intent) {
20
20
  body: formatAgentRunComment({
21
21
  idempotencyKey: intent.intentEventId,
22
22
  ...intent.payload.report,
23
+ publicUiUrl: options.publicUiUrl,
23
24
  }),
24
25
  }
25
26
  : 'body' in intent.payload
@@ -35,7 +35,12 @@ export const gitHubProviderDefinition = {
35
35
  const resource = await services.resources.get(resourceId(intent.resourceId));
36
36
  if (resource === null)
37
37
  throw new Error(`GitHub resource ${intent.resourceId} is unavailable`);
38
- return client.deliver({ ...translateGitHubOutbound(resource, intent), idempotencyKey });
38
+ return client.deliver({
39
+ ...translateGitHubOutbound(resource, intent, {
40
+ publicUiUrl: services.publicUiUrl,
41
+ }),
42
+ idempotencyKey,
43
+ });
39
44
  }, async (intent) => {
40
45
  if (intent.kind !== BuiltInActivityName.IssueComplete)
41
46
  return null;
@@ -10,7 +10,17 @@ export const surfacesConfigSchema = z
10
10
  .strict()
11
11
  .default({ enabled: false, host: '127.0.0.1', port: 4317 }),
12
12
  web: z
13
- .object({ enabled: z.boolean().default(false) })
13
+ .object({
14
+ enabled: z.boolean().default(false),
15
+ publicUrl: z
16
+ .string()
17
+ .trim()
18
+ .url()
19
+ .refine((value) => new URL(value).protocol === 'https:', {
20
+ message: 'Web public URL must use HTTPS',
21
+ })
22
+ .optional(),
23
+ })
14
24
  .strict()
15
25
  .default({ enabled: false }),
16
26
  })
@@ -30,5 +40,8 @@ export const surfacesConfigSchema = z
30
40
  host: value.api.host ?? '127.0.0.1',
31
41
  port: value.api.port ?? 4317,
32
42
  },
33
- web: { enabled: value.web.enabled ?? false },
43
+ web: {
44
+ enabled: value.web.enabled ?? false,
45
+ ...(value.web.publicUrl === undefined ? {} : { publicUrl: value.web.publicUrl }),
46
+ },
34
47
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atolis-hq/wake",
3
- "version": "0.3.15",
3
+ "version": "0.3.17",
4
4
  "description": "Local autonomous agent control plane for software development",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -66,6 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@octokit/rest": "^22.0.0",
69
+ "execa": "^10.0.1",
69
70
  "handlebars": "^4.7.9",
70
71
  "ulid": "^3.0.2",
71
72
  "yaml": "^2.9.0",