vibe64 0.1.57 → 0.1.59

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.
Files changed (85) hide show
  1. package/bin/run.js +585 -585
  2. package/bin/server.js +169 -169
  3. package/bin/upgrade-state.js +1161 -1161
  4. package/dist/assets/{GithubBrowserTabs-DfRzbuSv.js → GithubBrowserTabs-D_nMB5Y1.js} +1 -1
  5. package/dist/assets/{LocalDatabaseServer-7LqUsfAQ.js → LocalDatabaseServer-BgO_aeUg.js} +1 -1
  6. package/dist/assets/{Vibe64AuthSettingsButton-DGm_9G9A.js → Vibe64AuthSettingsButton-Bx9patil.js} +1 -1
  7. package/dist/assets/{Vibe64ConversationLog-DlwCuaVi.js → Vibe64ConversationLog-DtOgxPNR.js} +1 -1
  8. package/dist/assets/{Vibe64DashboardShell-CZ5cMJ9k.js → Vibe64DashboardShell-DhPE6H3P.js} +1 -1
  9. package/dist/assets/{Vibe64DatabaseWorkspace-DfZpwSzB.js → Vibe64DatabaseWorkspace-CHV0cd3l.js} +1 -1
  10. package/dist/assets/{Vibe64OutputControls-CkXzIhro.js → Vibe64OutputControls-mNWUWLSm.js} +1 -1
  11. package/dist/assets/{Vibe64SessionFiles-BZQwcfGG.js → Vibe64SessionFiles-BXt__PJL.js} +1 -1
  12. package/dist/assets/{Vibe64SessionSourceEditor-CSX0GD_w.js → Vibe64SessionSourceEditor-NyG6niQM.js} +1 -1
  13. package/dist/assets/{Vibe64UiStoryboardView-Tml9lmTO.js → Vibe64UiStoryboardView-BXH2MSWn.js} +1 -1
  14. package/dist/assets/{Vibe64UnavailableSessions-D1LJQ7jc.js → Vibe64UnavailableSessions-CCPWJo8e.js} +1 -1
  15. package/dist/assets/{_pageId_-myxTAoqm.js → _pageId_-D54CqzqG.js} +1 -1
  16. package/dist/assets/{_sessionId_-BM4eQHUu.js → _sessionId_-CW044RVi.js} +1 -1
  17. package/dist/assets/{_slug_-C1Zt2FsE.js → _slug_-CRtFhc0A.js} +5 -5
  18. package/dist/assets/{_slug_-BvyD0DHo.css → _slug_-WWvJTLoc.css} +1 -1
  19. package/dist/assets/{access-DbK06uO7.js → access-ChMLRErk.js} +1 -1
  20. package/dist/assets/{app-D35Na9o5.js → app-D9FegZf0.js} +1 -1
  21. package/dist/assets/assistantRouting-D4SnnxJn.js +3 -0
  22. package/dist/assets/{client-C5sPrfkm.js → client-BBqNv4HL.js} +1 -1
  23. package/dist/assets/{client-CjNw-kf-.js → client-DnjkdG6K.js} +1 -1
  24. package/dist/assets/{client-DT3BbWpI.js → client-Dra4Vp3A.js} +2 -2
  25. package/dist/assets/{client-BTq67t0Y.js → client-DuDOzb5A.js} +2 -2
  26. package/dist/assets/{client-CkV1cE5C.js → client-mU-LObHG.js} +1 -1
  27. package/dist/assets/{dashboard-CbOtBwwu.js → dashboard-B26QwE6y.js} +1 -1
  28. package/dist/assets/{english-definitions--F8iwoB9.js → english-definitions-I9tIXY2u.js} +1 -1
  29. package/dist/assets/{env-BxyHxFmS.js → env-BXsvM592.js} +1 -1
  30. package/dist/assets/{health-Bnnb6E2j.js → health-C4WtefLm.js} +1 -1
  31. package/dist/assets/{history-1Xemjfmv.js → history-HHPFoNi3.js} +1 -1
  32. package/dist/assets/index-BBfSvf2i.css +1 -0
  33. package/dist/assets/{index-Btrr1DGq.js → index-Bvd00puv.js} +3 -3
  34. package/dist/assets/{integrations-hQJR-UJM.js → integrations-CQNJxkMu.js} +1 -1
  35. package/dist/assets/{issues-0y_naQdl.js → issues-BHr_nI-9.js} +1 -1
  36. package/dist/assets/{learning-CG0NUB8v.js → learning-0cINHUSN.js} +1 -1
  37. package/dist/assets/{pages-CHjGYtFn.js → pages-CIKw99GN.js} +1 -1
  38. package/dist/assets/{project-files-S6i36bSy.js → project-files-CklWobqZ.js} +1 -1
  39. package/dist/assets/{publish-BmfmLaWn.js → publish-Cot797YN.js} +1 -1
  40. package/dist/assets/{pull-requests-COBi3Wfj.js → pull-requests-ybnixBv0.js} +1 -1
  41. package/dist/assets/{settings-D0U9Lxsg.js → settings-DJByC5Wb.js} +1 -1
  42. package/dist/assets/{useArchivedVibe64Sessions-DQcmDT-k.js → useArchivedVibe64Sessions-B-DtXrk-.js} +1 -1
  43. package/dist/assets/{useVibe64ConversationLog-yo2ewb9G.js → useVibe64ConversationLog-BVANhCHq.js} +2 -2
  44. package/dist/assets/{useVibe64SessionData-DngAc96i.js → useVibe64SessionData-rBvWMqyc.js} +1 -1
  45. package/dist/assets/{useVibe64SessionSelection-Cxt1pCjM.js → useVibe64SessionSelection-C546mBu8.js} +1 -1
  46. package/dist/assets/{vibe64SessionFocus-CQraoYFY.js → vibe64SessionFocus-CxX2nK6F.js} +1 -1
  47. package/dist/assets/vibe64SessionFocus-DW73PN_o.css +1 -0
  48. package/dist/index.html +5 -5
  49. package/docs/colleague-usage/auto-workflow.md +2 -2
  50. package/docs/colleague-usage/chat-settings.md +7 -3
  51. package/docs/colleague-usage/coding-agents.md +10 -0
  52. package/docs/colleague-usage/sessions.md +2 -1
  53. package/docs/colleague-usage/ui-pass.md +8 -8
  54. package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +1 -0
  55. package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
  56. package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +2 -0
  57. package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
  58. package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
  59. package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
  60. package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
  61. package/node_modules/@jskit-ai/connectors-core/CHANGELOG.md +1 -0
  62. package/node_modules/@jskit-ai/connectors-core/README.md +8 -0
  63. package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
  64. package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
  65. package/node_modules/@jskit-ai/kernel/CHANGELOG.md +3 -0
  66. package/node_modules/@jskit-ai/kernel/package.json +1 -1
  67. package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +2 -0
  68. package/node_modules/@jskit-ai/payments-core/package.json +1 -1
  69. package/node_modules/@jskit-ai/realtime/CHANGELOG.md +2 -0
  70. package/node_modules/@jskit-ai/realtime/package.json +1 -1
  71. package/node_modules/@jskit-ai/resource-core/CHANGELOG.md +5 -0
  72. package/node_modules/@jskit-ai/resource-core/package.json +1 -1
  73. package/node_modules/@jskit-ai/resource-core/patterns/table-resource/PATTERN.md +7 -4
  74. package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
  75. package/node_modules/@local/vibe64-execution/src/server/gitTurnCheckpointCommand.js +145 -530
  76. package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +89 -89
  77. package/node_modules/@local/vibe64-genesis/src/server/index.js +325 -322
  78. package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +41 -41
  79. package/node_modules/@local/vibe64-terminals/src/server/opencodeSessionEnvironmentPlugin.js +66 -66
  80. package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +318 -318
  81. package/package.json +14 -14
  82. package/server.bundle.mjs +33440 -33403
  83. package/dist/assets/assistantRouting--Xm-hai_.js +0 -3
  84. package/dist/assets/index-CmzEKG3z.css +0 -1
  85. package/dist/assets/vibe64SessionFocus-CcHYt9SU.css +0 -1
@@ -1,3 +0,0 @@
1
- import{t as AppError}from"./errors-DErd0NON.js";import{b as sameVibe64AssistantSelection,c as vibe64AssistantSelectionLabel,y as defineVibe64AssistantSelection}from"./shared-X5MxTHwl.js";var ASSISTANT_FINISHING_DEFAULTS=Object.freeze({review:true,deslop:true,uiPass:false,autoSave:true});var ASSISTANT_FINISHING_STEPS=Object.freeze([{id:`review`,name:`Review`,setting:`Automatically review changes`,genesisTask:`review`},{id:`deslop`,name:`Deslop`,setting:`Automatically deslop changes`,genesisTask:`deslop`},{id:`uiPass`,name:`UI pass`,setting:`Automatically UI pass changes`,genesisTask:`ui-pass`},{id:`autoSave`,name:`Save`,setting:`Automatically save changes`}].map(Object.freeze));var ASSISTANT_NO_FINISHING=Object.freeze(Object.fromEntries(ASSISTANT_FINISHING_STEPS.map(({id})=>[id,false])));var ASSISTANT_MODES=Object.freeze([{id:`custom`,label:`Custom`,description:`Choose a model and thinking level for this chat.`},{id:`senior`,label:`Senior`,description:`Talk directly to your most capable model. Ask questions or request changes.`},{id:`junior`,label:`Junior`,description:`Talk directly to your everyday model. Ask questions or request changes.`},{id:`auto`,label:`Auto`,description:`Name either role, or let Senior handle plans and finishing steps and Junior handle other requests.`}]);var ASSISTANT_FIX_MODE=Object.freeze({id:`fix`,label:`Fix it with AI`,description:`Repair what went wrong with the Fix it with AI model.`});var ASSISTANT_ROUTING_METADATA=`assistant_routing`;var ASSISTANT_SETUP_ROLES=Object.freeze({owner:Object.freeze([`senior`,`junior`,`router`,`colleague`,`fix`,`explain`,`quickHelper`]),nonOwner:Object.freeze([`colleague`,`fix`,`explain`,`quickHelper`])});var ASSISTANT_FOLLOWING_ROLES=Object.freeze([`colleague`,`fix`,`explain`]);var ASSISTANT_ROUTING_ROLE_DEFINITIONS=Object.freeze([{id:`senior`,label:`Senior`,description:`Plans, reviews, Deslop and UI passes in main chat. Your most capable model.`,group:`main`},{id:`junior`,label:`Junior`,description:`Everyday changes in main chat.`,group:`main`},{id:`router`,label:`Router`,description:`Chooses Senior or Junior when main chat is on Auto.`,group:`main`},{id:`colleague`,label:`Colleague`,description:`The default for Colleague. Each person can change their own.`,group:`helpers`},{id:`fix`,label:`Fix it with AI`,description:`Repair chats opened from errors and conflicts. Can run in a different tool from the chat it fixes.`,group:`helpers`},{id:`explain`,label:`Explain & check`,description:`Explain this code, the database assistant and Check my work.`,group:`helpers`},{id:`quickHelper`,label:`Quick helper`,description:`Titles, commit messages, prompt hints and summaries.`,group:`helpers`}].map(Object.freeze));var ASSISTANT_ROLE_DEFAULT_FOLLOWS=Object.freeze({owner:Object.freeze({colleague:`senior`,fix:`junior`,explain:`quickHelper`}),nonOwner:Object.freeze({fix:`colleague`,explain:`quickHelper`})});var ROUTING_REASONS=Object.freeze([`conversation`,`planning`,`implementation`,`review`]);var MAIN_CHAT_PURPOSES=Object.freeze([`custom`,`senior`,`junior`,`auto`,`review`,`deslop`,`ui_pass`,`request_routing`]);var ASSISTANT_PURPOSE_ROLES=Object.freeze({custom:`custom`,senior:`senior`,junior:`junior`,review:`senior`,deslop:`senior`,ui_pass:`senior`,request_routing:`router`,colleague:`colleague`,fix:`fix`,source_explanation:`explain`,database_assistant:`explain`,lesson_review:`explain`,commit_title:`quickHelper`,session_title:`quickHelper`,prompt_hint:`quickHelper`,conversation_summary:`quickHelper`,voice_turn:`quickHelper`,quick_helper:`quickHelper`});var ASSISTANT_ROLE_PURPOSES=Object.freeze({senior:`senior`,junior:`junior`,router:`request_routing`,colleague:`colleague`,fix:`fix`,explain:`source_explanation`,quickHelper:`prompt_hint`});function assistantModeLabel(mode){return ASSISTANT_MODES.find(({id})=>id===mode)?.label||(mode===`fix`?ASSISTANT_FIX_MODE.label:``)||{review:`Senior review`,deslop:`Senior Deslop`,ui_pass:`Senior UI pass`}[mode]||ASSISTANT_ROUTING_ROLE_DEFINITIONS.find(({id})=>id===mode)?.label||``}function routingError(message,code,options={}){return new AppError(409,message,{...options,code})}var upgradeRequired=()=>routingError(`This saved request predates the current AI setup. The administrator must run the state upgrade.`,`vibe64_assistant_routing_upgrade_required`);var choosesAutomation=mode=>mode!==`fix`;function assistantRoutingPreferences(value={}){if(!value||typeof value!==`object`||Array.isArray(value)||![...ASSISTANT_MODES,ASSISTANT_FIX_MODE].some(({id})=>id===value.mode))throw routingError(`Choose Custom, Senior, Junior, or Auto.`,`vibe64_assistant_mode_invalid`);if(Object.hasOwn(value,`workflowEngineId`))throw upgradeRequired();if(value.mode===`custom`&&!value.override)throw routingError(`Choose a custom model first.`,`vibe64_assistant_custom_model_required`);const automation=choosesAutomation(value.mode)?assistantRoutingAutomation(value):ASSISTANT_NO_FINISHING;return{mode:value.mode,...automation,...value.override&&![`auto`,`fix`].includes(value.mode)?{override:defineVibe64AssistantSelection(value.override)}:{}}}function assistantRoutingAutomation(value){const chosen=value&&choosesAutomation(value.mode)?value:{};return Object.fromEntries(ASSISTANT_FINISHING_STEPS.map(({id})=>[id,typeof chosen[id]===`boolean`?chosen[id]:ASSISTANT_FINISHING_DEFAULTS[id]]))}var ASSISTANT_TASK_PURPOSES=Object.freeze({deslop:`deslop`,"ui-pass":`ui_pass`});function assistantRoutingFromMetadata(metadata={}){if(!metadata[`assistant_routing`])return null;const saved=JSON.parse(metadata[ASSISTANT_ROUTING_METADATA]);if(saved&&typeof saved===`object`&&typeof saved.deslop!==`boolean`)throw upgradeRequired();return assistantRoutingPreferences(saved)}var assistantRoutingRequestFromMetadata=metadata=>JSON.parse(metadata?.assistant_routing_request||`null`);function assistantRoutingRequestForDisplay(metadata={}){try{return assistantRoutingRequestFromMetadata(metadata)}catch{return null}}var ASSISTANT_WORKFLOW_STATUSES=Object.freeze([`working`,`waiting`,`complete`]);var ASSISTANT_WORKFLOW_DELIVERIES=Object.freeze([`routing`,`pending`,`sending`,`uncertain`,`accepted`,`failed`]);var assistantWorkflowRole=request=>request.stage===`review`&&request.followup&&request.mode===`auto`?`senior`:request.resolvedMode;function assistantSetupRoleValue(setupValues,role){const value=setupValues[role];return value?.follows?{value:setupValues[value.follows]??null,followedRole:value.follows}:{value:value??null,followedRole:``}}function assistantRoutingStatusIsPending(request){return request?.status!==`complete`&&[`routing`,`pending`,`sending`,`uncertain`].includes(request?.delivery)}function assistantRoutingRequestCanBeReplaced(request,selection){if(request?.helper)return false;const previous=request?.deliverySelection||request?.observedSelection;if(request?.stopped&&previous&&selection&&!sameVibe64AssistantSelection(previous,selection))return true;return request?.delivery===`pending`&&(request.status===`waiting`||Boolean(request.error))&&!request.attemptedMessageId}function assistantRoutingRequestIsUnresolved(request,selection){return assistantRoutingStatusIsPending(request)&&!assistantRoutingRequestCanBeReplaced(request,selection)}function assistantModePrompt(mode,message,options={}){let{planInstructions=``,intent=``,browserReview=false}=options;const{rework=`junior`}=options;const direct=`Work directly from the user's request and conversation, answering questions or implementing changes as requested. You may edit application files when requested. Make ordinary local choices using established project patterns, ask about unresolved scope or design decisions, preserve unrelated work, and verify changes with relevant checks.`;const instructions={custom:direct,senior:direct,junior:direct,fix:direct,deslop:[`Perform Deslop directly using the project's Deslop guidance.`,`You may edit code for behavior-preserving cleanup; earlier Auto planning restrictions do not apply.`,`Preserve existing behavior, unrelated work and staging.`,`Use the user's selected commits or scope; otherwise clean up only the current task's changes.`,`Do not implement features, fix behavior-changing defects, create an implementation plan, or delegate cleanup to another model.`,`Report discovered defects separately without fixing them.`,`Run focused checks, then report what became simpler and what was verified.`,`Do not commit, push or deploy.`].join(` `),ui_pass:[`Perform the UI pass directly using the project's UI pass guidance, on the scope this request names.`,`You may edit code to bring those screens in line with the project's UI guidance; earlier Auto planning restrictions do not apply.`,`Preserve each screen's behavior, unrelated work and staging.`,`Do not implement features, fix behavior-changing defects, create an implementation plan, or delegate the pass to another model.`,`Report discovered defects separately without fixing them.`,`Check the screens you changed in the managed browser, run focused checks, then report what changed and what was verified.`,`Do not commit, push or deploy.`].join(` `),review:[`Review the preceding coding work against the original request and accepted steering.`,`Inspect actual files and relevant surrounding code. You may directly fix in-scope defects.`,`Earlier Auto planning restrictions do not apply.`,`Preserve unrelated work and staging, and report out-of-scope defects without fixing them.`,`For a cleanup-only request, apply the project's Deslop guidance and preserve behavior; report behavior-changing defects separately without fixing them.`,`Perform the review yourself in this turn. Cleanup is optional and only runs when requested in this review's instructions.`,`If implementation is missing or coding stopped for a decision, report that and preserve the decision for the user; do not start the original implementation from scratch.`,`Run relevant checks, then report findings, fixes, actual checks and anything unverified.`,`You own browser verification for this review. Exercise the requested user flow and inspect meaningful visual checkpoints yourself using the supplied managed browser tools; the implementer's code tests do not replace these checks. Reuse reliable passing evidence and avoid repeating unaffected checks. Report browser or visual checks that could not be performed, and do not claim verified completion while required checks remain unfinished.`,`Do not Save, push or invent new product requirements. For substantial necessary rework within the agreed outcome, `+{junior:`update the technical plan and hand back to Junior through the workflow outcome command. Junior implementation will receive another Senior review and any enabled Deslop and UI pass.`,self:`return to your own implementation through the workflow outcome command; this finishing turn then runs again over that rework.`,report:`report what it needs instead of starting it in this review.`}[rework]].join(` `)};if(!instructions[mode])throw routingError(`Unknown assistant mode.`,`vibe64_assistant_mode_unknown`);let instruction=instructions[intent]||instructions[mode];switch(intent){case`conversation`:instruction=`Answer or investigate the user's question. You may use vibe64-helper plan read or history to inspect a referenced plan. Do not create or update a plan, change its status, edit application files, run state-changing operations, or delegate implementation. Explain missing or completed plans without reopening them.`;break;case`planning`:instruction=`Discuss and manage the plan as requested through vibe64-helper plan. Do not change application files in a planning-only request. Clarify ambiguous references before changing a plan. Junior may update paired Progress and existing checklist ticks as work is verified; agreed Plan scope and lifecycle changes require Senior.`;break;case`implementation`:instruction=direct+` Implement the requested work, including any explicitly requested planning changes within your role's authority. `+`For a plan's explicitly authorised removal or deferral, record the exact deferred requirement and its agreed timing in a Deferred work section of paired Progress before removing it from Plan's current acceptance scope. Preserve completed implementation evidence and do not perform deferred work. Reassess the remaining requirements against that evidence; if none remain to implement, hand off for review rather than treating the scope edit as planning-only. Junior still cannot edit Plan scope. `+`Continue until the authorised scope is implemented and checked. Task size, context compaction, or finishing one useful slice is not a reason to end the task. `+`Stop for an unresolved architectural or product decision outside the agreed scope only where it blocks the remaining work; continue independent authorised work. `+`The latest execution request supersedes earlier planning-only wording, while explicit remaining approval boundaries still apply. `+`If work remains, lead with Implementation incomplete and name the exact blocker and unfinished scope; never open with Done for partial implementation. `+`A separate Senior turn will review the result, even when you are Senior. `+`Leave the plan active for that review; do not mark it completed in this implementation turn or request permission for the automatic review.`}if(!planInstructions&&intent!==`conversation`)planInstructions=`This direct request is independent of the current Auto plan unless the user explicitly refers to it. Senior may use vibe64-helper plan to manage it; Junior may update Progress and existing checklist ticks after reading both documents, never change scope or mark the plan completed.`;if(intent!==`conversation`&&intent!==`planning`&&intent!==`deslop`&&intent!==`ui_pass`&&intent!==`review`&&mode!==`review`&&mode!==`deslop`&&mode!==`ui_pass`){instruction+=` When the requested feature is implemented, its required runtime resources are prepared and Preview is responding, promptly tell the user: Ready to try—give it a spin. Verification is still running. Do not claim full completion before verification, and do not wait for the user to test before continuing your checks. If Preview is unavailable, report that instead of inviting the user to try it.`;instruction+=browserReview?` A separate Senior review owns in-depth browser testing and visual inspection. Do not run those checks in this implementation turn. Run relevant focused code tests and basic smoke checks: confirm server startup, relevant routes and API responses, and if needed make a brief managed-browser check that the changed page renders and its main control is present. Leave full end-to-end browser suites, multi-step user journeys and visual inspection to Senior; do not expand the smoke check into those checks. Prepare the app and report exact checks, remaining gaps and browser acceptance cases to Senior; browser verification pending is an expected handoff, not an implementation blocker. Tell the user that Senior will perform the remaining browser checks.`:` You own the remaining verification, including relevant browser checks and visual inspection using the supplied tools. Tell the user those checks are next, keep the app usable during checking and report anything unverified if checking is interrupted or unavailable.`}return`[Vibe64 role: ${assistantModeLabel(mode)}. Applies only to this request; earlier per-turn mode instructions no longer apply.]\n${instruction}${planInstructions?`\n${planInstructions}`:``}\n\n${message}`}function assistantGoalObjective(objective,pinned){if(pinned?.objective&&[`custom`,`senior`,`junior`].some(mode=>objective===assistantModePrompt(mode,pinned.objective)))return pinned.objective;return objective}function assistantGoalManagementMessage(message,turn={}){if(!message||message.receipt===false||turn.user?.receipt===false||turn.optimistic&&turn.optimistic.status!==`accepted`||turn.system?.delivery)return false;const native=message.data?.native;if(!(turn.metadata?.engineId===`claude`||turn.metadata?.assistantSelection?.engineId===`claude`||native?.engineId===`claude`))return false;const text=String(message.text||``);if(message.role===`user`)return Boolean(turn.metadata?.upstreamMessageId||message.receipt===true)&&/^\/goal(?:\s|$)/u.test(text);if(![`assistant`,`commentary`].includes(message.role))return false;if(native?.command)return native.engineId===`claude`&&([`assistant`,`result`].includes(native.type)||native.type===`system`&&[`local_command`,`local_command_output`].includes(native.subtype))&&native.command===`goal`&&native.output===`stdout`;const prefix=[`Goal set: `,`Goal cleared: `,`Goal active: `].find(value=>text.startsWith(value));if(prefix){const objective=text.slice(prefix.length);const separator=objective.indexOf(`
2
-
3
- `);if(separator!==-1&&assistantGoalObjective(objective,{objective:objective.slice(separator+2)})!==objective)return true}return native?.type===`system`&&native.subtype===`local_command_output`&&Boolean(prefix||text===`No goal set`||text==="No goal set. Usage: `/goal <condition>`")}function assistantRoutingOutcomeNotice(request){if(!request?.messageId||!request.outcome||request.stopped)return null;const auto=request.mode===`auto`;let handoff=auto?`Returning to Junior for rework.`:`Returning to implementation for rework.`;if(request.status===`complete`)handoff=`Work finished.`;else if(request.stage===`review`)handoff=auto?`Ready for Senior review.`:`Ready for review.`;const headings={continue:`Continuing work.`,handoff,wait:`Waiting to continue.`,complete:request.stage===`review`?`Review complete.`:`Finished.`};return{messageId:`assistant-routing-outcome:${request.messageId}:${request.outcome.turnId}:${request.outcome.decision}`,text:`${headings[request.outcome.decision]}\n\n${request.outcome.explanation}`}}function assistantRoutingStatusLabel(request){if(!request)return``;const selection=request.assignments?.[assistantWorkflowRole(request)];const recipient=selection?vibe64AssistantSelectionLabel(selection):``;const stage=(request.mode===`auto`||request.stage===`review`)&&{planning:`Planning`,implementation:`Implementing`,review:`Reviewing`}[request.stage]||assistantModeLabel(request.resolvedMode);if(request.delivery===`uncertain`)return`Delivery unconfirmed · ${recipient}`;if(request.status===`waiting`)return request.stopped?`Paused at your request.`:`${stage} waiting · ${recipient}`;if(request.status===`complete`){if(!request.workflow)return`Reply finished.`;if(request.stage===`review`)return`Review complete — read the findings above.`;return request.outcome?.decision===`handoff`?`Work finished.`:`Reply finished.`}if(request.delivery===`routing`)return`Choosing the recipient with Router…`;if(request.delivery===`failed`)return`Request not sent`;if(request.delivery===`pending`)return`${stage} ready to continue · ${recipient}`;if(request.delivery===`sending`)return`${stage} · ${recipient} · awaiting receipt…`;return`${stage} · ${recipient}`}var __testables=Object.freeze({MAIN_CHAT_PURPOSES});export{assistantRoutingStatusIsPending as _,ASSISTANT_ROLE_PURPOSES as a,ASSISTANT_FINISHING_STEPS as b,assistantGoalManagementMessage as c,assistantRoutingAutomation as d,assistantRoutingFromMetadata as f,assistantRoutingRequestIsUnresolved as g,assistantRoutingRequestForDisplay as h,ASSISTANT_ROLE_DEFAULT_FOLLOWS as i,assistantGoalObjective as l,assistantRoutingRequestCanBeReplaced as m,ASSISTANT_FOLLOWING_ROLES as n,ASSISTANT_ROUTING_ROLE_DEFINITIONS as o,assistantRoutingOutcomeNotice as p,ASSISTANT_MODES as r,ASSISTANT_SETUP_ROLES as s,ASSISTANT_FIX_MODE as t,assistantModeLabel as u,assistantRoutingStatusLabel as v,assistantSetupRoleValue as y};