instar 1.3.1668 → 1.3.1670
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/dist/commands/init.d.ts +6 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -25
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/machine.d.ts.map +1 -1
- package/dist/commands/machine.js +32 -0
- package/dist/commands/machine.js.map +1 -1
- package/dist/commands/server.d.ts +4 -1
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +216 -30
- package/dist/commands/server.js.map +1 -1
- package/dist/core/BackupManager.d.ts.map +1 -1
- package/dist/core/BackupManager.js +6 -0
- package/dist/core/BackupManager.js.map +1 -1
- package/dist/core/CodexLifecycleProductionComposition.d.ts +1 -1
- package/dist/core/CodexLifecycleProductionComposition.d.ts.map +1 -1
- package/dist/core/FileClassifier.d.ts.map +1 -1
- package/dist/core/FileClassifier.js +4 -0
- package/dist/core/FileClassifier.js.map +1 -1
- package/dist/core/ForwardedTopicContext.d.ts +6 -0
- package/dist/core/ForwardedTopicContext.d.ts.map +1 -1
- package/dist/core/ForwardedTopicContext.js +19 -0
- package/dist/core/ForwardedTopicContext.js.map +1 -1
- package/dist/core/MeshRpc.d.ts +4 -0
- package/dist/core/MeshRpc.d.ts.map +1 -1
- package/dist/core/MeshRpc.js +1 -0
- package/dist/core/MeshRpc.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts +41 -7
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +191 -25
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SessionManager.d.ts +2 -0
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +36 -8
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/SessionRouter.d.ts +3 -0
- package/dist/core/SessionRouter.d.ts.map +1 -1
- package/dist/core/SessionRouter.js +15 -0
- package/dist/core/SessionRouter.js.map +1 -1
- package/dist/core/StageAdvancer.d.ts +2 -0
- package/dist/core/StageAdvancer.d.ts.map +1 -1
- package/dist/core/StageAdvancer.js +19 -0
- package/dist/core/StageAdvancer.js.map +1 -1
- package/dist/core/WriteDomainRegistry.d.ts.map +1 -1
- package/dist/core/WriteDomainRegistry.js +22 -0
- package/dist/core/WriteDomainRegistry.js.map +1 -1
- package/dist/core/linuxBrowserProvision.d.ts +93 -0
- package/dist/core/linuxBrowserProvision.d.ts.map +1 -0
- package/dist/core/linuxBrowserProvision.js +254 -0
- package/dist/core/linuxBrowserProvision.js.map +1 -0
- package/dist/core/memorySessionPolicy.d.ts +4 -1
- package/dist/core/memorySessionPolicy.d.ts.map +1 -1
- package/dist/core/memorySessionPolicy.js +57 -15
- package/dist/core/memorySessionPolicy.js.map +1 -1
- package/dist/core/poolReadiness.d.ts +6 -3
- package/dist/core/poolReadiness.d.ts.map +1 -1
- package/dist/core/poolReadiness.js +6 -3
- package/dist/core/poolReadiness.js.map +1 -1
- package/dist/core/roleFollowRestart.d.ts +1 -1
- package/dist/core/roleFollowRestart.js +1 -1
- package/dist/core/sessionLiveProbe.d.ts +27 -0
- package/dist/core/sessionLiveProbe.d.ts.map +1 -0
- package/dist/core/sessionLiveProbe.js +31 -0
- package/dist/core/sessionLiveProbe.js.map +1 -0
- package/dist/core/sessionPoolPairActivation.d.ts +87 -0
- package/dist/core/sessionPoolPairActivation.d.ts.map +1 -0
- package/dist/core/sessionPoolPairActivation.js +229 -0
- package/dist/core/sessionPoolPairActivation.js.map +1 -0
- package/dist/core/sessionPoolPairGreen.d.ts +32 -0
- package/dist/core/sessionPoolPairGreen.d.ts.map +1 -0
- package/dist/core/sessionPoolPairGreen.js +51 -0
- package/dist/core/sessionPoolPairGreen.js.map +1 -0
- package/dist/core/telegramPairHandover.d.ts +27 -0
- package/dist/core/telegramPairHandover.d.ts.map +1 -0
- package/dist/core/telegramPairHandover.js +42 -0
- package/dist/core/telegramPairHandover.js.map +1 -0
- package/dist/core/types.d.ts +6 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/data/builtinSkillContent.d.ts +7 -2
- package/dist/data/builtinSkillContent.d.ts.map +1 -1
- package/dist/data/builtinSkillContent.js +34 -12
- package/dist/data/builtinSkillContent.js.map +1 -1
- package/dist/data/standards-guard-index.json +1 -1
- package/dist/data/standards-guard-index.meta.json +2 -2
- package/dist/data/standards-registry.meta.json +1 -1
- package/dist/messaging/MessageProcessingLedger.d.ts +6 -0
- package/dist/messaging/MessageProcessingLedger.d.ts.map +1 -1
- package/dist/messaging/MessageProcessingLedger.js +9 -0
- package/dist/messaging/MessageProcessingLedger.js.map +1 -1
- package/dist/messaging/slack/SlackAdapter.d.ts.map +1 -1
- package/dist/messaging/slack/SlackAdapter.js +4 -0
- package/dist/messaging/slack/SlackAdapter.js.map +1 -1
- package/dist/messaging/stuckMessageRecovery.d.ts +2 -0
- package/dist/messaging/stuckMessageRecovery.d.ts.map +1 -1
- package/dist/messaging/stuckMessageRecovery.js +19 -12
- package/dist/messaging/stuckMessageRecovery.js.map +1 -1
- package/dist/native/InstarWedgeCanary.app/Contents/MacOS/InstarWedgeCanary +0 -0
- package/dist/native/instar-desktop-host +0 -0
- package/dist/recommended/offerPrerequisites.d.ts.map +1 -1
- package/dist/recommended/offerPrerequisites.js +3 -0
- package/dist/recommended/offerPrerequisites.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +6 -1
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/scheduler/JobScheduler.d.ts.map +1 -1
- package/dist/scheduler/JobScheduler.js +15 -7
- package/dist/scheduler/JobScheduler.js.map +1 -1
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +7 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +24 -1
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/SecretDrop.d.ts +19 -0
- package/dist/server/SecretDrop.d.ts.map +1 -1
- package/dist/server/SecretDrop.js +4 -0
- package/dist/server/SecretDrop.js.map +1 -1
- package/dist/server/fileRoutes.d.ts.map +1 -1
- package/dist/server/fileRoutes.js +6 -0
- package/dist/server/fileRoutes.js.map +1 -1
- package/dist/server/machineRoutes.d.ts +5 -0
- package/dist/server/machineRoutes.d.ts.map +1 -1
- package/dist/server/machineRoutes.js +26 -0
- package/dist/server/machineRoutes.js.map +1 -1
- package/dist/server/mobilePairingRoutes.d.ts.map +1 -1
- package/dist/server/mobilePairingRoutes.js +4 -0
- package/dist/server/mobilePairingRoutes.js.map +1 -1
- package/dist/server/mobilePermissionsRoutes.d.ts +21 -2
- package/dist/server/mobilePermissionsRoutes.d.ts.map +1 -1
- package/dist/server/mobilePermissionsRoutes.js +86 -7
- package/dist/server/mobilePermissionsRoutes.js.map +1 -1
- package/dist/server/mobileSecretsRoutes.d.ts +34 -1
- package/dist/server/mobileSecretsRoutes.d.ts.map +1 -1
- package/dist/server/mobileSecretsRoutes.js +30 -2
- package/dist/server/mobileSecretsRoutes.js.map +1 -1
- package/dist/server/routes.d.ts +1 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +110 -14
- package/dist/server/routes.js.map +1 -1
- package/dist/testing/selfActionRegistry.d.ts.map +1 -1
- package/dist/testing/selfActionRegistry.js +31 -0
- package/dist/testing/selfActionRegistry.js.map +1 -1
- package/package.json +1 -1
- package/scripts/blocking-decision-surfaces-baseline.json +29 -9
- package/scripts/lint-blocking-decisions-declared.mjs +1 -1
- package/src/data/builtin-manifest.json +97 -97
- package/src/data/builtinSkillContent.ts +35 -12
- package/src/data/standards-guard-index.json +1 -1
- package/src/data/standards-guard-index.meta.json +2 -2
- package/src/data/standards-registry.meta.json +1 -1
- package/src/data/state-coherence-registry.json +18 -0
- package/src/scaffold/templates.ts +6 -1
- package/src/templates/scripts/browser/chrome-close.sh +1 -1
- package/src/templates/scripts/browser/chrome-js.sh +1 -1
- package/src/templates/scripts/browser/chrome-launch.sh +1 -1
- package/src/templates/scripts/browser/chrome-mainworld.sh +1 -1
- package/src/templates/scripts/browser/chrome-renew.sh +1 -1
- package/src/templates/scripts/browser/chrome-unsaved.sh +1 -1
- package/src/templates/scripts/browser/ndrive.sh +1 -1
- package/src/templates/scripts/browser/x-drive.py +1594 -0
- package/src/templates/scripts/browser/xdrive-provision.sh +87 -0
- package/src/templates/scripts/browser/xdrive.sh +120 -0
- package/src/templates/scripts/secret-drop-retrieve.mjs +60 -7
- package/upgrades/1.3.1669.md +60 -0
- package/upgrades/1.3.1670.md +27 -0
- package/upgrades/side-effects/failover-reanswer.md +82 -0
- package/upgrades/side-effects/lease-scheduler-role-continuity-release-fragment.md +40 -0
- package/upgrades/side-effects/lease-scheduler-role-continuity.md +43 -0
- package/upgrades/side-effects/legacy-default-job-reconciliation-release-fragment.md +40 -0
- package/upgrades/side-effects/legacy-default-job-reconciliation.md +47 -0
- package/upgrades/side-effects/memory-privacy-inbound-files.md +55 -0
- package/upgrades/side-effects/mobile-native-secrets-writes.md +19 -0
- package/upgrades/side-effects/normal-chrome-linux.md +84 -0
- package/upgrades/side-effects/session-pool-activation-at-pairing.md +53 -0
|
@@ -57,7 +57,7 @@ import { generateClaudeMd } from '../scaffold/templates.js';
|
|
|
57
57
|
import { CLAUDE_MD_DIFFERING_LINES_REL, CLAUDE_MD_LEGACY_BACKUP_REL, REFERENCE_DIR_REL, differingLinesPointer, renderDifferingLinesFile, REFERENCE_FILE_HEADER, extractOperatorContent, findCoreRegion, renderCoreRegion, renderLayoutClaudeMd, renderReferenceFiles, readTailStamp, stampTail, tailExtendsStamp, withoutTailStamp, } from '../scaffold/claudeMdLayout.js';
|
|
58
58
|
import { getMigrationDefaults, applyDefaults } from '../config/ConfigDefaults.js';
|
|
59
59
|
import { CANONICAL_FEEDBACK_URL, LEGACY_FEEDBACK_URLS } from './canonicalFeedback.js';
|
|
60
|
-
import { installBuiltinSkills, installBrowserScripts } from '../commands/init.js';
|
|
60
|
+
import { getDefaultJobs, installBuiltinSkills, installBrowserScripts } from '../commands/init.js';
|
|
61
61
|
import { crossesBreaking, writeLifelineRestartSignal } from './version-skew.js';
|
|
62
62
|
import { recordInstallProvenanceIfAbsent, hasInstallProvenanceRecord } from './ApprenticeshipStallGate.js';
|
|
63
63
|
import { IdentityManager } from '../threadline/client/IdentityManager.js';
|
|
@@ -88,7 +88,7 @@ import { matchTestIdentity, verifyAllowTestIdentity, loadTestIdentityKey, } from
|
|
|
88
88
|
import { readRegistryHighWater, setRegistryHighWater } from './registryHighWater.js';
|
|
89
89
|
import { ITERATIVE_CONVERGING_AUDIT_SKILL_CONTENT } from '../data/builtinSkillContent.js';
|
|
90
90
|
import { SUBSCRIPTION_SIGNIN_SKILL_CONTENT } from '../data/builtinSkillContent.js';
|
|
91
|
-
import { NORMAL_CHROME_BROWSER_SKILL_CONTENT, NORMAL_CHROME_BROWSER_SKILL_WINDOWS_APPENDIX } from '../data/builtinSkillContent.js';
|
|
91
|
+
import { NORMAL_CHROME_BROWSER_LINUX_SECTION, NORMAL_CHROME_BROWSER_SKILL_CONTENT, NORMAL_CHROME_BROWSER_SKILL_WINDOWS_APPENDIX } from '../data/builtinSkillContent.js';
|
|
92
92
|
import { ensureAgentOwnedMemoryAllHomes } from './AgentOwnedMemory.js';
|
|
93
93
|
import { migrateStageBReleaseConfig, verifyBundledStageBReleaseEvidence } from './StageBActivationGate.js';
|
|
94
94
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -198,6 +198,23 @@ A Telegram, Slack or app topic is the user's conversation. It is never a channel
|
|
|
198
198
|
- **When to use** (PROACTIVE): any time I am about to send a topic message whose reader is another session, job, desk or worker rather than the user.
|
|
199
199
|
`;
|
|
200
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Sharing at the first pairing (docs/specs/session-pool-activation-at-pairing.md). SHARED by
|
|
203
|
+
* `generateClaudeMd` and `migrateClaudeMd`. Content-sniff marker: the heading.
|
|
204
|
+
*/
|
|
205
|
+
export const PAIR_SHARING_CLAUDEMD_MARKER = '### Sharing between my machines starts at the first pairing';
|
|
206
|
+
export function PAIR_SHARING_CLAUDEMD_SECTION(port) {
|
|
207
|
+
return `
|
|
208
|
+
${PAIR_SHARING_CLAUDEMD_MARKER}
|
|
209
|
+
|
|
210
|
+
When I pair a second machine for the first time, sharing turns on by itself: both machines get the same settings, the first restarts once, and the bot token reaches the new machine sealed inside the pairing. After the pair has looked healthy for ten minutes, a new conversation can start on either machine. Nothing already running moves.
|
|
211
|
+
- It stays off if the owner has already set anything about sharing, set \`multiMachine.sessionPool.autoActivate\` to false, or uses paid routing. The pairing still works.
|
|
212
|
+
- If the new machine did not receive the token, pair that same machine again.
|
|
213
|
+
- Why it is or is not on: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/session-pool/readiness\`
|
|
214
|
+
- To turn it off: set \`multiMachine.sessionPool.enabled\` to false. It takes effect at once.
|
|
215
|
+
- **When to use** (PROACTIVE): the user asks "why is my second machine idle?", "is sharing on?" or is about to pair a machine.
|
|
216
|
+
`;
|
|
217
|
+
}
|
|
201
218
|
export const JOB_RESULT_SUPERVISION_CLAUDEMD_MARKER = '### Script result supervision records';
|
|
202
219
|
export function JOB_RESULT_SUPERVISION_CLAUDEMD_SECTION(port) {
|
|
203
220
|
return `
|
|
@@ -345,7 +362,16 @@ The Codex CLI reads ONE shared user config (\`$CODEX_HOME/config.toml\`, default
|
|
|
345
362
|
*/
|
|
346
363
|
export const NORMAL_CHROME_BROWSER_SKILL_V1_SHA256 = 'b440bad6f0d65c1c248dc9f2682183486dc118c74dd188194335ab4e0d3ecbd0';
|
|
347
364
|
/** Present only in the cross-platform skill text: the idempotency marker for migrateNormalChromeBrowserSkill. */
|
|
348
|
-
export const NORMAL_CHROME_BROWSER_SKILL_MARKER = '
|
|
365
|
+
export const NORMAL_CHROME_BROWSER_SKILL_MARKER = '### Linux (xdrive.sh, the agent display)';
|
|
366
|
+
/** The cross-platform appendix heading. An edited copy carrying it needs only its Linux subsection changed. */
|
|
367
|
+
export const NORMAL_CHROME_BROWSER_SKILL_APPENDIX_HEADING = '## Drivers by operating system';
|
|
368
|
+
/** The Linux subsection of the macOS + Windows text, before the driver existed. */
|
|
369
|
+
export const NORMAL_CHROME_BROWSER_SKILL_OLD_LINUX_HEADING = '### Linux (no Windows underneath)';
|
|
370
|
+
/**
|
|
371
|
+
* SHA-256 (LF-normalized) of the macOS + Windows SKILL.md
|
|
372
|
+
* (tests/fixtures/skills/normal-chrome-browser-v2.md pins the bytes; the unit test re-derives this).
|
|
373
|
+
*/
|
|
374
|
+
export const NORMAL_CHROME_BROWSER_SKILL_V2_SHA256 = '4577ca18462c0e7ef3f239ea8b14c55f5f3271dddd87042ecbf92ee8ad54451e';
|
|
349
375
|
/** The full heading of the retired Jev review-flag-shadow card (spec retire-staged-features-2026-10-25). */
|
|
350
376
|
export const JEV_REVIEW_FLAG_CARD_RETIRED_HEADING = '### Jev Review-Flag Shadow (log-only "does this reply need your review?" measurement)';
|
|
351
377
|
/**
|
|
@@ -445,18 +471,18 @@ Some web tasks must happen as a specific signed-in account, and account pages (s
|
|
|
445
471
|
}
|
|
446
472
|
/** The heading PR 2283 shipped (spec normal-chrome-builtin-skill); replaced in place by the heading below. */
|
|
447
473
|
export const NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING_V1 = '### Normal-Chrome browser (account-bound web tasks, macOS)';
|
|
448
|
-
/** The
|
|
449
|
-
export const
|
|
474
|
+
/** The macOS + Windows heading (spec normal-chrome-cross-platform); replaced in place by the heading below. */
|
|
475
|
+
export const NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING_V2 = '### Normal-Chrome browser (account-bound web tasks, macOS + Windows)';
|
|
476
|
+
/** The current heading (spec normal-chrome-linux); the content-sniff key for migrateClaudeMd and the shadows. */
|
|
477
|
+
export const NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING = '### Normal-Chrome browser (account-bound web tasks, macOS + Windows + Linux)';
|
|
450
478
|
/**
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
* drift. Content-sniff key: NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING; a section under the v1 heading
|
|
454
|
-
* is replaced in place.
|
|
479
|
+
* The CLAUDE.md section exactly as the cross-platform release rendered it. Kept so the migration can
|
|
480
|
+
* prove the section it replaces IS the shipped text, and leave an edited one alone.
|
|
455
481
|
*/
|
|
456
|
-
export function
|
|
482
|
+
export function NORMAL_CHROME_BROWSER_CLAUDEMD_SECTION_V2() {
|
|
457
483
|
return `
|
|
458
484
|
|
|
459
|
-
${
|
|
485
|
+
${NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING_V2}
|
|
460
486
|
|
|
461
487
|
Some web tasks must happen as a specific signed-in account, and account pages (sign-in, billing, settings, usage) often refuse or behave differently for an automated browser. The \`/normal-chrome-browser\` skill is the proven method on macOS AND Windows: a NORMAL Chrome per account profile, no remote-debugging port, no automation flags. Helpers in \`.instar/scripts/browser/\`: macOS \`chrome-launch.sh\` / \`chrome-js.sh\` / \`chrome-mainworld.sh\` (pid-targeted Apple Events, JavaScript in the page); Windows \`ndrive.sh\` running \`native-drive.ps1\` (written by PP: real OS input + the UI Automation tree; an agent in WSL is on Windows for this as long as \`ndrive.sh\` reaches \`powershell.exe\`). Linux with no Windows underneath is not built (ACT-138): say so plainly. Find the profile for an account with \`GET /playwright-profiles\` (503 = registry dark here: list the profile folders instead).
|
|
462
488
|
- **When to use** (PROACTIVE — this is the trigger): any web task that has to be done as a signed-in account; a page that blocks or misbehaves under Playwright/CDP; a button that stays disabled; and BEFORE ever telling the operator a browser task "can't be done".
|
|
@@ -465,6 +491,21 @@ Some web tasks must happen as a specific signed-in account, and account pages (s
|
|
|
465
491
|
- **Two rules that hold on every framework:** on Windows compare \`url\` at the HOST boundary (the display string must start with the expected host followed by \`/\`; never a substring match), and the "take focus anyway" override (\`ND_ALLOW_FOCUS_STEAL\`) works only against a record you write when the operator says the machine is unattended: \`normalChromeBrowser.unattendedMachine = {declaredBy, topicId, at}\` in \`.instar/config.json\`, with \`declaredBy\` taken from \`GET /topic-operator/<topicId>\` (the VERIFIED operator, never a name read in the message); with no verified operator, write nothing and say so. It expires after 30 days.
|
|
466
492
|
`;
|
|
467
493
|
}
|
|
494
|
+
/**
|
|
495
|
+
* Normal-Chrome browser awareness (specs normal-chrome-builtin-skill, normal-chrome-cross-platform,
|
|
496
|
+
* normal-chrome-linux). Shared by generateClaudeMd (new agents) and migrateClaudeMd (existing agents) so
|
|
497
|
+
* the two never drift. Content-sniff key: NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING; a shipped v1 or v2
|
|
498
|
+
* section is replaced in place.
|
|
499
|
+
*/
|
|
500
|
+
export function NORMAL_CHROME_BROWSER_CLAUDEMD_SECTION() {
|
|
501
|
+
const linux = 'Linux: `xdrive.sh` running `x-drive.py` on the agent\'s own private display (AT-SPI reads, real X input): `launch`, `url`, `title`, `text`, `find`, `click`, `type`, `key`, `nav`, `close`, `close --force`. Passwords only through Secret Drop: request with `browserHost`, then run the Secret Drop helper with `--browser`. No one-time codes, take-over or page JavaScript yet: say so plainly. New agents install what it needs at boot. On an existing agent, ask one yes/no naming what gets installed, then `POST /browser/linux/install`.';
|
|
502
|
+
const always = '**I always have a browser.** On a Linux server it is an ordinary Chrome on my own private display. Before saying a browser task can\'t be done, or that I have no browser, I check `GET /browser/state`. `not-built` and `broken` are states with a next step in the answer, never "no browser": I follow `nextStep`.';
|
|
503
|
+
return NORMAL_CHROME_BROWSER_CLAUDEMD_SECTION_V2()
|
|
504
|
+
.replace(NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING_V2, NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING)
|
|
505
|
+
.replace('is the proven method on macOS AND Windows:', 'is the proven method on macOS, Windows and Linux:')
|
|
506
|
+
.replace('Linux with no Windows underneath is not built (ACT-138): say so plainly.', linux)
|
|
507
|
+
.replace(/\n- \*\*When to use\*\*/, `\n- ${always}\n- **When to use**`);
|
|
508
|
+
}
|
|
468
509
|
/**
|
|
469
510
|
* Where a markdown section that starts at `heading` ends: the start of the next `##`/`###` heading
|
|
470
511
|
* line after it, or the end of the document. Shared by migrateClaudeMd (replace in place) and the
|
|
@@ -903,6 +944,14 @@ export function MOBILE_SECRETS_LINE(port) {
|
|
|
903
944
|
return `- The app's native Passwords & keys screen reads \`GET /mobile/secrets\` (what's waiting on each machine that answers, this machine's key names, whether the vault opens and whether keys sync; names only, never a value, length, token or Secret Drop link; owner phone or bearer): \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/mobile/secrets\`. Filling in a request stays the web page the person was sent.`;
|
|
904
945
|
}
|
|
905
946
|
export const MOBILE_SECRETS_MARKER = 'GET /mobile/secrets';
|
|
947
|
+
/**
|
|
948
|
+
* Asking for a key and cancelling a request from the phone (docs/specs/mobile-native-secrets-writes.md),
|
|
949
|
+
* one bullet after the Passwords & keys bullet. Sniff: `POST /mobile/secrets/requests/<key>/cancel`.
|
|
950
|
+
*/
|
|
951
|
+
export function MOBILE_SECRETS_WRITES_LINE(port) {
|
|
952
|
+
return `- The owner's phone can ask for a password or key (\`POST /mobile/secrets/requests\`) and cancel a waiting request (\`POST /mobile/secrets/requests/<key>/cancel\`) on http://localhost:${port}, each confirmed with Face ID over a single-use challenge, behind \`mobilePairing.permissionActions\`. The phone never gets the token or link: the owner collects the link in the console.`;
|
|
953
|
+
}
|
|
954
|
+
export const MOBILE_SECRETS_WRITES_MARKER = 'POST /mobile/secrets/requests/<key>/cancel';
|
|
906
955
|
/**
|
|
907
956
|
* The native Proposals / How I'm doing inside screens (docs/specs/mobile-native-proposals-inside.md),
|
|
908
957
|
* one bullet in the Mobile app routes block after the permissions bullet. Sniff: `GET /mobile/proposals`.
|
|
@@ -1030,6 +1079,7 @@ ${MOBILE_PHONES_MESSAGES_LINE(port)}
|
|
|
1030
1079
|
${MOBILE_PERMISSIONS_LINE(port)}
|
|
1031
1080
|
${MOBILE_PROPOSALS_INSIDE_LINE(port)}
|
|
1032
1081
|
${MOBILE_SECRETS_LINE(port)}
|
|
1082
|
+
${MOBILE_SECRETS_WRITES_LINE(port)}
|
|
1033
1083
|
- **When to use** (PROACTIVE): "why can't the app reach you?" / "does the app work without Cloudflare?" → read \`/health\` \`mobileRoutes\` and name the missing or failing route and its reason; never guess.
|
|
1034
1084
|
`;
|
|
1035
1085
|
}
|
|
@@ -2322,6 +2372,7 @@ export class PostUpdateMigrator {
|
|
|
2322
2372
|
this.migrateGitignore(result);
|
|
2323
2373
|
this.migrateBuiltinSkills(result);
|
|
2324
2374
|
this.migrateBuiltinJobs(result);
|
|
2375
|
+
this.migrateLegacyDefaultJobs(result);
|
|
2325
2376
|
this.autoMigrateLegacyJobsJson(result);
|
|
2326
2377
|
this.migrateSkillPortHardcoding(result);
|
|
2327
2378
|
this.migrateBuildSkillMethodology(result);
|
|
@@ -5833,9 +5884,9 @@ export class PostUpdateMigrator {
|
|
|
5833
5884
|
return;
|
|
5834
5885
|
}
|
|
5835
5886
|
const sha = crypto.createHash('sha256').update(current.replace(/\r\n/g, '\n')).digest('hex');
|
|
5836
|
-
if (sha === NORMAL_CHROME_BROWSER_SKILL_V1_SHA256) {
|
|
5887
|
+
if (sha === NORMAL_CHROME_BROWSER_SKILL_V1_SHA256 || sha === NORMAL_CHROME_BROWSER_SKILL_V2_SHA256) {
|
|
5837
5888
|
fs.writeFileSync(skillFile, NORMAL_CHROME_BROWSER_SKILL_CONTENT);
|
|
5838
|
-
result.upgraded.push('skills/normal-chrome-browser/SKILL.md (macOS
|
|
5889
|
+
result.upgraded.push('skills/normal-chrome-browser/SKILL.md (macOS, Windows and Linux drivers)');
|
|
5839
5890
|
return;
|
|
5840
5891
|
}
|
|
5841
5892
|
// The shipped skill is written beside the edited copy (Claude Code reads only SKILL.md, so the
|
|
@@ -5843,9 +5894,20 @@ export class PostUpdateMigrator {
|
|
|
5843
5894
|
fs.writeFileSync(path.join(path.dirname(skillFile), 'SKILL.shipped.md'), NORMAL_CHROME_BROWSER_SKILL_CONTENT);
|
|
5844
5895
|
// The appendix takes the file's own line endings (a CRLF copy stays CRLF throughout).
|
|
5845
5896
|
const crlf = current.includes('\r\n');
|
|
5897
|
+
// An edited copy that already has the appendix needs only its Linux subsection changed.
|
|
5898
|
+
if (current.includes(NORMAL_CHROME_BROWSER_SKILL_APPENDIX_HEADING)) {
|
|
5899
|
+
const lf = crlf ? current.replace(/\r\n/g, '\n') : current;
|
|
5900
|
+
const bounds = markdownSectionBounds(lf, NORMAL_CHROME_BROWSER_SKILL_OLD_LINUX_HEADING);
|
|
5901
|
+
const next = bounds
|
|
5902
|
+
? lf.slice(0, bounds.start) + NORMAL_CHROME_BROWSER_LINUX_SECTION + (lf.slice(bounds.end) ? '\n' + lf.slice(bounds.end) : '')
|
|
5903
|
+
: lf.replace(/\n*$/, '') + '\n\n' + NORMAL_CHROME_BROWSER_LINUX_SECTION;
|
|
5904
|
+
fs.writeFileSync(skillFile, crlf ? next.replace(/\n/g, '\r\n') : next);
|
|
5905
|
+
result.upgraded.push('skills/normal-chrome-browser/SKILL.md (Linux driver section added; local edits kept; shipped text in SKILL.shipped.md)');
|
|
5906
|
+
return;
|
|
5907
|
+
}
|
|
5846
5908
|
const appendix = crlf ? NORMAL_CHROME_BROWSER_SKILL_WINDOWS_APPENDIX.replace(/\n/g, '\r\n') : NORMAL_CHROME_BROWSER_SKILL_WINDOWS_APPENDIX;
|
|
5847
5909
|
fs.writeFileSync(skillFile, current.replace(/(\r?\n)*$/, '') + (crlf ? '\r\n\r\n' : '\n\n') + appendix);
|
|
5848
|
-
result.upgraded.push('skills/normal-chrome-browser/SKILL.md (appended the Windows driver
|
|
5910
|
+
result.upgraded.push('skills/normal-chrome-browser/SKILL.md (appended the Windows and Linux driver sections; local edits kept; shipped text in SKILL.shipped.md)');
|
|
5849
5911
|
// The kept text may still teach what the shipped rules forbid (the predecessor method's synthetic
|
|
5850
5912
|
// focus-event step). That is surfaced as a signal for the operator, never rewritten.
|
|
5851
5913
|
if (/FocusEvent|fire events|dispatchEvent\(new (Focus|Mouse|Pointer)Event/.test(current)) {
|
|
@@ -6611,6 +6673,47 @@ if [[ "$ACTIVE" != "true" ]]; then`;
|
|
|
6611
6673
|
result.errors.push(`built-in skills: ${err}`);
|
|
6612
6674
|
}
|
|
6613
6675
|
}
|
|
6676
|
+
/**
|
|
6677
|
+
* Reconcile legacy default jobs on every update, before a pending jobs.json
|
|
6678
|
+
* migration reads that file. Built-in agentmd jobs are handled separately.
|
|
6679
|
+
* The legacy git-sync default is disabled and never auto-enabled by refresh.
|
|
6680
|
+
*/
|
|
6681
|
+
migrateLegacyDefaultJobs(result) {
|
|
6682
|
+
const jobsPath = path.join(this.config.stateDir, 'jobs.json');
|
|
6683
|
+
if (!fs.existsSync(jobsPath)) {
|
|
6684
|
+
result.skipped.push('legacy default jobs: no jobs.json');
|
|
6685
|
+
return;
|
|
6686
|
+
}
|
|
6687
|
+
try {
|
|
6688
|
+
const jobs = JSON.parse(fs.readFileSync(jobsPath, 'utf8'));
|
|
6689
|
+
if (!Array.isArray(jobs) || jobs.some(job => !job || typeof job !== 'object' || typeof job.slug !== 'string')) {
|
|
6690
|
+
throw new Error('jobs.json must be an array of jobs with slugs');
|
|
6691
|
+
}
|
|
6692
|
+
const slugs = new Set(jobs.map(job => job.slug));
|
|
6693
|
+
const missing = getDefaultJobs(this.config.port)
|
|
6694
|
+
.filter(job => !slugs.has(job.slug));
|
|
6695
|
+
// An update may add shipped defaults, but must not rewrite an existing
|
|
6696
|
+
// legacy body before jobsMigrate can classify and preserve user edits.
|
|
6697
|
+
// A Git remote is never an opt-in to running git-sync.
|
|
6698
|
+
for (const job of missing) {
|
|
6699
|
+
if (job.slug === 'git-sync')
|
|
6700
|
+
job.enabled = false;
|
|
6701
|
+
jobs.push(job);
|
|
6702
|
+
}
|
|
6703
|
+
if (missing.length > 0) {
|
|
6704
|
+
SafeFsExecutor.atomicWriteJsonSync(jobsPath, jobs, {
|
|
6705
|
+
operation: 'PostUpdateMigrator.migrateLegacyDefaultJobs', indent: 2,
|
|
6706
|
+
});
|
|
6707
|
+
result.upgraded.push(`legacy default jobs: ${missing.length} missing job(s) installed`);
|
|
6708
|
+
}
|
|
6709
|
+
else {
|
|
6710
|
+
result.skipped.push('legacy default jobs: already present');
|
|
6711
|
+
}
|
|
6712
|
+
}
|
|
6713
|
+
catch (err) {
|
|
6714
|
+
result.errors.push(`legacy default jobs: ${err instanceof Error ? err.message : String(err)}`);
|
|
6715
|
+
}
|
|
6716
|
+
}
|
|
6614
6717
|
/**
|
|
6615
6718
|
* Phase 2 — install/refresh built-in agentmd jobs. Copies the shipped
|
|
6616
6719
|
* markdown templates into `.instar/jobs/instar/` and writes their
|
|
@@ -8266,17 +8369,33 @@ setTimeout(() => process.exit(0), 2000);
|
|
|
8266
8369
|
patched = true;
|
|
8267
8370
|
result.upgraded.push('CLAUDE.md: added Memory privacy recovery');
|
|
8268
8371
|
}
|
|
8372
|
+
// Registry First: the browser's state is a question with a place to look (normal-chrome-linux).
|
|
8373
|
+
if (!content.includes('| Can I use a browser?') && content.includes('| What can I do?')) {
|
|
8374
|
+
const row = `| Can I use a browser? / can this be done on a website? | \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/browser/state\` |`;
|
|
8375
|
+
content = content.replace(/^(\| What can I do\?.*)$/gm, `$1\n${row}`);
|
|
8376
|
+
patched = true;
|
|
8377
|
+
result.upgraded.push('CLAUDE.md: added the browser state to Registry First');
|
|
8378
|
+
}
|
|
8269
8379
|
// Replace a shipped legacy section before any missing capability bullets
|
|
8270
8380
|
// are appended. An appended bullet at EOF would otherwise become part of
|
|
8271
8381
|
// that section and make its exact-text migration refuse the replacement.
|
|
8272
8382
|
{
|
|
8273
|
-
|
|
8274
|
-
|
|
8383
|
+
// The section actually present is the one replaced in place; a release revert can leave both,
|
|
8384
|
+
// and the second pass then removes whichever shipped copy is left beside the new section.
|
|
8385
|
+
const v2First = content.includes(NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING_V2);
|
|
8386
|
+
const passes = [
|
|
8387
|
+
[NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING_V2, NORMAL_CHROME_BROWSER_CLAUDEMD_SECTION_V2()],
|
|
8388
|
+
[NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING_V1, NORMAL_CHROME_BROWSER_CLAUDEMD_SECTION_V1()],
|
|
8389
|
+
];
|
|
8390
|
+
for (const [oldHeading, oldSection] of v2First ? passes : passes.reverse()) {
|
|
8391
|
+
const r = replaceOrAppendMarkdownSection(content, oldHeading, NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING, NORMAL_CHROME_BROWSER_CLAUDEMD_SECTION(), oldSection);
|
|
8392
|
+
if (r.action === 'present')
|
|
8393
|
+
continue;
|
|
8275
8394
|
content = r.content;
|
|
8276
8395
|
patched = true;
|
|
8277
|
-
result.upgraded.push(r.action === 'replaced' ? 'CLAUDE.md: replaced Normal-Chrome browser section (macOS
|
|
8278
|
-
: r.action === 'appended-old-kept' ? 'CLAUDE.md: added Normal-Chrome browser section (macOS
|
|
8279
|
-
: r.action === 'removed-stale' ? 'CLAUDE.md: removed
|
|
8396
|
+
result.upgraded.push(r.action === 'replaced' ? 'CLAUDE.md: replaced Normal-Chrome browser section (macOS, Windows and Linux)'
|
|
8397
|
+
: r.action === 'appended-old-kept' ? 'CLAUDE.md: added Normal-Chrome browser section (macOS, Windows and Linux); the edited older section was kept'
|
|
8398
|
+
: r.action === 'removed-stale' ? 'CLAUDE.md: removed a stale older Normal-Chrome browser section'
|
|
8280
8399
|
: 'CLAUDE.md: added Normal-Chrome browser section');
|
|
8281
8400
|
}
|
|
8282
8401
|
}
|
|
@@ -8634,6 +8753,11 @@ setTimeout(() => process.exit(0), 2000);
|
|
|
8634
8753
|
patched = true;
|
|
8635
8754
|
result.upgraded.push('CLAUDE.md: added Talking to my other sessions section');
|
|
8636
8755
|
}
|
|
8756
|
+
if (!content.includes(PAIR_SHARING_CLAUDEMD_MARKER)) {
|
|
8757
|
+
content += PAIR_SHARING_CLAUDEMD_SECTION(port);
|
|
8758
|
+
patched = true;
|
|
8759
|
+
result.upgraded.push('CLAUDE.md: added sharing at the first pairing');
|
|
8760
|
+
}
|
|
8637
8761
|
if (!content.includes(JOB_RESULT_SUPERVISION_CLAUDEMD_MARKER)) {
|
|
8638
8762
|
content += JOB_RESULT_SUPERVISION_CLAUDEMD_SECTION(port);
|
|
8639
8763
|
patched = true;
|
|
@@ -9380,6 +9504,22 @@ setTimeout(() => process.exit(0), 2000);
|
|
|
9380
9504
|
patched = true;
|
|
9381
9505
|
result.upgraded.push('CLAUDE.md: added the native Passwords & keys line');
|
|
9382
9506
|
}
|
|
9507
|
+
// Phone asks and cancels (docs/specs/mobile-native-secrets-writes.md): one bullet after the Passwords &
|
|
9508
|
+
// keys bullet of an existing Mobile app routes block (a block added below already has it).
|
|
9509
|
+
if (content.includes('Mobile app routes') && !content.includes(MOBILE_SECRETS_WRITES_MARKER)) {
|
|
9510
|
+
const lines = content.split('\n');
|
|
9511
|
+
const at = lines.findIndex((l) => l.includes(MOBILE_SECRETS_MARKER));
|
|
9512
|
+
if (at >= 0) {
|
|
9513
|
+
lines.splice(at + 1, 0, MOBILE_SECRETS_WRITES_LINE(port));
|
|
9514
|
+
content = lines.join('\n');
|
|
9515
|
+
}
|
|
9516
|
+
else {
|
|
9517
|
+
// A block without the Passwords & keys bullet: append the line rather than skip it.
|
|
9518
|
+
content = `${content.replace(/\n*$/, '\n')}${MOBILE_SECRETS_WRITES_LINE(port)}\n`;
|
|
9519
|
+
}
|
|
9520
|
+
patched = true;
|
|
9521
|
+
result.upgraded.push('CLAUDE.md: added the phone ask and cancel line');
|
|
9522
|
+
}
|
|
9383
9523
|
// Native Proposals / How I'm doing inside (docs/specs/mobile-native-proposals-inside.md): one bullet
|
|
9384
9524
|
// after the permissions bullet of an existing Mobile app routes block (a block added below already has it).
|
|
9385
9525
|
if (content.includes('Mobile app routes') && !content.includes(MOBILE_PROPOSALS_INSIDE_MARKER)) {
|
|
@@ -13708,6 +13848,15 @@ The user has been talking to you (possibly for days). A generic greeting like "H
|
|
|
13708
13848
|
result.upgraded.push('CLAUDE.md: added Secret Drop --run atomic use-and-consume guidance');
|
|
13709
13849
|
}
|
|
13710
13850
|
}
|
|
13851
|
+
// A browser password has one exit and is not stored (normal-chrome-linux). Same anchor as --run.
|
|
13852
|
+
if (content.includes('secret-drop-retrieve.mjs') && !content.includes('Website passwords for the Linux browser')) {
|
|
13853
|
+
const anchor = 'The hardened script exists specifically to close that leak class (origin: 2026-05-20 incident).';
|
|
13854
|
+
if (content.includes(anchor)) {
|
|
13855
|
+
content = content.replace(anchor, anchor + "\n- **Website passwords for the Linux browser**: request with `browserHost` set to the host the operator named (the person sees it on the form), then `XD_PROFILE=<id> node .instar/scripts/secret-drop-retrieve.mjs TOKEN password --browser` with the password box focused. It types straight into that site's box and you never see it; stdout, --run and --consume are refused, and the submission is not stored, so a server restart loses it.");
|
|
13856
|
+
patched = true;
|
|
13857
|
+
result.upgraded.push('CLAUDE.md: added Secret Drop browser password guidance');
|
|
13858
|
+
}
|
|
13859
|
+
}
|
|
13711
13860
|
// Secret Drop store-first durability (2026-06-04). Existing agents'
|
|
13712
13861
|
// Security bullet still claims submissions are "in-memory only (never
|
|
13713
13862
|
// written to disk)" — no longer true: submissions are persisted store-first
|
|
@@ -14369,7 +14518,7 @@ An agent created in a temporary folder (\`/tmp\`, \`/private/tmp\`, \`/var/folde
|
|
|
14369
14518
|
'### Hand-started Codex: `instar codex connect <agent>`',
|
|
14370
14519
|
// normal-chrome-builtin-skill: the helper scripts are framework-neutral
|
|
14371
14520
|
// (.instar/scripts/browser/), so a Codex/Gemini agent on macOS uses them too.
|
|
14372
|
-
'### Normal-Chrome browser (account-bound web tasks, macOS + Windows)', // == NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING (a literal so the parity guard can see it)
|
|
14521
|
+
'### Normal-Chrome browser (account-bound web tasks, macOS + Windows + Linux)', // == NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING (a literal so the parity guard can see it)
|
|
14373
14522
|
// a2a-single-agent-identity: the agent identity + coherence check are server-side and
|
|
14374
14523
|
// framework-agnostic (a Codex/Gemini agent runs on the same mesh and must explain the
|
|
14375
14524
|
// not-provisioned posture and the adopt-from-a-sibling path honestly too).
|
|
@@ -14739,13 +14888,16 @@ An agent created in a temporary folder (\`/tmp\`, \`/private/tmp\`, \`/var/folde
|
|
|
14739
14888
|
}
|
|
14740
14889
|
let appended = refreshOriginCanaryCleanupAwareness(refreshOriginCanaryStartupAwareness(shadowContent));
|
|
14741
14890
|
let mirrored = appended === shadowContent ? 0 : 1;
|
|
14742
|
-
// A shadow that still carries
|
|
14743
|
-
//
|
|
14744
|
-
//
|
|
14745
|
-
|
|
14891
|
+
// A shadow that still carries a SHIPPED older Normal-Chrome section loses it here (whether or not
|
|
14892
|
+
// the current section is already present, so a release revert cannot leave both), and the marker
|
|
14893
|
+
// loop below mirrors the current section once. An edited older section is kept.
|
|
14894
|
+
for (const [oldHeading, oldSection] of [
|
|
14895
|
+
[NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING_V1, NORMAL_CHROME_BROWSER_CLAUDEMD_SECTION_V1()],
|
|
14896
|
+
[NORMAL_CHROME_BROWSER_CLAUDEMD_HEADING_V2, NORMAL_CHROME_BROWSER_CLAUDEMD_SECTION_V2()],
|
|
14897
|
+
]) {
|
|
14746
14898
|
const crlf = appended.includes('\r\n');
|
|
14747
14899
|
const lf = crlf ? appended.replace(/\r\n/g, '\n') : appended;
|
|
14748
|
-
const stale = findExactMarkdownSection(lf,
|
|
14900
|
+
const stale = findExactMarkdownSection(lf, oldHeading, oldSection);
|
|
14749
14901
|
if (stale) {
|
|
14750
14902
|
const stripped = lf.slice(0, stale.start).replace(/\n*$/, '') + '\n' + lf.slice(stale.end).replace(/^\n*/, '\n');
|
|
14751
14903
|
appended = crlf ? stripped.replace(/\n/g, '\r\n') : stripped;
|
|
@@ -17418,6 +17570,20 @@ if [ -n "\$NOW" ]; then
|
|
|
17418
17570
|
echo "--- END CURRENT TIME ---"
|
|
17419
17571
|
fi
|
|
17420
17572
|
|
|
17573
|
+
# Browser awareness on a Linux server: every session starts knowing it has one. Read from the file
|
|
17574
|
+
# the install writes, so it works with the server down. Never says "no browser" (normal-chrome-linux).
|
|
17575
|
+
if [ "\$(uname -s)" = "Linux" ] && ! command -v powershell.exe >/dev/null 2>&1; then
|
|
17576
|
+
BROWSER_RESULT=\$(sed -n 's/.*"status":"\\([^"]*\\)".*/\\1/p' "$INSTAR_DIR/state/xdrive/provision.json" 2>/dev/null)
|
|
17577
|
+
case "\$BROWSER_RESULT" in
|
|
17578
|
+
installing) BROWSER_STATE="installing" ;;
|
|
17579
|
+
failed*) BROWSER_STATE="broken" ;;
|
|
17580
|
+
*) if [ -x /opt/google/chrome/chrome ]; then BROWSER_STATE="ready"; else BROWSER_STATE="not-built"; fi ;;
|
|
17581
|
+
esac
|
|
17582
|
+
echo ""
|
|
17583
|
+
echo "BROWSER: I have a browser on this server: ordinary Chrome on my own private display (/normal-chrome-browser, xdrive.sh). State: \$BROWSER_STATE."
|
|
17584
|
+
echo "Before saying a browser task can't be done, check GET /browser/state. not-built and broken have a nextStep there; neither means no browser."
|
|
17585
|
+
fi
|
|
17586
|
+
|
|
17421
17587
|
# TOPIC CONTEXT (loaded FIRST — highest priority context)
|
|
17422
17588
|
if [ -n "\$INSTAR_TELEGRAM_TOPIC" ]; then
|
|
17423
17589
|
TOPIC_ID="\$INSTAR_TELEGRAM_TOPIC"
|