@famonfa/mono 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mono.mjs +211 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/LICENSE.md +1 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/README.md +69 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/agentSdkTypes.d.ts +1 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/bridge.d.ts +396 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +142 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.d.ts +208 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +145 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core-36zyfan5.mjs +52 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core-5682eevd.mjs +27 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core-nne0e2ds.mjs +40 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core-xpxe8nzb.mjs +26 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core.d.ts +22 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +34 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/extractFromBunfs.d.ts +1 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/extractFromBunfs.js +156 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +82 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +90 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/package.json +94 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk-tools.d.ts +4222 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts +10277 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +169 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +530 -0
- package/node_modules/ws/lib/receiver.js +743 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1421 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/package.json +126 -3
- package/skills/workspace/SKILL.md +108 -0
- package/src/api.mjs +298 -0
- package/src/chats.mjs +446 -0
- package/src/commands.mjs +100 -0
- package/src/groups.mjs +84 -0
- package/src/launcher.mjs +276 -0
- package/src/main.mjs +42 -0
- package/src/paths.mjs +44 -0
- package/src/projects.mjs +199 -0
- package/src/refresh.mjs +124 -0
- package/src/remote.mjs +137 -0
- package/src/sessions.mjs +422 -0
- package/src/store.mjs +253 -0
- package/web/apple-touch-icon.png +0 -0
- package/web/assets/index-DGdmgZ2P.css +1 -0
- package/web/assets/index-TOP7citk.js +55 -0
- package/web/icon-192.png +0 -0
- package/web/icon-512.png +0 -0
- package/web/icon.svg +1 -0
- package/web/index.html +19 -0
- package/web/manifest.webmanifest +13 -0
- package/README.md +0 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
2
|
+
|
|
3
|
+
// Version: 0.3.308
|
|
4
|
+
|
|
5
|
+
// symbol-dispose-prelude: bun build --banner for every SDK bundle; the build
|
|
6
|
+
// scripts grep for this line's tag. Runs before any module body. bun lowers
|
|
7
|
+
// `using` to a helper that keys disposal on the registry symbol when the
|
|
8
|
+
// well-known one is missing, while disposable objects key on the well-known
|
|
9
|
+
// global directly; on engines without a native `Symbol.dispose` (Safari/iOS,
|
|
10
|
+
// Firefox ESR, `node:vm` contexts on Node <=22 such as Jest's `node`
|
|
11
|
+
// environment and vitest's vm pools, and Node before 18.18 / 20.4) the two
|
|
12
|
+
// disagree and every lowered `using` throws. Registering both symbols first
|
|
13
|
+
// makes the keys agree; a no-op where they are native, and a locked-down
|
|
14
|
+
// `Symbol` (SES lockdown) keeps today's behaviour instead of failing to load.
|
|
15
|
+
if (typeof Symbol.dispose !== 'symbol') {
|
|
16
|
+
try {
|
|
17
|
+
Symbol.dispose = Symbol.for('Symbol.dispose')
|
|
18
|
+
} catch {}
|
|
19
|
+
}
|
|
20
|
+
if (typeof Symbol.asyncDispose !== 'symbol') {
|
|
21
|
+
try {
|
|
22
|
+
Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
|
|
23
|
+
} catch {}
|
|
24
|
+
}
|
|
25
|
+
import{u,i,l,r,n,_e,yt,j,Ht,Kt,ae,et,bt,jt,Ct,tt,le}from"./core-nne0e2ds.mjs";import{randomUUID as D}from"crypto";import{constants as _}from"fs";import{open as z,readdir as x,rm as L,stat as Z}from"fs/promises";import{join as g}from"path";class I{available=void 0;probing=void 0;procUnreadableLogged=!1}var $e=new i(()=>new I);var k=["commands","agents","output-styles","skills","workflows","routines","themes","rules","session-env","uploads","mcp-skill-archives","usage-data","mcp-discovery-cache"];var cn=new Set(k),un=`must be one of the userConfigDir directory names (${k.join(", ")})`,R=["installed","marketplaces","flagged","catalog","inUseSweep"];var dn=new Set(R),ln=`must be one of the pluginRegistry files (${R.join(", ")})`,w=["manifest","catalog"];var fn=new Set(w),pn=`must be one of the marketplaceCache forms (${w.join(", ")})`;var P=["world"];var mn=new Set(P),gn=`must be one of the session journal names (${P.join(", ")})`;var C=["backup","corrupted"];var hn=new Set(C),yn=`must be one of the global-config copy kinds (${C.join(", ")})`;var B="cloud-snapshots";var W=new Set(["memory","tiny_memory","bagel",B,"bridge-pointer.json",".session-aliases"]);var v=".cast",Sn=`<stamp>${v} inside a session's folder is that session's terminal recording stream: address it as keys.recording(projectKey, sessionId, stamp)`;var J=[".ccr-tip.json",".precompact.json",v],bn=`must not end with ${J.join(", ")}: those name a session's project-level sibling files`;var q=".dir-sync.json",En=`must not end with ${q}: that name is reserved for a cloud session's record at the project level`;var In=`${[...W].join(", ")} are reserved: they name project-level entries, not sessions`;var X="timeline.jsonl",jn=`${X} is the job's timeline stream: address it as keys.jobTimeline(jobId)`;function y(e){return e===void 0?void 0:{source:e,hoverRestOn:u()}}var Q=64;function E(e){return u()?e:void 0}async function K(e,t,a={},s){if(!j(e))throw Error(`Invalid sessionId: ${e}`);if(!t.trim())throw Error("title must be non-empty");let o=n({type:"custom-title",customTitle:t.trim(),sessionId:e})+`
|
|
26
|
+
`;await T(e,o,a,E(s))}async function A(e,t,a={},s){if(!j(e))throw Error(`Invalid sessionId: ${e}`);if(t!==null){let c=_e(t).trim();if(!c)throw Error("tag must be non-empty (use null to clear)");t=c}let o=n({type:"tag",tag:t??"",sessionId:e})+`
|
|
27
|
+
`;await T(e,o,a,E(s))}async function F(e,t={},a){if(!j(e))throw Error(`Invalid sessionId: ${e}`);let s=E(a);for(let o of await ne(t,s)){if(u()&&s!==void 0){let d=bt(o,s.isKeySegment);if(d!==void 0){if(await ee(d,e,s))return;continue}}let c=g(o,`${e}.jsonl`),f;try{({size:f}=await Z(c))}catch(d){let p=r(d);if(p==="ENOENT"||p==="ENOTDIR")continue;throw d}if(f===0)continue;await L(c,{force:!0}),await L(g(o,e),{recursive:!0,force:!0});return}throw Error(t.dir?`Session ${e} not found in project directory for ${t.dir}`:`Session ${e} not found in any project directory`)}async function ee(e,t,a){let{backend:s,transcriptKey:o}=a,c=o(e,t),f=await s.statMeta(c);if(!f.ok){if(f.error.code==="NotFound")return!1;throw Error("Session delete: transcript unreadable via storage",{cause:f.error})}if((f.value.storedBytes??f.value.size)===0)return!1;for(let p of["transcript","sidecar"]){let m=await s.deleteScope({namespace:p,projectKey:e,sessionId:t});if(!m.ok)throw Error("Session delete: session directory not deletable via storage",{cause:m.error})}let d=await s.delete(c);if(!d.ok)throw Error("Session delete: transcript not deletable via storage",{cause:d.error});return!0}async function ne(e,t){if(e.dir){let s=await jt(e.dir,Ht(t,u())),o=await O(s,t),c;try{c=await yt(s)}catch{c=[]}for(let f of c){if(f===s)continue;o.push(...await O(f,t))}return o}let a=ae();if(u()&&t!==void 0){let s=await N(t);if(s===void 0)return[];if(s.laterPageFailed)throw Error("Session delete: project listing incomplete via storage");return s.names.map((o)=>g(a,o))}try{return(await x(a,{withFileTypes:!0})).filter((o)=>o.isDirectory()||o.isSymbolicLink()).map((o)=>g(a,o.name))}catch{return[]}}async function O(e,t){let a=y(t);if(a===void 0||!a.hoverRestOn)return tt(e);let s=await tt(e,a),o=et(e),c=process.platform==="win32",f=[];for(let d of s)if(d===o||await Ct(d,e,c,a))f.push(d);return f}async function N(e){let t=[],a,s=0;try{do{let o=await e.backend.listEntries({namespace:"transcript"},{skipScopeStats:!0,...a!==void 0&&{cursor:a}});if(!o.ok)return s===0?void 0:{names:t,laterPageFailed:!0};for(let c of o.value.items){let f=Kt(c,e.isKeySegment);if(f!==void 0)t.push(f)}a=o.value.cursor}while(a&&++s<Q);return{names:t,laterPageFailed:Boolean(a)}}catch{return s===0&&t.length===0?void 0:{names:t,laterPageFailed:!0}}}async function T(e,t,a,s){let o=`${e}.jsonl`;if(a.dir){let d=await jt(a.dir,Ht(s,u()));for(let m of await tt(d,y(s)))if(await S(g(m,o),t,b(m,e,s)))return;let p;try{p=await yt(d)}catch{p=[]}for(let m of p){if(m===d)continue;for(let h of await tt(m,y(s)))if(await S(g(h,o),t,b(h,e,s)))return}throw Error(`Session ${e} not found in project directory for ${a.dir}`)}let c=ae();if(u()&&s!==void 0){let d=await N(s);if(d===void 0)throw new l(`Session ${e} not found (no projects directory)`,"Session not found (no projects directory)");let{names:p}=d;for(let m of p){let h=g(c,m);if(await S(g(h,o),t,b(h,e,s)))return}throw new l(`Session ${e} not found in any project directory`,"Session not found in any project directory")}let f;try{f=await x(c)}catch{throw Error(`Session ${e} not found (no projects directory)`)}for(let d of f)if(await S(g(c,d,o),t))return;throw Error(`Session ${e} not found in any project directory`)}async function S(e,t,a){if(u()&&a!==void 0)return re(a,t);let s;try{s=await z(e,_.O_WRONLY|_.O_APPEND)}catch(o){let c=r(o);if(c==="ENOENT"||c==="ENOTDIR")return!1;throw o}try{let{size:o}=await s.stat();if(o===0)return!1;let c=process.platform==="win32"?o:void 0,f=Buffer.from(t,"utf8"),d=0;while(d<f.length){let{bytesWritten:p}=await s.write(f,d,f.length-d,c);if(p<=0)throw new l(`tryAppend: short write to ${e} stalled with ${f.length-d} bytes remaining`,"tryAppend: zero-progress short write");if(d+=p,c!==void 0)c+=p}return!0}finally{await s.close()}}async function re({backend:e,key:t},a){let s=await e.append(t,[{data:a}],{precondition:{type:"ifExists",nonEmpty:!0}});if(!s.ok){if(s.error.code==="NotFound")return!1;throw Error("Session append: transcript not writable via storage",{cause:s.error})}return!0}function b(e,t,a){if(!u()||a===void 0)return;let s=bt(e,a.isKeySegment);return s===void 0?void 0:{backend:a.backend,key:a.transcriptKey(s,t)}}async function er(e,t,a){if(a?.sessionStore)return te(a.sessionStore,e,t,a.dir);return K(e,t,a)}async function nr(e,t,a){if(a?.sessionStore)return se(a.sessionStore,e,t,a.dir);return A(e,t,a)}async function rr(e,t){if(!j(e))throw new l(`Invalid sessionId: ${e}`,"deleteSession: invalid sessionId (must be a UUID)");if(t?.sessionStore){if(!t.sessionStore.delete)return;let a=le(t.dir);await t.sessionStore.delete({projectKey:a,sessionId:e});return}return F(e,t)}async function te(e,t,a,s){if(!j(t))throw new l(`Invalid sessionId: ${t}`,"renameSession: invalid sessionId (must be a UUID)");if(!a.trim())throw Error("title must be non-empty");let o=le(s);await e.append({projectKey:o,sessionId:t},[{type:"custom-title",customTitle:a.trim(),sessionId:t,uuid:D(),timestamp:new Date().toISOString()}])}async function se(e,t,a,s){if(!j(t))throw new l(`Invalid sessionId: ${t}`,"tagSession: invalid sessionId (must be a UUID)");if(a!==null){let c=_e(a).trim();if(!c)throw Error("tag must be non-empty (use null to clear)");a=c}let o=le(s);await e.append({projectKey:o,sessionId:t},[{type:"tag",tag:a??"",sessionId:t,uuid:D(),timestamp:new Date().toISOString()}])}export{rr as deleteSession,er as renameSession,nr as tagSession};
|