vibe64 0.1.54 → 0.1.55
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/bin/run.js +926 -926
- package/bin/server.js +109 -109
- package/bin/upgrade-state.js +1820 -1817
- package/dist/assets/{GithubBrowserTabs-B3o7MQQR.js → GithubBrowserTabs-ByMqpsdH.js} +1 -1
- package/dist/assets/{LocalDatabaseServer-OnPGrWzT.js → LocalDatabaseServer-DAqJ_cyP.js} +1 -1
- package/dist/assets/{Vibe64AuthSettingsButton-j3_ikAuW.js → Vibe64AuthSettingsButton-oE_6LWCD.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-B0NPbnB3.js → Vibe64DashboardShell-zx0w3bRI.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-B_lZnRTj.js → Vibe64DatabaseWorkspace-_IaElLVX.js} +1 -1
- package/dist/assets/{Vibe64FileArea-nnRwNnqT.js → Vibe64FileArea-1mU0h47c.js} +1 -1
- package/dist/assets/{Vibe64OutputControls-Bri4USOZ.js → Vibe64OutputControls-C3Raycqc.js} +1 -1
- package/dist/assets/{Vibe64RepositoryWorkspace-D1A8LVag.js → Vibe64RepositoryWorkspace-BsHp64eR.js} +1 -1
- package/dist/assets/{Vibe64SessionFiles-B36EvXEi.js → Vibe64SessionFiles-zjMzQfSS.js} +1 -1
- package/dist/assets/Vibe64UiStoryboardView-BWsEULBB.js +8 -0
- package/dist/assets/Vibe64UiStoryboardView-C9v9v4Zv.css +1 -0
- package/dist/assets/{Vibe64UnavailableSessions-hx-_cGSq.js → Vibe64UnavailableSessions-BfaSkPIh.js} +1 -1
- package/dist/assets/{_sessionId_-Dp6jNvbl.js → _sessionId_-Bx2fQJdt.js} +1 -1
- package/dist/assets/_slug_-BNJ4DwRj.js +14 -0
- package/dist/assets/{_slug_-BzW52gC4.css → _slug_-CACf3YXY.css} +1 -1
- package/dist/assets/{access-D8qig7ec.js → access-DvhbzP1W.js} +1 -1
- package/dist/assets/{app-Cj_EAhpX.js → app-DxAkth1b.js} +1 -1
- package/dist/assets/{changes-wPjq7Hm0.js → changes-BgBvTcJs.js} +1 -1
- package/dist/assets/{client-CFYZ-lyr.js → client-DgZ7BJpj.js} +1 -1
- package/dist/assets/{client-DFOt8wBN.js → client-DmD9KhSL.js} +1 -1
- package/dist/assets/{conversation-DI1nCDwa.js → conversation-zwXYLGqc.js} +1 -1
- package/dist/assets/{dashboard-CxIdG5jv.js → dashboard-B8ZPGRSb.js} +1 -1
- package/dist/assets/{english-definitions-ByX3eXsy.js → english-definitions-DzGMSCaJ.js} +1 -1
- package/dist/assets/{env-z9srOupe.js → env-CE1-Na2V.js} +1 -1
- package/dist/assets/errorMessageHelpers-Bf-YjXAL.js +1 -0
- package/dist/assets/{health-Cnxgo_A1.js → health-CzUPMWhP.js} +1 -1
- package/dist/assets/{history-B6Eu1y05.js → history-iHe5lOfS.js} +1 -1
- package/dist/assets/{incoming-C9FqNt2v.js → incoming-DPZHnajt.js} +1 -1
- package/dist/assets/{index-CaALYaBx.css → index-Bw_SFNRe.css} +1 -1
- package/dist/assets/index-DT1bcQbm.js +136 -0
- package/dist/assets/{integrations-CtQ0y43P.js → integrations-CxRqYAB4.js} +1 -1
- package/dist/assets/{issues-CcEiyt-B.js → issues-z8ED0UVJ.js} +1 -1
- package/dist/assets/{learning-675vJSpE.js → learning-C3KucBok.js} +1 -1
- package/dist/assets/{project-files-B_oJKklm.js → project-files-DSOrYwSx.js} +1 -1
- package/dist/assets/{publish-zKiUnNh6.js → publish-WTWqQTu7.js} +1 -1
- package/dist/assets/{pull-requests-CGCXU3Vk.js → pull-requests-CEl58lxJ.js} +1 -1
- package/dist/assets/{repository-Cl1JsvV6.js → repository-B3PXgVP1.js} +1 -1
- package/dist/assets/{settings-CiSyW_3E.js → settings-CoBE8B2-.js} +1 -1
- package/dist/assets/{useArchivedVibe64Sessions-CG7LwvNK.js → useArchivedVibe64Sessions--xBin9tl.js} +1 -1
- package/dist/assets/useAssistantAttachments-DRv0XzKj.js +2 -0
- package/dist/assets/{useCommand-BCpvrh_p.js → useCommand-0NzdEIqN.js} +1 -1
- package/dist/assets/{useEndpointResource-CDrYFeId.js → useEndpointResource-DX_fQ5e0.js} +1 -1
- package/dist/assets/{useUiFeedback-4s9XMiFM.js → useUiFeedback-icdVQp7A.js} +1 -1
- package/dist/assets/{useVibe64ConversationLog-DwfY7cIR.js → useVibe64ConversationLog-ImR785hf.js} +1 -1
- package/dist/assets/{useVibe64DatabaseTools-DxUt1UUx.js → useVibe64DatabaseTools-CInDY3Vy.js} +1 -1
- package/dist/assets/{useVibe64Learning-CxZHaFwU.js → useVibe64Learning-YqOT1_ft.js} +1 -1
- package/dist/assets/{useVibe64SessionData-C-gkuY3U.js → useVibe64SessionData-CwKQmgq-.js} +1 -1
- package/dist/assets/{useVibe64SystemGraph-Dyy2FXVf.js → useVibe64SystemGraph-CpArSXUH.js} +1 -1
- package/dist/assets/vibe64AssistantHost-CyWUOG-F.js +1 -0
- package/dist/assets/{vibe64SessionFocus-CZ8mBals.js → vibe64SessionFocus-DZaD51lR.js} +1 -1
- package/dist/index.html +15 -15
- package/docs/colleague-usage/ai-tasks.md +20 -3
- package/docs/colleague-usage/coding-agent-failures.md +3 -1
- package/docs/colleague-usage/coding-agent-recovery.md +5 -0
- package/docs/colleague-usage/preview-browser-checks.md +11 -0
- package/docs/colleague-usage/preview.md +13 -5
- package/docs/colleague-usage/sessions.md +9 -1
- package/docs/colleague-usage/usage-map.md +45 -12
- package/docs/colleague-usage/usage-recording.md +5 -3
- package/docs/colleague-usage/workspace-preparation.md +3 -1
- package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +346 -0
- package/node_modules/@jskit-ai/assistant-core/locales/en.json +171 -6
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/src/server/repositories/assistantConfigRepository.js +188 -187
- package/node_modules/@jskit-ai/assistant-runtime/src/server/repositories/conversationsRepository.js +230 -229
- package/node_modules/@jskit-ai/assistant-runtime/src/server/repositories/messagesRepository.js +248 -247
- package/node_modules/@jskit-ai/assistant-voice/locales/en.json +2 -1
- package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
- package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
- package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/kernel/CHANGELOG.md +4 -0
- package/node_modules/@jskit-ai/kernel/package.json +1 -1
- package/node_modules/@jskit-ai/realtime/CHANGELOG.md +20 -0
- package/node_modules/@jskit-ai/realtime/locales/en.json +3 -0
- package/node_modules/@jskit-ai/realtime/package.json +1 -1
- package/node_modules/@jskit-ai/resource-core/package.json +1 -1
- package/node_modules/@jskit-ai/resource-crud-core/CHANGELOG.md +21 -0
- package/node_modules/@jskit-ai/resource-crud-core/locales/en.json +18 -0
- package/node_modules/@jskit-ai/resource-crud-core/package.json +3 -2
- package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +442 -436
- package/node_modules/@local/vibe64-genesis/src/server/index.js +48 -45
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +54 -51
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +390 -390
- package/node_modules/@local/vibe64-terminals/src/server/opencodeSessionEnvironmentPlugin.js +30 -29
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +1412 -1408
- package/node_modules/@local/vibe64-usage-recording/README.md +4 -2
- package/node_modules/@local/vibe64-usage-recording/runtime/node/preload.mjs +209 -207
- package/node_modules/@local/vibe64-usage-recording/runtime/php/build.mjs +14 -14
- package/node_modules/@local/vibe64-usage-recording/runtime/php/ext/vibe64_path.h +89 -0
- package/node_modules/@local/vibe64-usage-recording/runtime/php/ext/vibe64_usage.c +7 -9
- package/node_modules/@local/vibe64-usage-recording/runtime/python/vibe64_usage/tracer.py +17 -1
- package/package.json +14 -14
- package/server.bundle.mjs +37628 -37450
- package/dist/assets/Vibe64UiStoryboardView-BHNN4C5U.css +0 -1
- package/dist/assets/Vibe64UiStoryboardView-D0uyPOEQ.js +0 -8
- package/dist/assets/_slug_-TS4avXZJ.js +0 -14
- package/dist/assets/errorMessageHelpers-DcxY5WmY.js +0 -1
- package/dist/assets/index-CSxRprxi.js +0 -136
- package/dist/assets/useAssistantAttachments-LW1SwpSD.js +0 -2
- package/dist/assets/vibe64AssistantHost-BAcbDf1j.js +0 -1
|
@@ -12,8 +12,8 @@ ues.`);if(o&&e.additionalProperties!==!0)throw new Error(`Object field "${t}" on
|
|
|
12
12
|
if(r&&e.additionalProperties===!0)throw new Error(`Object field "${t}" cannot define both values and additionalPropertie\
|
|
13
13
|
s: true.`);if(n){if(!le(e.schema))throw new Error(`Object field "${t}" must define schema as a Schema instance.`);return{
|
|
14
14
|
kind:"nested",schema:e.schema,allowAdditionalProperties:e.additionalProperties===!0}}return r?{kind:"map",valuesConfig:J(
|
|
15
|
-
t,e)}:e.additionalProperties===!0?{kind:"opaque"}:{kind:"plain"}}function R(t){return t?.type==="number"||t?.type==="integer"||t?.type==="epochMilliseconds"||t?.type==="epochSeconds"}var ue="^(?:0|-?[1-9]\\d*)$",qe="\\d{4}",
|
|
16
|
-
(?:${He}):${N}`,Je=`(?:Z|[+-](?:${He}):${N})`,Ge=`(${qe})-(${
|
|
15
|
+
t,e)}:e.additionalProperties===!0?{kind:"opaque"}:{kind:"plain"}}function R(t){return t?.type==="number"||t?.type==="integer"||t?.type==="epochMilliseconds"||t?.type==="epochSeconds"}var ue="^(?:0|-?[1-9]\\d*)$",qe="\\d{4}",Be="0[1-9]|1[0-2]",Ve="0[1-9]|[12]\\d|3[01]",He="[01]\\d|2[0-3]",N="[0-5]\\d",Q=`\
|
|
16
|
+
(?:${He}):${N}`,Je=`(?:Z|[+-](?:${He}):${N})`,Ge=`(${qe})-(${Be})-(${Ve})`,We=`${qe}-(?:${Be})-(?:${Ve})`,Ye=`^${We}$`,Wt=new RegExp(
|
|
17
17
|
`^${Ge}$`),Yt=new RegExp(`^${Q}(?::${N}(?:\\.(\\d+))?)?$`),Xt=new RegExp(`^${Ge}T${Q}:${N}(?:\\.(\\d+))?${Je}$`),Kt=new RegExp(
|
|
18
18
|
ue),Zt=[31,28,31,30,31,30,31,31,30,31,30,31];function Qt(t){return t%4===0&&(t%100!==0||t%400===0)}function er(t,e){return e===
|
|
19
19
|
2?Qt(t)?29:28:Zt[e-1]}function Xe(t,e,n){let r=Number(t),o=Number(e),i=Number(n);return o>=1&&o<=12&&i>=1&&i<=er(r,o)}function G(t,e){
|
|
@@ -224,13 +224,13 @@ e,d)}" is invalid because array segments must use numeric indexes.`);let f=Numbe
|
|
|
224
224
|
h);if(this._fieldToBeSkipped(m,s))continue;if(!Object.hasOwn(l,f)){E&&a.rejectExplicitUndefined&&p(u,m,this._typeError(m).
|
|
225
225
|
errorObject);continue}let v=l[f];if(v===void 0){E&&a.rejectExplicitUndefined&&p(u,m,this._typeError(m).errorObject);continue}
|
|
226
226
|
if(o.kind==="schema"){if(E){let ce=o.schema._validateWithOperation("replace",o.schema.operations.replace,v,D(s,m));re(ce.
|
|
227
|
-
validatedObject)&&p(c,f,ce.validatedObject),this._mergeErrors(u,M(ce.errors,m));continue}if(!j)continue;let
|
|
228
|
-
h.children,v,D(s,m),{...a,operationName:"replace",operation:o.schema.operations.replace,defaultedFields:new Set});re(
|
|
229
|
-
p(c,f,
|
|
230
|
-
S=[v];if(E){let
|
|
231
|
-
S[0]===null&&p(c,f,null),this._mergeErrors(u,
|
|
232
|
-
T);if(Object.keys(ae.errors).length>0){this._mergeErrors(u,ae.errors);continue}if(!ae.shouldContinue)continue;let
|
|
233
|
-
_validateSelectedDescendants(o.definition,h.children,m,S,0,s,T);re(S[0])&&p(c,f,S[0]),this._mergeErrors(u,
|
|
227
|
+
validatedObject)&&p(c,f,ce.validatedObject),this._mergeErrors(u,M(ce.errors,m));continue}if(!j)continue;let V=o.schema._validateSelectedTree(
|
|
228
|
+
h.children,v,D(s,m),{...a,operationName:"replace",operation:o.schema.operations.replace,defaultedFields:new Set});re(V.validatedObject)&&
|
|
229
|
+
p(c,f,V.validatedObject),this._mergeErrors(u,M(V.errors,m));continue}let T=this._buildArrayItemSettings(o.definition,a),
|
|
230
|
+
S=[v];if(E){let V=this._normalizeAndValidateValue(o.definition,v,m,S,0,l,s,T);Object.hasOwn(S,0)&&S[0]!==void 0?p(c,f,S[0]):
|
|
231
|
+
S[0]===null&&p(c,f,null),this._mergeErrors(u,V);continue}if(!j)continue;let ae=this._castValue(o.definition,v,m,S,0,l,s,
|
|
232
|
+
T);if(Object.keys(ae.errors).length>0){this._mergeErrors(u,ae.errors);continue}if(!ae.shouldContinue)continue;let Vt=this.
|
|
233
|
+
_validateSelectedDescendants(o.definition,h.children,m,S,0,s,T);re(S[0])&&p(c,f,S[0]),this._mergeErrors(u,Vt)}return u}validateWith(e,n,r={}){
|
|
234
234
|
if(!Object.hasOwn(this.operations,e))throw new Error(`Unknown operation "${e}".`);let o=this.operations[e];return this._assertPlainObjectInput(
|
|
235
235
|
e,n),this._validateWithOperation(e,o,n,r)}validateAt(e,n,r={}){this._assertPlainObjectInput("validateAt",n);let o=Se(e),
|
|
236
236
|
{operationName:i,operation:s,validationOptions:a}=this._resolvePathValidationRequest(r),c=this._validateSelectedTree(ft(
|
|
@@ -303,15 +303,15 @@ unction")throw new Error(`Type handler for '${e}' must be a function.`);p(t,e,n)
|
|
|
303
303
|
on")throw new Error(`Validator handler for '${e}' must be a function.`);p(t,e,n)}function ie(t={}){let e=Object.create(null);
|
|
304
304
|
for(let[n,r]of Object.entries(t))p(e,n,r);return e}function qr(t,e){if(typeof t.install!="function")throw new Error("Plu\
|
|
305
305
|
gin must have an install method.");t.install(e)}function St(t,e,n){_t.set(t,e),Tt.set(t,n),Object.defineProperty(t,At,{value:Object.
|
|
306
|
-
freeze({getTypes:()=>e,getValidators:()=>n}),enumerable:!1,configurable:!1,writable:!1})}function
|
|
306
|
+
freeze({getTypes:()=>e,getValidators:()=>n}),enumerable:!1,configurable:!1,writable:!1})}function Br(t){if(!t||typeof t!=
|
|
307
307
|
"object"&&typeof t!="function")return null;let e=_t.get(t),n=Tt.get(t);if(e&&n)return{types:e,validators:n};let r=t[At];
|
|
308
308
|
return r&&typeof r.getTypes=="function"&&typeof r.getValidators=="function"?{types:r.getTypes(),validators:r.getValidators()}:
|
|
309
309
|
typeof t=="object"&&t.types&&typeof t.types=="object"&&t.validators&&typeof t.validators=="object"&&typeof t.create=="fu\
|
|
310
310
|
nction"&&typeof t.replace=="function"&&typeof t.patch=="function"&&typeof t.toJsonSchema=="function"?{types:t.types,validators:t.
|
|
311
|
-
validators}:null}function
|
|
311
|
+
validators}:null}function Vr(t){return t.length===1&&Array.isArray(t[0])?t[0]:t}function Hr(t,e){return t===e}function Ct(t,e,n){
|
|
312
312
|
for(let[r,o]of Object.entries(e)){if(Object.hasOwn(t,r)&&!Hr(t[r],o))throw new Error(`Cannot merge schema factories with\
|
|
313
|
-
conflicting ${n} "${r}".`);p(t,r,o)}}function Jr(t,e,n){let r=
|
|
314
|
-
e)};let o=Object.create(null),i=Object.create(null);for(let s of r){let a=
|
|
313
|
+
conflicting ${n} "${r}".`);p(t,r,o)}}function Jr(t,e,n){let r=Vr(n).filter(Boolean);if(r.length<1)return{types:ie(t),validators:ie(
|
|
314
|
+
e)};let o=Object.create(null),i=Object.create(null);for(let s of r){let a=Br(s);if(!a)throw new Error("Factory sources m\
|
|
315
315
|
ust be schema instances or schema factories created by json-rest-schema.");Ct(o,a.types,"type"),Ct(i,a.validators,"valid\
|
|
316
316
|
ator")}return{types:o,validators:i}}function It({types:t={},validators:e={},installCore:n=!0}={}){let r=ie(t),o=ie(e),i=(s,a={})=>{
|
|
317
317
|
let c=new k(s,r,o,a.operations);return St(c,r,o),c};return St(i,r,o),i.addType=(s,a)=>{Fr(r,s,a)},i.addValidator=(s,a)=>{
|
|
@@ -408,12 +408,13 @@ identity)||typeof u.read!="function"||![void 0,"append","replace"].includes(u.pl
|
|
|
408
408
|
on instructions require read() and an optional non-empty identity.");let d=e.get(l);(u.identity===void 0||d?.identity!==
|
|
409
409
|
u.identity)&&(d={identity:u.identity,text:Promise.resolve().then(u.read).then(h=>{if(typeof h!="string"||!h.trim())throw new TypeError(
|
|
410
410
|
"Conversation instructions must contain text.");return h})},e.set(l,d),d.text.catch(()=>{e.get(l)===d&&e.delete(l)}));let f=await d.
|
|
411
|
-
text;if(e.get(l)!==d)throw new Error("Conversation context changed while reading instructions. Retry
|
|
412
|
-
|
|
413
|
-
0
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
411
|
+
text;if(e.get(l)!==d)throw Object.assign(new Error("Conversation context changed while reading instructions. Retry befor\
|
|
412
|
+
e sending."),{messageCode:"assistant.conversation.contextChangedReadingInstructions",messageParams:{}});let m=n.get(c.system);
|
|
413
|
+
if(m!==void 0){let h=c.system.indexOf(m);h>=0&&c.system.splice(h,1)}u.placement==="replace"?c.system.splice(0,c.system.length,
|
|
414
|
+
f):c.system.includes(f)||c.system.push(f),n.set(c.system,f)}function o({event:a}={}){if(!["session.compacted","session.d\
|
|
415
|
+
eleted"].includes(a?.type))return;let c=String(a.properties?.sessionID||a.properties?.info?.id||"").trim();c&&e.delete(c)}
|
|
416
|
+
function i(a){return e.delete(a)}function s(){return e.clear()}return Object.freeze({transformSystem:r,event:o,invalidate:i,
|
|
417
|
+
close:s})}import{isAbsolute as Tn}from"node:path";var mc=new URL("./../../../../@jskit-ai/assistant-core/src/server/conversation/commandWrapper.js",import.meta.url).href,
|
|
417
418
|
Ft=t=>`'${t.replaceAll("'",`'"'"'`)}'`;function An(t){if(typeof t!="string"||!Tn(t)||t.includes("\0"))throw new TypeError(
|
|
418
419
|
"host.commandWrapper must name an absolute executable path.")}function Ut(t,e){if(An(t),typeof e!="string"||!e.trim()||e.
|
|
419
420
|
includes("\0"))throw new TypeError("The native shell tool requires valid command text.");return`${Ft(t)} ${Ft(e)}`}async function Y({client:t,registryPath:e=process.env.JSKIT_OPENCODE_ENV_REGISTRY,resolveHostInstructions:n}={}){let r=JSON.
|
|
@@ -434,15 +435,15 @@ m.url,{method:"POST",signal:f.abort,headers:{authorization:`Bearer ${m.token}`,"
|
|
|
434
435
|
stringify({sessionId:f.sessionID,messageId:f.messageID,id:f.callID,name:l,input:d})}),E=await h.json();if(!h.ok)throw new Error(
|
|
435
436
|
E.error||"The application tool request failed.");return JSON.stringify(E)}}]))}}var _c=new URL("./../../../../@jskit-ai/assistant-core/src/server/conversation/openCodeProcess.js",import.meta.url).href;var jc=256*1024;var Rc=2*1024*1024;var xn=zt.map(({name:t,description:e,parameters:n})=>({type:"function",function:{name:t,description:e,parameters:n}}));import{vibe64Driver as Mn}from"@local/vibe64-genesis/server/promptContext";function g(t=""){return String(t??"").trim()}
|
|
436
437
|
async function Ue(){return F(g(process.env.VIBE64_OPENCODE_SESSION_ENV_REGISTRY))}async function Dn(t=""){return U(await Ue(),
|
|
437
|
-
t)}async function
|
|
438
|
+
t)}async function B(t="",e=null){try{return await q(await Ue(),t,e)}catch(n){throw n.code==="assistant_opencode_parent_u\
|
|
438
439
|
nverified"?new Error("Vibe64 could not verify the subagent's parent session."):n}}function Fe(t,e){return!!(e?.helperModelId&&
|
|
439
440
|
t===`vibe64-helper-${e.modelProviderId}`)}function X(t=""){return`'${String(t??"").replaceAll("'",`'"'"'`)}'`}function kn(){
|
|
440
441
|
return"printf '%s\\n' 'vibe64_agent_control_unavailable: Session command control is unavailable. Reconnect the assistant.\
|
|
441
442
|
' >&2; exit 126"}function qt(t="",e=null){let n=String(t),r=g(e?.env?.VIBE64_WRAPPER);if(!r)return n;let o=`${X(r)} '`;if(!n.
|
|
442
443
|
startsWith(o)||!n.endsWith("'"))return n;let i=n.slice(o.length,-1).replaceAll(`'"'"'`,"'");return`${X(r)} ${X(i)}`===n?
|
|
443
|
-
i:n}function
|
|
444
|
-
e?.env?.VIBE64_WRAPPER);if(!n)return kn();let r=
|
|
445
|
-
{client:t,registryPath:g(process.env.VIBE64_OPENCODE_SESSION_ENV_REGISTRY),resolveHostInstructions:async n=>{let r=await
|
|
444
|
+
i:n}function Bt(t="",e=null){let n=String(t),r=qt(n,e);for(;r!==n;)n=r,r=qt(n,e);return n}function zn(t="",e=null){let n=g(
|
|
445
|
+
e?.env?.VIBE64_WRAPPER);if(!n)return kn();let r=Bt(t,e);return[X(n),X(r)].join(" ")}var el=async({client:t}={})=>{let e=await Y(
|
|
446
|
+
{client:t,registryPath:g(process.env.VIBE64_OPENCODE_SESSION_ENV_REGISTRY),resolveHostInstructions:async n=>{let r=await B(
|
|
446
447
|
n,t);if(!r?.promptContext)return{conversation:r?.conversation,instructions:null};let{workdir:o,promptContext:i}=r;return i.
|
|
447
448
|
scope==="ephemeral"?{conversation:r.conversation,instructions:{identity:JSON.stringify(i),placement:"replace",read:()=>Mn(
|
|
448
449
|
i)}}:{conversation:r.conversation,instructions:{placement:"append",read:()=>{let s=Rn(new URL("../../bin/vibe64-genesis-\
|
|
@@ -450,24 +451,24 @@ host-context",import.meta.resolve("@local/vibe64-genesis/server/promptContext"))
|
|
|
450
451
|
["--instructions"],{cwd:o,timeout:3e4,maxBuffer:262144,encoding:"utf8"},(u,d)=>{u?c(new Error("Project instructions coul\
|
|
451
452
|
d not be loaded. Retry the conversation.",{cause:u})):a(d)});l.stdin.on("error",()=>{}),l.stdin.end(JSON.stringify({workdir:o,
|
|
452
453
|
promptContext:i}))})}}}}});return{...e,"chat.message":async(n={},r={})=>{if(!g(n.agent).startsWith("vibe64-helper-"))return;
|
|
453
|
-
let o=await
|
|
454
|
+
let o=await B(n.sessionID,t);if(!Fe(n.agent,o))throw new Error("This helper is not available through the session's selec\
|
|
454
455
|
ted AI account.");r.message.model={providerID:o.modelProviderId,modelID:o.helperModelId}},"chat.params":async(n={},r={})=>{
|
|
455
|
-
let o=await
|
|
456
|
+
let o=await B(n.sessionID,t);if(L(o,n),g(n.agent).startsWith("vibe64-helper-")&&(!Fe(n.agent,o)||n.model?.providerID!==o.
|
|
456
457
|
modelProviderId||n.model?.id!==o.helperModelId))throw new Error("This helper is not available through the session's sele\
|
|
457
458
|
cted AI account.");$(n,r)},"experimental.chat.messages.transform":async(...n)=>{let r=n[1]||{},o=Array.isArray(r.messages)?
|
|
458
459
|
r.messages:[],i=await Ue();r.messages=await Promise.all(o.map(async s=>{let a=i.find(u=>g(u?.upstreamSessionId)===g(s?.info?.
|
|
459
|
-
sessionID))||await
|
|
460
|
-
"tool"||!["bash","shell"].includes(g(u.tool).toLowerCase())||typeof u?.state?.input?.command!="string")return u;let d=
|
|
460
|
+
sessionID))||await B(s?.info?.sessionID,t);if(!a||!Array.isArray(s?.parts))return s;let c=!1,l=s.parts.map(u=>{if(u?.type!==
|
|
461
|
+
"tool"||!["bash","shell"].includes(g(u.tool).toLowerCase())||typeof u?.state?.input?.command!="string")return u;let d=Bt(
|
|
461
462
|
u.state.input.command,a);return d===u.state.input.command?u:(c=!0,{...u,state:{...u.state,input:{...u.state.input,command:d}}})});
|
|
462
463
|
return c?{...s,parts:l}:s}))},"shell.env":async(n={},r={})=>{let o=await Dn(n.cwd);if(!o)return;if(o.conversation)return e["\
|
|
463
464
|
shell.env"](n,r);let i=o.env&&typeof o.env=="object"&&!Array.isArray(o.env)?o.env:{},s=r.env&&typeof r.env=="object"&&!Array.
|
|
464
465
|
isArray(r.env)?r.env:{};r.env=s,Object.assign(s,i);let a=Array.isArray(o.pathEntries)?o.pathEntries.map(g).filter(Boolean):
|
|
465
466
|
[];s.PATH=[...a,g(i.PATH),g(process.env.PATH)].filter(Boolean).join(Nn.delimiter)},"tool.execute.before":async(n={},r={})=>{
|
|
466
|
-
let o=await
|
|
467
|
+
let o=await B(n.sessionID||n.sessionId,t);if(!o)throw new Error("Vibe64 could not verify this conversation's tool access\
|
|
467
468
|
. Reconnect the assistant.");if(o.conversation)return e["tool.execute.before"](n,r);if(o.promptContext?.scope==="ephemer\
|
|
468
469
|
al")throw new Error("Tools are unavailable in this host conversation. Use only the supplied context.");if(n.tool==="task"){
|
|
469
470
|
if(g(r.args?.subagent_type).startsWith("vibe64-helper-")&&!Fe(r.args.subagent_type,o))throw new Error("Choose the helper\
|
|
470
|
-
belonging to this session's selected AI account.");if(g(r.args?.task_id)){let s=await
|
|
471
|
+
belonging to this session's selected AI account.");if(g(r.args?.task_id)){let s=await B(r.args.task_id,t);if(!o||s?.upstreamSessionId!==
|
|
471
472
|
o.upstreamSessionId)throw new Error("This helper conversation does not belong to the current session.")}}if(!["bash","sh\
|
|
472
473
|
ell"].includes(g(n.tool).toLowerCase()))return;let i=r.args&&typeof r.args=="object"&&!Array.isArray(r.args)?r.args:null;
|
|
473
474
|
!i||typeof i.command!="string"||(i.command=zn(i.command,o))}}};export{el as Vibe64SessionEnvironment};
|