gestalt-mobile 0.33.0 → 0.35.0

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.
@@ -15,16 +15,18 @@ export const autopilotWaitWakeConditions = [
15
15
  'processLimitBreached',
16
16
  'agentActivityChanged',
17
17
  ];
18
+ export const AUTOPILOT_WAIT_MIN_MS = 60_000;
19
+ export const AUTOPILOT_WAIT_MAX_MS = 86_400_000;
18
20
  export const gestaltAutopilotWaitLeaseDynamicTool = {
19
21
  type: 'function',
20
22
  name: GESTALT_AUTOPILOT_WAIT_LEASE_TOOL_NAME,
21
- description: 'Register a bounded observable wait for the current supervised session after an Autopilot probe. This cannot request human authority and never accepts transcript prose.',
23
+ description: 'Register one non-persistent Autopilot wait episode for the current supervised session. Version 2 may be called proactively for known long work and resumes on the first requested event or bounded maxWaitMs deadline; call it again in a later turn only if another long wait is justified. This cannot request human authority and never accepts transcript prose.',
22
24
  inputSchema: {
23
25
  type: 'object',
24
26
  additionalProperties: false,
25
27
  required: ['version', 'reportId', 'leaseId', 'wakeConditions'],
26
28
  properties: {
27
- version: { const: 1 },
29
+ version: { type: 'integer', enum: [1, 2] },
28
30
  reportId: { type: 'string', minLength: 1, maxLength: 128 },
29
31
  leaseId: { type: 'string', minLength: 1, maxLength: 128 },
30
32
  wakeConditions: {
@@ -34,11 +36,20 @@ export const gestaltAutopilotWaitLeaseDynamicTool = {
34
36
  uniqueItems: true,
35
37
  items: { type: 'string', enum: autopilotWaitWakeConditions },
36
38
  },
39
+ maxWaitMs: {
40
+ type: 'integer',
41
+ minimum: AUTOPILOT_WAIT_MIN_MS,
42
+ maximum: AUTOPILOT_WAIT_MAX_MS,
43
+ description: 'Version 2 safety deadline in milliseconds. An observable wake resumes earlier.',
44
+ },
37
45
  },
38
46
  },
39
47
  };
40
48
  export function parseAutopilotWaitLease(value) {
41
- if (!record(value) || Object.keys(value).length !== 4 || value.version !== 1)
49
+ if (!record(value) || (value.version !== 1 && value.version !== 2))
50
+ return null;
51
+ const expectedKeys = value.version === 1 ? 4 : 5;
52
+ if (Object.keys(value).length !== expectedKeys)
42
53
  return null;
43
54
  if (!bounded(value.reportId) || !bounded(value.leaseId) || !Array.isArray(value.wakeConditions))
44
55
  return null;
@@ -49,7 +60,19 @@ export function parseAutopilotWaitLease(value) {
49
60
  !wakeConditions.every((condition) => typeof condition === 'string' &&
50
61
  autopilotWaitWakeConditions.includes(condition)))
51
62
  return null;
52
- return { version: 1, reportId: value.reportId, leaseId: value.leaseId, wakeConditions };
63
+ if (value.version === 1)
64
+ return { version: 1, reportId: value.reportId, leaseId: value.leaseId, wakeConditions };
65
+ if (!Number.isSafeInteger(value.maxWaitMs) ||
66
+ value.maxWaitMs < AUTOPILOT_WAIT_MIN_MS ||
67
+ value.maxWaitMs > AUTOPILOT_WAIT_MAX_MS)
68
+ return null;
69
+ return {
70
+ version: 2,
71
+ reportId: value.reportId,
72
+ leaseId: value.leaseId,
73
+ wakeConditions,
74
+ maxWaitMs: value.maxWaitMs,
75
+ };
53
76
  }
54
77
  export function autopilotWaitLeaseToolResponse() {
55
78
  return { success: true, contentItems: [{ type: 'inputText', text: '{"accepted":true}' }] };
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (C) 2026 Dyne.org foundation
3
+ * Designed by Denis Roio <jaromil@dyne.org>
4
+ * SPDX-License-Identifier: AGPL-3.0-or-later
5
+ */
6
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gestalt-mobile",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "Mobile-first web relay for durable Codex development sessions",
5
5
  "keywords": [
6
6
  "codex",