@codeyam/codeyam-cli 0.1.20 → 0.1.22
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/analyzer-template/.build-info.json +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +36 -9
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.ts +10 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +16 -6
- package/analyzer-template/packages/analyze/index.ts +4 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +28 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +5 -36
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +21 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +82 -10
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +4 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +4 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyzeNextRoute.ts +8 -3
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +235 -58
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +170 -26
- package/analyzer-template/packages/aws/package.json +1 -1
- package/analyzer-template/packages/database/src/lib/loadEntity.ts +11 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts +4 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.js +4 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts +3 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +22 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +27 -0
- package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js +63 -0
- package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js.map +1 -0
- package/codeyam-cli/src/commands/editor.js +553 -93
- package/codeyam-cli/src/commands/editor.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +991 -31
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +11 -3
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +33 -1
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js +302 -0
- package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js +127 -0
- package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/testRunner.test.js +217 -0
- package/codeyam-cli/src/utils/__tests__/testRunner.test.js.map +1 -0
- package/codeyam-cli/src/utils/analysisRunner.js +28 -1
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +11 -1
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/editorAudit.js +210 -14
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
- package/codeyam-cli/src/utils/editorPreview.js +5 -3
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -1
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +16 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -1
- package/codeyam-cli/src/utils/manualEntityAnalysis.js +196 -0
- package/codeyam-cli/src/utils/manualEntityAnalysis.js.map +1 -0
- package/codeyam-cli/src/utils/queue/job.js +20 -2
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/registerScenarioResult.js +52 -0
- package/codeyam-cli/src/utils/registerScenarioResult.js.map +1 -0
- package/codeyam-cli/src/utils/testRunner.js +199 -1
- package/codeyam-cli/src/utils/testRunner.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +35 -0
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js +3 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/MiniClaudeChat-CQENLSrF.js +36 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-scenario-data-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-schema-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-Coe5NhbS.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-CCKUIm0S.svg → cy-logo-cli-DoA97ML3.svg} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-aIHKLB-m.js +96 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-CluPkvXJ.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-Blfy9UlN.js → entity._sha._-ByHz6rAQ.js} +13 -12
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-KTQuL0aj.js → entity._sha.scenarios._scenarioId.dev-CmLO432x.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-C6eeL24i.js → entity._sha.scenarios._scenarioId.fullscreen-Bz9sCUF_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-oyPmV37k.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/manifest-bcbb3d49.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{root-BxUQigda.js → root-D2_tktnk.js} +26 -13
- package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-DjF-soOH.js +16 -0
- package/codeyam-cli/src/webserver/build/server/assets/{index-CjLhfz6Z.js → index-nAvHGWbz.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{init-BEqlbI84.js → init-XhpIt-OT.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DVwiibFu.js +644 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/idleDetector.js +15 -0
- package/codeyam-cli/src/webserver/idleDetector.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +18 -5
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +2 -2
- package/package.json +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +27 -10
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js +9 -2
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +14 -4
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/analyze/index.js +1 -1
- package/packages/analyze/index.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +16 -2
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +6 -26
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +1 -0
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +14 -0
- package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +44 -11
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +1 -0
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeInitial.js +1 -0
- package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeNextRoute.js +5 -1
- package/packages/analyze/src/lib/files/analyzeNextRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +116 -28
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +139 -24
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/database/src/lib/loadEntity.js +4 -4
- package/packages/database/src/lib/loadEntity.js.map +1 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js +22 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-DII1pg_z.js +0 -58
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-oepecPae.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/globals-Yn9W3zp3.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-cdf2c0a7.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-B_PsTAb1.js +0 -13
- package/codeyam-cli/src/webserver/build/server/assets/server-build-YI63xTu4.js +0 -553
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/addon-web-links-CHx25PAe.js","assets/chunk-JZWAC4HX-BAdwhyCx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var we=Object.defineProperty;var be=(r,e,s)=>e in r?we(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s;var I=(r,e,s)=>be(r,typeof e!="symbol"?e+"":e,s);import{j as d}from"./jsx-runtime-D_zvdyIk.js";import{r as u}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{_ as q}from"./preload-helper-ckwbz45p.js";const $={sound:"soft-double-tap",systemNotification:!0},Te=[{id:"soft-double-tap",label:"Soft double tap"},{id:"gentle-chime",label:"Gentle chime"},{id:"warm-ding",label:"Warm ding"},{id:"mellow-two-tone",label:"Mellow two-tone"},{id:"triangle-bell",label:"Triangle bell"},{id:"off",label:"No sound"}],fe="codeyam-editor-notifications";function Le(){try{const r=localStorage.getItem(fe);if(!r)return $;const e=JSON.parse(r);return typeof e=="string"?e==="true"?$:{...$,sound:"off",systemNotification:!1}:{...$,...e}}catch{return $}}function ke(r){localStorage.setItem(fe,JSON.stringify(r))}function me(r){var e;if(r!=="off")try{const s=new AudioContext,l={"soft-double-tap":t=>{[0,.12].forEach(n=>{const o=t.createOscillator(),v=t.createGain();o.connect(v),v.connect(t.destination),o.type="sine",o.frequency.value=392,v.gain.setValueAtTime(.25,t.currentTime+n),v.gain.exponentialRampToValueAtTime(.01,t.currentTime+n+.1),o.start(t.currentTime+n),o.stop(t.currentTime+n+.1)})},"gentle-chime":t=>{const n=t.createOscillator(),o=t.createGain();n.connect(o),o.connect(t.destination),n.type="sine",n.frequency.setValueAtTime(523,t.currentTime),n.frequency.setValueAtTime(659,t.currentTime+.15),o.gain.setValueAtTime(.3,t.currentTime),o.gain.exponentialRampToValueAtTime(.01,t.currentTime+.4),n.start(),n.stop(t.currentTime+.4)},"warm-ding":t=>{const n=t.createOscillator(),o=t.createGain();n.connect(o),o.connect(t.destination),n.type="sine",n.frequency.value=330,o.gain.setValueAtTime(.35,t.currentTime),o.gain.exponentialRampToValueAtTime(.01,t.currentTime+.6),n.start(),n.stop(t.currentTime+.6)},"mellow-two-tone":t=>{const n=t.createOscillator(),o=t.createGain();n.connect(o),o.connect(t.destination),n.type="sine",n.frequency.setValueAtTime(294,t.currentTime),n.frequency.setValueAtTime(440,t.currentTime+.18),o.gain.setValueAtTime(.3,t.currentTime),o.gain.exponentialRampToValueAtTime(.01,t.currentTime+.5),n.start(),n.stop(t.currentTime+.5)},"triangle-bell":t=>{const n=t.createOscillator(),o=t.createGain();n.connect(o),o.connect(t.destination),n.type="triangle",n.frequency.value=523,o.gain.setValueAtTime(.4,t.currentTime),o.gain.exponentialRampToValueAtTime(.01,t.currentTime+.8),n.start(),n.stop(t.currentTime+.8)}};(e=l[r])==null||e.call(l,s)}catch{}}function je({serverUrl:r,isStarting:e,projectSlug:s,devServerError:l,onStartServer:t,notificationSettings:n,onChangeNotificationSettings:o}){const[v,A]=u.useState(null),[x,g]=u.useState(!1),_=u.useRef(null),E=u.useRef(null);u.useEffect(()=>{if(!s)return;const p=new EventSource("/api/dev-mode-events");return p.onmessage=O=>{try{const P=JSON.parse(O.data);P.type==="file-synced"&&(A(P.fileName),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{A(null)},5e3))}catch{}},()=>{p.close(),E.current&&clearTimeout(E.current)}},[s]),u.useEffect(()=>{if(!x)return;function p(O){_.current&&!_.current.contains(O.target)&&g(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[x]);let T;l?T="error":e?T="starting":r?T="running":T="stopped";const D={starting:"bg-yellow-400",running:"bg-green-400",stopped:"bg-gray-400",error:"bg-red-400"},J={starting:"Starting...",running:r||"Running",stopped:"Stopped",error:"Error"},z=n&&(n.sound!=="off"||n.systemNotification);return d.jsxs("div",{className:"bg-[#1e1e1e] border-t border-[#3d3d3d] h-7 flex items-center px-4 gap-4 shrink-0 text-xs font-mono",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:`w-2 h-2 rounded-full ${D[T]}`}),d.jsxs("span",{className:"text-gray-400",children:["Server:"," ",d.jsx("span",{className:"text-gray-300",children:J[T]})]}),(T==="stopped"||T==="error")&&t&&d.jsx("button",{onClick:t,className:"ml-1 px-2.5 py-0.5 bg-[#005c75] hover:bg-[#007a9a] text-white text-[11px] font-medium rounded transition-colors cursor-pointer border-none leading-tight",children:"Start Server"})]}),d.jsx("div",{className:"w-px h-3 bg-[#3d3d3d]"}),v&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4ade80",strokeWidth:"2",children:d.jsx("path",{d:"M20 6L9 17l-5-5"})}),d.jsxs("span",{className:"text-green-400",children:["Synced: ",v]})]}),d.jsx("div",{className:"w-px h-3 bg-[#3d3d3d]"})]}),d.jsx("div",{className:"flex-1"}),o&&n&&d.jsxs("div",{className:"relative",ref:_,children:[d.jsx("button",{onClick:()=>g(!x),className:`text-[11px] rounded transition-colors cursor-pointer ${z?"text-cygreen hover:text-cygreen/80":"text-gray-500 hover:text-gray-300"}`,children:z?"Notifications On":"Notifications Off"}),x&&d.jsxs("div",{className:"absolute bottom-full right-0 mb-2 w-56 bg-[#2d2d2d] border border-[#4d4d4d] rounded-lg shadow-xl p-3 flex flex-col gap-3 z-50",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-[11px] text-gray-400 mb-1.5",children:"Notification sound"}),d.jsx("div",{className:"flex flex-col gap-0.5",children:Te.map(p=>d.jsx("button",{onClick:()=>{o({...n,sound:p.id}),p.id!=="off"&&me(p.id)},className:`text-left text-[11px] px-2 py-1 rounded cursor-pointer transition-colors ${n.sound===p.id?"bg-[#444] text-white":"text-gray-300 hover:bg-[#3a3a3a]"}`,children:p.label},p.id))})]}),d.jsxs("div",{className:"border-t border-[#4d4d4d] pt-2",children:[d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:n.systemNotification,onChange:p=>{const O=p.target.checked;o({...n,systemNotification:O}),O&&typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},className:"accent-green-500"}),d.jsx("span",{className:"text-[11px] text-gray-300",children:"System notification"})]}),d.jsx("div",{className:"text-[10px] text-gray-500 mt-1 ml-5",children:"Shows when tab is not visible"})]})]})]})]})}async function Ne(r,e){try{const{WebglAddon:l}=await q(async()=>{const{WebglAddon:n}=await import("./addon-webgl-DI8QOUvO.js").then(o=>o.a);return{WebglAddon:n}},[]),t=new l;return t.onContextLoss(()=>{e==null||e("webgl","canvas",new Error("WebGL context lost")),t.dispose(),de(r).then(n=>{n||e==null||e("canvas","dom",new Error("Canvas fallback failed after context loss"))})}),r.loadAddon(t),{type:"webgl",dispose:()=>t.dispose()}}catch(l){e==null||e("webgl","canvas",l)}const s=await de(r);return s||(e==null||e("canvas","dom",new Error("Canvas addon failed")),{type:"dom",dispose:()=>{}})}async function de(r){try{const{CanvasAddon:e}=await q(async()=>{const{CanvasAddon:l}=await import("./addon-canvas-DpzMmAy5.js").then(t=>t.a);return{CanvasAddon:l}},[]),s=new e;return r.loadAddon(s),{type:"canvas",dispose:()=>s.dispose()}}catch{return null}}class Se{constructor(e,s){I(this,"deferred",!1);I(this,"userActiveSinceLastOutput",!1);I(this,"actions");I(this,"env");this.actions=e,this.env=s}reportUserActivity(){this.userActiveSinceLastOutput=!0}resetActivityFlag(){this.userActiveSinceLastOutput=!1}onIdle(e,s){return this.deferred=!1,s&&this.env.hasBrowserFocus()&&this.userActiveSinceLastOutput?(this.userActiveSinceLastOutput=!1,"suppressed"):this.notify(e)}onBuildTabChange(e,s){return!e&&this.deferred?(this.deferred=!1,this.notify(s),!0):!1}onActive(){this.deferred=!1}onUserEngagement(){const e=this.deferred;return this.deferred=!1,e}get isDeferred(){return this.deferred}notify(e){const s=!!(e!=null&&e.sound)&&e.sound!=="off";return s&&this.actions.playSound(e.sound),!this.env.hasBrowserFocus()&&(e!=null&&e.systemNotification)&&this.env.hasNotificationPermission()&&this.actions.showSystemNotification(),s?"played":"played-no-sound"}}class Ae{constructor(e){I(this,"_isIdle",!1);I(this,"_isBuilding",!1);I(this,"callbacks");this.callbacks=e}get isIdle(){return this._isIdle}get isBuilding(){return this._isBuilding}handleClaudeIdle(e,s,l){console.log("[TerminalIdleHandler] claude-idle, building: %s → false",this._isBuilding),e==null||e.onIdle(s,l),this._isIdle=!0,this._isBuilding=!1,this.callbacks.onIdleChange(!0),this.callbacks.onBuildingChange(!1)}handleClaudeActive(e){console.log("[TerminalIdleHandler] claude-active, building: %s → true",this._isBuilding),this._isIdle=!1,this._isBuilding=!0,this.callbacks.onIdleChange(!1),this.callbacks.onBuildingChange(!0),e==null||e.onActive(),e==null||e.resetActivityFlag(),this.callbacks.onCloseNotification()}handleOutput(e){this.callbacks.onIdleChange(!1),e==null||e.resetActivityFlag()}reset(){this._isBuilding&&(console.log("[TerminalIdleHandler] reset, was building: true"),this._isBuilding=!1,this.callbacks.onBuildingChange(!1))}}const _e=`
|
|
3
|
+
.xterm { cursor: text; position: relative; user-select: none; -ms-user-select: none; -webkit-user-select: none; }
|
|
4
|
+
.xterm.focus, .xterm:focus { outline: none; }
|
|
5
|
+
.xterm .xterm-helpers { position: absolute; top: 0; z-index: 5; }
|
|
6
|
+
.xterm .xterm-helper-textarea { padding: 0; border: 0; margin: 0; position: absolute; opacity: 0; left: -9999em; top: 0; width: 0; height: 0; z-index: -5; white-space: nowrap; overflow: hidden; resize: none; caret-color: transparent !important; clip-path: inset(100%) !important; }
|
|
7
|
+
.xterm .composition-view { background: #000; color: #FFF; display: none; position: absolute; white-space: nowrap; z-index: 1; }
|
|
8
|
+
.xterm .composition-view.active { display: block; }
|
|
9
|
+
.xterm .xterm-viewport { background-color: #000; overflow-y: scroll; cursor: default; position: absolute; right: 0; left: 0; top: 0; bottom: 0; }
|
|
10
|
+
.xterm .xterm-screen { position: relative; }
|
|
11
|
+
.xterm .xterm-screen canvas { position: absolute; left: 0; top: 0; }
|
|
12
|
+
.xterm .xterm-scroll-area { visibility: hidden; }
|
|
13
|
+
.xterm-char-measure-element { display: inline-block; visibility: hidden; position: absolute; top: 0; left: -9999em; line-height: normal; }
|
|
14
|
+
.xterm.enable-mouse-events { cursor: default; }
|
|
15
|
+
.xterm.xterm-cursor-pointer, .xterm .xterm-cursor-pointer { cursor: pointer; }
|
|
16
|
+
.xterm.column-select.focus { cursor: crosshair; }
|
|
17
|
+
.xterm .xterm-accessibility:not(.debug), .xterm .xterm-message { position: absolute; left: 0; top: 0; bottom: 0; right: 0; z-index: 10; color: transparent; pointer-events: none; }
|
|
18
|
+
.xterm .xterm-accessibility-tree:not(.debug) *::selection { color: transparent; }
|
|
19
|
+
.xterm .xterm-accessibility-tree { user-select: text; white-space: pre; }
|
|
20
|
+
.xterm .live-region { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
|
|
21
|
+
.xterm-dim { opacity: 1 !important; }
|
|
22
|
+
.xterm-underline-1 { text-decoration: underline; }
|
|
23
|
+
.xterm-underline-2 { text-decoration: double underline; }
|
|
24
|
+
.xterm-underline-3 { text-decoration: wavy underline; }
|
|
25
|
+
.xterm-underline-4 { text-decoration: dotted underline; }
|
|
26
|
+
.xterm-underline-5 { text-decoration: dashed underline; }
|
|
27
|
+
.xterm-overline { text-decoration: overline; }
|
|
28
|
+
.xterm-strikethrough { text-decoration: line-through; }
|
|
29
|
+
.xterm-screen .xterm-decoration-container .xterm-decoration { z-index: 6; position: absolute; }
|
|
30
|
+
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer { z-index: 7; }
|
|
31
|
+
.xterm-decoration-overview-ruler { z-index: 8; position: absolute; top: 0; right: 0; pointer-events: none; }
|
|
32
|
+
.xterm-decoration-top { z-index: 2; position: relative; }
|
|
33
|
+
`;function Ee(){let r=document.getElementById("xterm-css");r||(r=document.createElement("style"),r.id="xterm-css",document.head.appendChild(r)),r.textContent=_e}const We=u.forwardRef(function({entityName:e,entityType:s,entitySha:l,entityFilePath:t,scenarioName:n,scenarioDescription:o,analysisId:v,projectSlug:A,onRefreshPreview:x,onShowResults:g,onHideResults:_,onSetViewport:E,editorMode:T,onIdleChange:D,onBuildingChange:J,notificationSettings:z,buildTabActive:p,claudeStartMode:O,claudeSessionId:P,onDataMutationForwarded:re,resultsOpen:ce,editorStepLabel:le},pe){const ne=u.useRef(null),V=u.useRef(null),G=u.useRef(null),L=u.useRef(null),K=u.useRef(null),X=u.useRef(!1),Y=u.useRef(0),se=u.useRef(!1),k=u.useRef(D);k.current=D;const Z=u.useRef(J);Z.current=J;const ie=u.useRef(z);ie.current=z;const R=u.useRef(p);R.current=p;const ae=u.useRef(ce);ae.current=ce;const B=u.useRef(null),F=u.useRef(!1),N=u.useRef(null);N.current||(N.current=new Se({playSound:i=>me(i),showSystemNotification:()=>{B.current&&B.current.close();const i=new Notification("Claude is ready for you",{body:"Claude has finished and is waiting for your input.",tag:"claude-idle"});i.onclick=()=>{window.focus(),i.close()},B.current=i}},{hasBrowserFocus:()=>document.hasFocus(),hasNotificationPermission:()=>typeof Notification<"u"&&Notification.permission==="granted"}));const j=u.useRef(null);j.current||(j.current=new Ae({onIdleChange:i=>{var f;F.current=i,(f=k.current)==null||f.call(k,i)},onCloseNotification:()=>{B.current&&(B.current.close(),B.current=null)},onBuildingChange:i=>{var f;(f=Z.current)==null||f.call(Z,i)}}));function he(){B.current&&(B.current.close(),B.current=null)}function W(){var i,f;F.current&&(F.current=!1,he(),(i=k.current)==null||i.call(k,!1),(f=N.current)==null||f.onUserEngagement())}u.useEffect(()=>{function i(){var S;document.hasFocus()&&R.current&&W(),R.current&&document.hasFocus()&&((S=N.current)==null||S.reportUserActivity())}function f(){!document.hidden&&R.current&&W()}function C(){var S;document.hasFocus()&&R.current&&W(),R.current&&document.hasFocus()&&((S=N.current)==null||S.reportUserActivity())}function Q(){var S;R.current&&W(),R.current&&((S=N.current)==null||S.reportUserActivity())}return window.addEventListener("focus",Q),document.addEventListener("visibilitychange",f),document.addEventListener("mousemove",i),document.addEventListener("mousedown",C),document.addEventListener("keydown",i),()=>{window.removeEventListener("focus",Q),document.removeEventListener("visibilitychange",f),document.removeEventListener("mousemove",i),document.removeEventListener("mousedown",C),document.removeEventListener("keydown",i)}},[]),u.useEffect(()=>{var i;p&&F.current&&document.hasFocus()&&W(),(i=N.current)==null||i.onBuildTabChange(!!p,ie.current)},[p]);const xe=u.useCallback(()=>{var i;(i=G.current)==null||i.focus()},[]);return u.useImperativeHandle(pe,()=>({sendInput(i){const f=L.current;f&&f.readyState===WebSocket.OPEN&&(f.send(JSON.stringify({type:"input",data:i})),setTimeout(()=>{f.readyState===WebSocket.OPEN&&f.send(JSON.stringify({type:"input",data:"\r"}))},100))},focus(){var i;(i=G.current)==null||i.focus()},scrollToBottom(){var f;const i=(f=ne.current)==null?void 0:f.querySelector(".xterm-viewport");i&&(i.scrollTop=i.scrollHeight)}})),u.useEffect(()=>{const i=ne.current;if(!i)return;let f=!1;return Ee(),Promise.all([q(()=>import("./xterm-BqvuqXEL.js"),[]),q(()=>import("./addon-fit-YJmn1quW.js"),[]),q(()=>import("./addon-web-links-CHx25PAe.js").then(C=>C.a),__vite__mapDeps([0,1]))]).then(([C,Q,S])=>{if(f)return;const m=new C.Terminal({cursorBlink:!1,cursorInactiveStyle:"none",scrollback:5e3,fontSize:13,fontFamily:"'IBM Plex Mono', 'Menlo', 'Monaco', monospace",theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#1e1e1e",selectionBackground:"#264f78"},linkHandler:{activate(a,c){try{const h=new URL(c),w=h.searchParams.get("scenario");if(w&&h.pathname.startsWith("/editor")){const b=new BroadcastChannel("codeyam-editor");b.postMessage({type:"switch-scenario",scenarioId:w}),b.close();return}}catch{}window.open(c,"_blank")}}}),M=new Q.FitAddon;m.loadAddon(M),m.loadAddon(new S.WebLinksAddon),m.open(i),m.attachCustomKeyEventHandler(a=>{if(ae.current&&(a.key==="ArrowLeft"||a.key==="ArrowRight")&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.type==="keydown"){const c=a.key==="ArrowLeft"?"\x1B[D":"\x1B[C",h=L.current;return h&&h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:"input",data:c})),!1}return!0}),m.write("\x1B[?25l");let ee=null;Ne(m,(a,c,h)=>{console.warn(`[Terminal] Renderer fallback: ${a} → ${c}`,h)}).then(a=>{if(f){a.dispose();return}console.log(`[Terminal] Using ${a.type} renderer`),ee=a.dispose}),requestAnimationFrame(()=>{try{M.fit()}catch{}}),G.current=m,m.focus(),setTimeout(()=>m.focus(),100),setTimeout(()=>m.focus(),500);const ye=window.location.protocol==="https:"?"wss:":"ws:",ve=window.location.host;function ge(a){const c=new URLSearchParams;return c.set("entityName",e),s&&c.set("entityType",s),l&&c.set("entitySha",l),t&&c.set("entityFilePath",t),n&&c.set("scenarioName",n),o&&c.set("scenarioDescription",o),v&&c.set("analysisId",v),A&&c.set("projectSlug",A),T&&c.set("editorMode","true"),a&&c.set("reconnectId",a),O&&c.set("claudeStartMode",O),P&&c.set("claudeSessionId",P),le&&c.set("editorStepLabel",le),`${ye}//${ve}/ws/terminal?${c.toString()}`}function oe(a){const c=ge(a),h=new WebSocket(c);L.current=h,h.onopen=()=>{Y.current=0,se.current=!1,h.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},h.onmessage=w=>{var b,U,te;try{const y=JSON.parse(w.data);if(y.type==="session-id"){K.current=y.sessionId;return}if(y.type==="refresh-preview"){x==null||x(y.path,y.scenarioId);return}if(y.type==="show-results"){g==null||g();return}if(y.type==="hide-results"){_==null||_();return}if(y.type==="data-mutation-forwarded"){re==null||re();return}if(y.type==="set-viewport"){E==null||E({name:y.name,width:y.width,height:y.height});return}if(y.type==="claude-idle"){(b=j.current)==null||b.handleClaudeIdle(N.current,ie.current,R.current??!1);return}if(y.type==="claude-active"){(U=j.current)==null||U.handleClaudeActive(N.current);return}y.type==="output"&&(m.write(y.data),(te=j.current)==null||te.handleOutput(N.current))}catch{m.write(w.data)}},h.onclose=()=>{var b,U;if(console.log("[Terminal] WS closed, intentional=%s",X.current),X.current){m.write(`\r
|
|
34
|
+
\x1B[90m[Terminal session ended]\x1B[0m\r
|
|
35
|
+
`),(b=j.current)==null||b.reset();return}const w=Y.current;if(w<5&&K.current){const te=1e3*Math.pow(2,Math.min(w,3));Y.current=w+1,m.write(`\r
|
|
36
|
+
\x1B[33m[Reconnecting...]\x1B[0m\r
|
|
37
|
+
`),setTimeout(()=>{X.current||oe(K.current)},te)}else se.current?(m.write(`\r
|
|
38
|
+
\x1B[90m[Terminal session ended]\x1B[0m\r
|
|
39
|
+
`),(U=j.current)==null||U.reset()):(se.current=!0,m.write(`\r
|
|
40
|
+
\x1B[33m[Starting new session...]\x1B[0m\r
|
|
41
|
+
`),K.current=null,Y.current=0,oe())},h.onerror=()=>{}}oe(),m.onData(a=>{const c=L.current;c&&c.readyState===WebSocket.OPEN&&c.send(JSON.stringify({type:"input",data:a})),W()});let H=null;const ue=new ResizeObserver(()=>{H&&clearTimeout(H),H=setTimeout(()=>{let a;try{a=M.proposeDimensions()}catch{return}if(!a||a.cols===m.cols&&a.rows===m.rows)return;const c=i.querySelector(".xterm-viewport");let h,w=!0;c&&(h=c.scrollTop,w=c.scrollTop+c.clientHeight>=c.scrollHeight-10),M.fit(),c&&h!==void 0&&(w?c.scrollTop=c.scrollHeight:c.scrollTop=h);const b=L.current;b&&b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},150)});ue.observe(i),V.current=()=>{var a;H&&clearTimeout(H),ue.disconnect(),X.current=!0,(a=L.current)==null||a.close(),L.current=null,ee==null||ee(),m.dispose(),G.current=null}}),()=>{var C;f=!0,(C=V.current)==null||C.call(V),V.current=null}},[]),d.jsx("div",{ref:ne,onClick:xe,className:"w-full h-full relative overflow-hidden",style:{padding:"4px 0 0 8px"}})});function Oe(r){return r.replace(/[^a-zA-Z0-9_]+/g,"_")}function ze(r){const{activeAnalyzedScenario:e,analyzedPreviewUrl:s,activeScenarioId:l,scenarios:t,proxyUrl:n,devServerUrl:o,zoomComponent:v}=r;if(e&&s)return s;if(e&&!s)return null;if(l){const x=t.find(g=>g.id===l);if(x!=null&&x.url){const g=n||o;return g?x.url.startsWith("/")?`${g}${x.url}`:x.url:null}}const A=n||o;if(!A)return null;if(v&&l){const x=t.find(_=>_.id===l),g=x?Oe(x.name):"Default";return`${A}/__codeyam__/${v}/${g}`}return A}function Pe(r,e){if(!r||!e)return r;try{const s=new URL(r),l=e.indexOf("?");return l>=0?(s.pathname=e.slice(0,l),s.search=e.slice(l)):(s.pathname=e,s.search=""),s.href}catch{return r}}function Ve(r,e){return r?r!==e:!1}function He(r){if(r.length!==0)return r.find(e=>e.url==="/")||r.find(e=>e.type==="application")||r[0]}function Ue(r,e,s){if(!r.viewportWidth||!r.viewportHeight)return s??null;const l=e.find(t=>t.width===r.viewportWidth&&t.height===r.viewportHeight);return{name:(l==null?void 0:l.name)||"Custom",width:r.viewportWidth,height:r.viewportHeight}}function $e(r,e){const s=e.width,l=e.height??900,t=r.width,n=r.height;return s<=t&&l<=n?1:Math.min(t/s,n/l)}export{je as D,We as T,Pe as a,Oe as b,$ as c,ke as d,$e as e,ze as f,He as g,Le as l,Ue as r,Ve as s};
|