isorite 0.3.0 → 0.5.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/README.md +3 -3
- package/dist/core.js +4 -2
- package/dist/embed-worker.js +9 -4
- package/dist/main.js +7707 -7203
- package/docs/setup-for-agents.md +27 -2
- package/docs/setup.md +28 -2
- package/docs/terminal.md +16 -4
- package/package.json +1 -1
- package/plugin/tui.tsx +3 -77
- package/web/_app/immutable/assets/{0.IOi79DXH.css → 0.DNvf5eFW.css} +1 -1
- package/web/_app/immutable/chunks/-7PsQOY4.js +3 -0
- package/web/_app/immutable/chunks/B9vLu37F.js +1 -0
- package/web/_app/immutable/chunks/BAVeNK5c.js +20 -0
- package/web/_app/immutable/chunks/C1xA2mdF.js +1 -0
- package/web/_app/immutable/chunks/CQqNkDRK.js +1 -0
- package/web/_app/immutable/chunks/Cs9sQ8Oa.js +1 -0
- package/web/_app/immutable/chunks/{BNCmWi9e.js → D4Jg9Smi.js} +1 -1
- package/web/_app/immutable/chunks/{BN1DRYj2.js → DG2llOXe.js} +21 -21
- package/web/_app/immutable/chunks/DqVFJWdL.js +1 -0
- package/web/_app/immutable/chunks/{BZeALCyJ.js → HCrXwzvD.js} +1 -1
- package/web/_app/immutable/chunks/MjV3DsQW.js +1 -0
- package/web/_app/immutable/chunks/uID4v_1K.js +1 -0
- package/web/_app/immutable/entry/app.CR9ubCCo.js +2 -0
- package/web/_app/immutable/entry/start.D4DOZCP6.js +1 -0
- package/web/_app/immutable/nodes/0.BYXv43VP.js +26 -0
- package/web/_app/immutable/nodes/1.DGP71l35.js +1 -0
- package/web/_app/immutable/nodes/2.CxspTYRG.js +1 -0
- package/web/_app/immutable/nodes/3.ZTzs6oEI.js +1 -0
- package/web/_app/immutable/nodes/4.CeIGu2c2.js +2 -0
- package/web/_app/immutable/nodes/5.k1DmYkGm.js +5 -0
- package/web/_app/immutable/nodes/6.Q0yGno8p.js +1 -0
- package/web/_app/immutable/nodes/7.BJRu312o.js +1 -0
- package/web/_app/version.json +1 -1
- package/web/index.html +17 -20
- package/dist/tutorial/barnes_hut.py +0 -46
- package/dist/tutorial/sim.py +0 -29
- package/plugin/tour.ts +0 -74
- package/web/_app/immutable/assets/8.CFA9_nYZ.css +0 -1
- package/web/_app/immutable/assets/Tutorial.DOfsM49T.css +0 -1
- package/web/_app/immutable/chunks/-XH9wLvF.js +0 -1
- package/web/_app/immutable/chunks/B_AYGp9o.js +0 -1
- package/web/_app/immutable/chunks/BavLcJN1.js +0 -1
- package/web/_app/immutable/chunks/BcrJkegU.js +0 -1
- package/web/_app/immutable/chunks/BqrPWk6N.js +0 -20
- package/web/_app/immutable/chunks/Bze-M_kr.js +0 -3
- package/web/_app/immutable/chunks/CRzLMJPS.js +0 -1
- package/web/_app/immutable/chunks/Cr4-_2Vw.js +0 -1
- package/web/_app/immutable/chunks/D25FgEb3.js +0 -43
- package/web/_app/immutable/chunks/D8jeeZa0.js +0 -1
- package/web/_app/immutable/chunks/DHMLhlug.js +0 -1
- package/web/_app/immutable/chunks/DsnHcTIO.js +0 -1
- package/web/_app/immutable/entry/app.B9MdwZzs.js +0 -2
- package/web/_app/immutable/entry/start.gtQcHKDR.js +0 -1
- package/web/_app/immutable/nodes/0.DSajjyn5.js +0 -15
- package/web/_app/immutable/nodes/1.hmQ_l8t-.js +0 -1
- package/web/_app/immutable/nodes/2.Bu6Zvx8F.js +0 -1
- package/web/_app/immutable/nodes/3.DcSG1nNk.js +0 -1
- package/web/_app/immutable/nodes/4.QUhLgH4i.js +0 -2
- package/web/_app/immutable/nodes/5.D3JSWVyR.js +0 -5
- package/web/_app/immutable/nodes/6.CWfUNDww.js +0 -1
- package/web/_app/immutable/nodes/7.DmPPLDvb.js +0 -1
- package/web/_app/immutable/nodes/8.CwMTBog4.js +0 -486
package/web/index.html
CHANGED
|
@@ -35,42 +35,39 @@
|
|
|
35
35
|
history.replaceState(history.state, "", location.pathname.slice(0, -1) + location.search + location.hash);
|
|
36
36
|
}
|
|
37
37
|
</script>
|
|
38
|
-
<link href="/_app/immutable/entry/start.
|
|
39
|
-
<link href="/_app/immutable/chunks/
|
|
40
|
-
<link href="/_app/immutable/chunks
|
|
41
|
-
<link href="/_app/immutable/entry/app.
|
|
42
|
-
<link href="/_app/immutable/chunks/CRzLMJPS.js" rel="modulepreload">
|
|
38
|
+
<link href="/_app/immutable/entry/start.D4DOZCP6.js" rel="modulepreload">
|
|
39
|
+
<link href="/_app/immutable/chunks/HCrXwzvD.js" rel="modulepreload">
|
|
40
|
+
<link href="/_app/immutable/chunks/-7PsQOY4.js" rel="modulepreload">
|
|
41
|
+
<link href="/_app/immutable/entry/app.CR9ubCCo.js" rel="modulepreload">
|
|
43
42
|
<link href="/_app/immutable/chunks/xihTtKlq.js" rel="modulepreload">
|
|
44
|
-
<link href="/_app/immutable/nodes/0.
|
|
45
|
-
<link href="/_app/immutable/chunks/
|
|
46
|
-
<link href="/_app/immutable/chunks/
|
|
47
|
-
<link href="/_app/immutable/chunks/
|
|
48
|
-
<link href="/_app/immutable/chunks/
|
|
49
|
-
<link href="/_app/immutable/chunks/
|
|
50
|
-
<link href="/_app/immutable/chunks/
|
|
51
|
-
<link href="/_app/immutable/chunks/
|
|
52
|
-
<link href="/_app/immutable/chunks
|
|
53
|
-
<link href="/_app/immutable/chunks/B_AYGp9o.js" rel="modulepreload">
|
|
43
|
+
<link href="/_app/immutable/nodes/0.BYXv43VP.js" rel="modulepreload">
|
|
44
|
+
<link href="/_app/immutable/chunks/DG2llOXe.js" rel="modulepreload">
|
|
45
|
+
<link href="/_app/immutable/chunks/MjV3DsQW.js" rel="modulepreload">
|
|
46
|
+
<link href="/_app/immutable/chunks/C1xA2mdF.js" rel="modulepreload">
|
|
47
|
+
<link href="/_app/immutable/chunks/uID4v_1K.js" rel="modulepreload">
|
|
48
|
+
<link href="/_app/immutable/chunks/D4Jg9Smi.js" rel="modulepreload">
|
|
49
|
+
<link href="/_app/immutable/chunks/Cs9sQ8Oa.js" rel="modulepreload">
|
|
50
|
+
<link href="/_app/immutable/chunks/CQqNkDRK.js" rel="modulepreload">
|
|
51
|
+
<link href="/_app/immutable/chunks/B9vLu37F.js" rel="modulepreload">
|
|
54
52
|
|
|
55
53
|
<link href="/_app/immutable/assets/Timeline.KTc3LKuK.css" rel="stylesheet">
|
|
56
54
|
<link href="/_app/immutable/assets/FolderField._A4_sc1Z.css" rel="stylesheet">
|
|
57
55
|
<link href="/_app/immutable/assets/NoteList.F579Zvj_.css" rel="stylesheet">
|
|
58
|
-
<link href="/_app/immutable/assets/0.
|
|
59
|
-
<link href="/_app/immutable/assets/Tutorial.DOfsM49T.css" rel="stylesheet">
|
|
56
|
+
<link href="/_app/immutable/assets/0.DNvf5eFW.css" rel="stylesheet">
|
|
60
57
|
</head>
|
|
61
58
|
<body>
|
|
62
59
|
<div style="display: contents">
|
|
63
60
|
<script>
|
|
64
61
|
{
|
|
65
|
-
|
|
62
|
+
__sveltekit_1f6f2xc = {
|
|
66
63
|
base: new URL('.', location).pathname.slice(0, -1)
|
|
67
64
|
};
|
|
68
65
|
|
|
69
66
|
const element = document.currentScript.parentElement;
|
|
70
67
|
|
|
71
68
|
Promise.all([
|
|
72
|
-
import("/_app/immutable/entry/start.
|
|
73
|
-
import("/_app/immutable/entry/app.
|
|
69
|
+
import("/_app/immutable/entry/start.D4DOZCP6.js"),
|
|
70
|
+
import("/_app/immutable/entry/app.CR9ubCCo.js")
|
|
74
71
|
]).then(([kit, app]) => {
|
|
75
72
|
kit.start(app, element);
|
|
76
73
|
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
|
|
3
|
-
THETA = 0.5
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Node:
|
|
7
|
-
"""A square of the quadtree: its centre and side, its mass and centre of mass, and its children or one body."""
|
|
8
|
-
|
|
9
|
-
def __init__(self, centre, side):
|
|
10
|
-
self.centre, self.side = centre, side
|
|
11
|
-
self.mass, self.com = 0.0, np.zeros(2)
|
|
12
|
-
self.children, self.body = None, None
|
|
13
|
-
|
|
14
|
-
def insert(self, i, r, m):
|
|
15
|
-
# Every node passed on the way down counts the body in its mass and centre of mass.
|
|
16
|
-
self.com = (self.com * self.mass + r[i] * m[i]) / (self.mass + m[i])
|
|
17
|
-
self.mass += m[i]
|
|
18
|
-
if self.children is None and self.body is None:
|
|
19
|
-
self.body = i
|
|
20
|
-
return
|
|
21
|
-
if self.children is None:
|
|
22
|
-
self.children = [Node(self.centre + self.side / 4 * np.array([sx, sy]), self.side / 2) for sx in (-1, 1) for sy in (-1, 1)]
|
|
23
|
-
old, self.body = self.body, None
|
|
24
|
-
self.child(r[old]).insert(old, r, m)
|
|
25
|
-
self.child(r[i]).insert(i, r, m)
|
|
26
|
-
|
|
27
|
-
def child(self, p):
|
|
28
|
-
return self.children[2 * (p[0] > self.centre[0]) + (p[1] > self.centre[1])]
|
|
29
|
-
|
|
30
|
-
def pull(self, p, eps):
|
|
31
|
-
"""The acceleration this node gives a body at p: whole if it is far enough (s/d < θ), else opened."""
|
|
32
|
-
if self.mass == 0 or (self.body is not None and np.allclose(self.com, p)):
|
|
33
|
-
return np.zeros(2)
|
|
34
|
-
d = self.com - p
|
|
35
|
-
dist = np.sqrt(d @ d + eps**2)
|
|
36
|
-
if self.children is None or self.side / dist < THETA:
|
|
37
|
-
return self.mass * d / dist**3
|
|
38
|
-
return sum(c.pull(p, eps) for c in self.children)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def accelerations(r, m, eps=0.01):
|
|
42
|
-
lo, hi = r.min(axis=0), r.max(axis=0)
|
|
43
|
-
root = Node((lo + hi) / 2, max(hi - lo) * 1.001)
|
|
44
|
-
for i in range(len(m)):
|
|
45
|
-
root.insert(i, r, m)
|
|
46
|
-
return np.array([root.pull(p, eps) for p in r])
|
package/dist/tutorial/sim.py
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
|
|
3
|
-
# Two bodies of mass 1/2, 1 apart, each circling the centre of mass at 1/2 (G = 1): the period is 2π.
|
|
4
|
-
m = np.array([0.5, 0.5])
|
|
5
|
-
r = np.array([[-0.5, 0.0], [0.5, 0.0]])
|
|
6
|
-
v = np.array([[0.0, -0.5], [0.0, 0.5]])
|
|
7
|
-
dt, steps = 2 * np.pi / 100, 10_000
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def accelerations(r, m):
|
|
11
|
-
d = r[None, :, :] - r[:, None, :] # d[i, j] = r_j - r_i
|
|
12
|
-
d2 = np.sum(d**2, axis=-1)
|
|
13
|
-
np.fill_diagonal(d2, 1.0)
|
|
14
|
-
inv = d2**-1.5
|
|
15
|
-
np.fill_diagonal(inv, 0.0)
|
|
16
|
-
return np.einsum("ij,ijk->ik", m[None, :] * inv, d)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def energy(r, v, m):
|
|
20
|
-
return 0.5 * np.sum(m * np.sum(v**2, axis=1)) - m[0] * m[1] / np.linalg.norm(r[0] - r[1])
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
a, e0 = accelerations(r, m), energy(r, v, m)
|
|
24
|
-
for step in range(steps):
|
|
25
|
-
v += 0.5 * dt * a # kick
|
|
26
|
-
r += dt * v # drift
|
|
27
|
-
a = accelerations(r, m)
|
|
28
|
-
v += 0.5 * dt * a # kick
|
|
29
|
-
print(f"energy drift after {steps * dt / (2 * np.pi):.0f} orbits: {abs(energy(r, v, m) - e0) / abs(e0):.1e}")
|
package/plugin/tour.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// The tour of isorite in the terminal (`isorite --tutorial`): what each step says, the prompt it fills in for
|
|
2
|
-
// you, and what you do that moves it on, read from what the plugin already knows. A step with no `until` waits
|
|
3
|
-
// for /next. On the example base, as the browser's tutorial is (`app/src/lib/tutorial/steps.ts`): the agent
|
|
4
|
-
// writing code from your notes first, then what the terminal shares with the browser.
|
|
5
|
-
|
|
6
|
-
/** The prompts the tour fills in, word for word: the tutorial's model answers these. */
|
|
7
|
-
export const PROMPTS = {
|
|
8
|
-
code: "write sim.py: two bodies on a circular orbit, stepped with leapfrog, as my notes say",
|
|
9
|
-
tree: "add Barnes–Hut to the code, as my notes describe it, and note where it is",
|
|
10
|
-
} as const;
|
|
11
|
-
|
|
12
|
-
/** What the plugin knows that a step can wait on. */
|
|
13
|
-
export interface TourState {
|
|
14
|
-
/** The page shown: "splash", "home", "session", "note", or another plugin page's name. */
|
|
15
|
-
page: string;
|
|
16
|
-
/** Turns of the agent's that have ended, and the notes now in play. */
|
|
17
|
-
turns: number;
|
|
18
|
-
inPlay: number;
|
|
19
|
-
atlasOpen: boolean;
|
|
20
|
-
/** The note shown, its changes waiting, and whether a moment of its timeline is shown. */
|
|
21
|
-
note: string;
|
|
22
|
-
waiting: number;
|
|
23
|
-
past: boolean;
|
|
24
|
-
/** Iso's answers to asking in place, and notes sent to the agent from the terminal. */
|
|
25
|
-
isoAnswers: number;
|
|
26
|
-
sent: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface TourStep {
|
|
30
|
-
title: string;
|
|
31
|
-
text: string;
|
|
32
|
-
/** Put in the prompt when the step begins, if it is empty. */
|
|
33
|
-
fill?: string;
|
|
34
|
-
/** Moves on when this holds of what the plugin knows, given what held when the step began. */
|
|
35
|
-
until?: (now: TourState, began: TourState) => boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const GOAL = "simulation/two-galaxies-colliding";
|
|
39
|
-
|
|
40
|
-
export const TOUR: TourStep[] = [
|
|
41
|
-
{ title: "isorite in the terminal",
|
|
42
|
-
text: "OpenCode, an agent that writes code, with your notes beside it: a developer's notes on an N-body simulation, and an empty folder for the code. The browser that opened is the other half, on the same notes. The model is scripted. Press enter to open.",
|
|
43
|
-
until: (s) => s.page !== "splash" },
|
|
44
|
-
{ title: "Ask for code", fill: PROMPTS.code,
|
|
45
|
-
text: "The prompt is filled in. Press enter. Before it writes, the agent looks in your notes: by words, by meaning, and along their links. OpenCode asks before it writes a file: allow it.",
|
|
46
|
-
until: (s, b) => s.turns > b.turns && s.inPlay > 0 },
|
|
47
|
-
{ title: "Notes in play",
|
|
48
|
-
text: "On the right: what it found, what it reached from there, and what it used, in gold. Its answer cites your notes, [1] and the section. In the browser, the Atlas draws the same path as it goes. Type /next.",
|
|
49
|
-
},
|
|
50
|
-
{ title: "More, from your notes", fill: PROMPTS.tree,
|
|
51
|
-
text: "Press enter. It reads your notes on Barnes–Hut and the quadtree, writes the code, and adds to your note on the goal where the code now is. The code is OpenCode's, as always; what it changes in a note is marked as its own.",
|
|
52
|
-
until: (s, b) => s.turns > b.turns },
|
|
53
|
-
{ title: "isorite's tools",
|
|
54
|
-
text: "What it used are isorite's: brief_base, search_notes, find_similar, outline_note and read_note to look, edit_note and write_note to change your notes. And two commands: /atlas and /note. Type /next.",
|
|
55
|
-
},
|
|
56
|
-
{ title: "One note's atlas",
|
|
57
|
-
text: "Type /atlas barnes hut. Beside the chat: what the note requires, on the left, and what builds on it, on the right.",
|
|
58
|
-
until: (s) => s.atlasOpen },
|
|
59
|
-
{ title: "Open the note",
|
|
60
|
-
text: "Type /note two galaxies. A note in the terminal: who wrote each paragraph in the gutter, maths as source, links underlined. The paragraph the agent added has its grey diamond: it wrote into the note at once, and the browser marks its words the same way, where you can undo it.",
|
|
61
|
-
until: (s) => s.page === "note" && s.note === GOAL },
|
|
62
|
-
{ title: "Ask Iso here",
|
|
63
|
-
text: "↑ and ↓ choose a paragraph; [/] asks Iso, isorite's own agent, to write after it. Its answer waits between dotted lines: [k] keeps it, [r] removes it.",
|
|
64
|
-
until: (s, b) => s.isoAnswers > b.isoAnswers && s.waiting === 0 },
|
|
65
|
-
{ title: "Every change is kept",
|
|
66
|
-
text: "[t] lists the note's history. Choose a moment to see the note as it was then; [q] comes back to now.",
|
|
67
|
-
until: (s) => s.past },
|
|
68
|
-
{ title: "Send it to the agent",
|
|
69
|
-
text: "[s] sends the paragraph the cursor is on to the agent, with what you want of it. It waits under \"from you\" for your next prompt.",
|
|
70
|
-
until: (s, b) => s.sent > b.sent },
|
|
71
|
-
{ title: "That is the terminal",
|
|
72
|
-
text: "On your own base: isorite term <base>. Point it at a model with ISORITE_GATEWAY_URL, or use OpenCode's own. /tour hides this card, /next closes it.",
|
|
73
|
-
},
|
|
74
|
-
];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.terminal.svelte-1dhdpeh{flex-direction:column;gap:20px;max-width:1480px;margin:0 auto;padding:24px;display:flex}header.svelte-1dhdpeh h1:where(.svelte-1dhdpeh){font-family:var(--font-text);color:var(--text);margin:0 0 8px;font-size:28px;font-weight:400}header.svelte-1dhdpeh p:where(.svelte-1dhdpeh){color:var(--text-soft);max-width:72ch;margin:0;font-size:14px;line-height:1.55}header.svelte-1dhdpeh code:where(.svelte-1dhdpeh){font-family:var(--font-mono);color:var(--text)}.stage.svelte-1dhdpeh{align-items:flex-start;gap:24px;display:flex}.screen.svelte-1dhdpeh{border:1px solid var(--line);background:#07101c;flex:auto;min-width:0;margin:0}.screen.svelte-1dhdpeh canvas:where(.svelte-1dhdpeh){width:100%;height:auto;display:block}.card.svelte-1dhdpeh{--fill:var(--ground-2);--edge:var(--growth);--behind:var(--ground-0);flex-direction:column;flex:none;gap:12px;width:320px;padding:20px 22px 18px;display:flex}.card.svelte-1dhdpeh h2:where(.svelte-1dhdpeh){font-family:var(--font-text);color:var(--text);margin:0;font-size:23px;font-weight:400;line-height:1.25}.card.svelte-1dhdpeh p:where(.svelte-1dhdpeh){color:var(--text-soft);margin:0;font-size:13px;line-height:1.55}.card.svelte-1dhdpeh .does:where(.svelte-1dhdpeh){color:var(--text)}.card.svelte-1dhdpeh .label:where(.svelte-1dhdpeh){color:var(--growth);margin-right:6px}.card.svelte-1dhdpeh .keys:where(.svelte-1dhdpeh){color:var(--text-faint);font-size:12px}.seg.svelte-1dhdpeh{gap:4px;display:flex}.seg.svelte-1dhdpeh button:where(.svelte-1dhdpeh){background:var(--line);cursor:pointer;padding:0;background-clip:content-box;border:0;width:16px;height:6px;padding-block:2px}.seg.svelte-1dhdpeh button.d:where(.svelte-1dhdpeh){background-color:var(--growth)}.actions.svelte-1dhdpeh{align-items:center;gap:12px;margin-top:4px;display:flex}.actions.svelte-1dhdpeh .btn:where(.svelte-1dhdpeh){height:30px;font-size:12px}.grow.svelte-1dhdpeh{flex:1}@media (width<=900px){.stage.svelte-1dhdpeh{flex-direction:column}.screen.svelte-1dhdpeh{align-self:stretch;overflow-x:auto}.screen.svelte-1dhdpeh canvas:where(.svelte-1dhdpeh){width:900px;max-width:none}.card.svelte-1dhdpeh{align-self:stretch;width:auto}.terminal.svelte-1dhdpeh{padding:16px}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.spot.svelte-1195hbs{z-index:40;pointer-events:none;box-shadow:0 0 0 4000px color-mix(in srgb, var(--ground-0) 80%, transparent);outline:1.5px dotted var(--growth);outline-offset:0;position:fixed}.spot.easing.svelte-1195hbs{transition:left .15s,top .15s,width .15s,height .15s}.coach.svelte-1195hbs{z-index:50;--fill:var(--ground-2);--edge:var(--growth);--behind:var(--ground-2);flex-direction:column;gap:12px;width:340px;padding:20px 22px 14px;display:flex;position:fixed;bottom:48px;right:24px}.coach.left.svelte-1195hbs{left:24px;right:auto}.coach.parts.svelte-1195hbs{width:440px;max-height:calc(100vh - 96px)}.coach.parts.svelte-1195hbs .list:where(.svelte-1195hbs){flex:auto;min-height:0;margin-right:-8px;padding-right:8px;overflow-y:auto}.row.svelte-1195hbs{align-items:center;gap:8px;display:flex}.coach.svelte-1195hbs h2:where(.svelte-1195hbs){font-family:var(--font-text);color:var(--text);margin:0;font-size:23px;font-weight:400;line-height:1.25}.coach.svelte-1195hbs p:where(.svelte-1195hbs){color:var(--text-soft);margin:0;font-size:13px;line-height:1.55}.coach.svelte-1195hbs p.faint:where(.svelte-1195hbs){color:var(--text-faint);font-size:12px}.list.svelte-1195hbs{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.section.svelte-1195hbs{text-align:left;width:100%;font:inherit;color:var(--text);border:1px solid var(--line);border-left:2px solid var(--growth);background:0 0;align-items:flex-start;gap:12px;padding:10px;display:flex}button.section.svelte-1195hbs{cursor:pointer}button.section.svelte-1195hbs:hover,button.section.svelte-1195hbs:focus-visible{background:var(--ground-1);border-color:var(--growth);outline:none}button.section.svelte-1195hbs:hover .go:where(.svelte-1195hbs),button.section.svelte-1195hbs:focus-visible .go:where(.svelte-1195hbs){color:var(--growth);transform:translate(2px)}.section.coming.svelte-1195hbs{border-left-color:var(--line);color:var(--text-faint)}.section.coming.svelte-1195hbs .key:where(.svelte-1195hbs){color:var(--text-faint)}.key.svelte-1195hbs{font-family:var(--font-mono);color:var(--growth);flex:none;width:2em;padding-top:2px;font-size:13px}.what.svelte-1195hbs{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.t.svelte-1195hbs{font-family:var(--font-text);font-size:16px}.about.svelte-1195hbs{color:var(--text-faint);font-size:12px;line-height:1.45}.note.svelte-1195hbs{font-family:var(--font-mono);color:var(--text-faint);font-size:11px}.progress.svelte-1195hbs{font-family:var(--font-mono);color:var(--growth);white-space:nowrap;flex:none;align-items:center;gap:8px;padding-top:3px;font-size:11px;display:flex}.go.svelte-1195hbs{color:var(--text-faint);font-size:16px;line-height:1;transition:transform .15s,color .15s}.tick.svelte-1195hbs{color:var(--growth);flex:none}.head.svelte-1195hbs{flex-wrap:wrap;gap:6px 10px}.seg.svelte-1195hbs{align-items:center;gap:3px;margin-left:auto;display:inline-flex}.seg.svelte-1195hbs i:where(.svelte-1195hbs){background:var(--line);width:9px;height:2px}.seg.svelte-1195hbs i.d:where(.svelte-1195hbs){background:var(--growth)}.seg.svelte-1195hbs i.at:where(.svelte-1195hbs){height:4px}.mistake.svelte-1195hbs{border-left:2px solid var(--rose);padding-left:8px;color:var(--rose)!important}.actions.svelte-1195hbs{gap:10px;margin-top:2px}.actions.svelte-1195hbs .btn:where(.svelte-1195hbs){height:30px;font-size:12px}.link.svelte-1195hbs{color:var(--text-faint);cursor:pointer;background:0 0;border:0;padding:2px 0;font-size:11px}.link.svelte-1195hbs:hover,.link.svelte-1195hbs:focus-visible{color:var(--text)}.done.svelte-1195hbs{color:var(--growth);white-space:nowrap;align-items:center;gap:4px;display:inline-flex}.fold.svelte-1195hbs{font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;padding:0}.fold.svelte-1195hbs:after{content:" ▾";color:var(--text-faint);font-size:.7em}.small.svelte-1195hbs .fold:where(.svelte-1195hbs):after{content:" ▴"}.hidden.svelte-1195hbs{display:none}.back.svelte-1195hbs{z-index:50;height:28px;font-size:12px;position:fixed;bottom:44px;right:16px}@media (prefers-reduced-motion:reduce){.spot.easing.svelte-1195hbs,.go.svelte-1195hbs{transition:none}}@media (width<=600px){.coach.svelte-1195hbs,.coach.parts.svelte-1195hbs{left:8px;right:8px;bottom:calc(84px + env(safe-area-inset-bottom));gap:8px;width:auto;padding:14px 16px 10px}.coach.parts.svelte-1195hbs{max-height:calc(100dvh - 160px)}.coach.parts.svelte-1195hbs .list:where(.svelte-1195hbs){margin-right:0;padding-right:0}.coach.svelte-1195hbs h2:where(.svelte-1195hbs){font-size:19px}.seg.svelte-1195hbs i:where(.svelte-1195hbs){width:7px}.actions.svelte-1195hbs{gap:8px}.back.svelte-1195hbs{bottom:calc(84px + env(safe-area-inset-bottom))}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,B as t,D as n,F as r,G as i,J as a,M as o,N as s,P as c,S as l,T as u,X as d,Z as f,c as p,ct as m,i as h,it as g,k as _,l as v,p as y,q as b,rt as x,u as S,y as C}from"./Bze-M_kr.js";import"./xihTtKlq.js";import{t as w}from"./BavLcJN1.js";var T=_(`<li role="option"><button type="button" tabindex="-1" class="svelte-35e6rs"><span class="dir svelte-35e6rs"> </span><span class="detail svelte-35e6rs"> </span></button></li>`),E=_(`<ul class="suggest svelte-35e6rs" role="listbox" aria-label="folders"></ul>`),D=_(`<span class="field-wrap svelte-35e6rs"><input autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list"/> <!></span>`);function O(o,_){g(_,!0);let O=h(_,`value`,15,``),k=h(_,`placeholder`,3,``),A=h(_,`id`,3,`folder`),j=h(_,`quiet`,3,!1),M=f(!1),N=f(0),P=e(()=>O().trim().replace(/^\/+|\/+$/g,``).toLowerCase()),F=e=>w.listing.notes.filter(t=>t.dir===e).length,I=e(()=>{let e=w.listing.dirs.filter(e=>e.toLowerCase().includes(r(P))),t=e=>e.split(`/`).at(-1).toLowerCase().startsWith(r(P))?0:e.toLowerCase().startsWith(r(P))?1:2,n=e.sort((e,n)=>t(e)-t(n)||e.localeCompare(n)).map(e=>({dir:e,made:!1}));return r(P)&&!w.listing.dirs.some(e=>e.toLowerCase()===r(P))&&n.push({dir:O().trim().replace(/^\/+|\/+$/g,``),made:!0}),n.slice(0,8)});function L(e){O(e),d(M,!1),_.onpick?.(e)}function R(e){if(r(M)&&r(I).length){if(e.key===`ArrowDown`){d(N,(r(N)+1)%r(I).length),e.preventDefault();return}if(e.key===`ArrowUp`){d(N,(r(N)-1+r(I).length)%r(I).length),e.preventDefault();return}if((e.key===`Enter`||e.key===`Tab`)&&r(I)[r(N)]&&(e.key===`Enter`||r(P))){e.key===`Enter`&&e.preventDefault(),L(r(I)[r(N)].dir);return}if(e.key===`Escape`){d(M,!1),e.stopPropagation();return}}_.onkeydown?.(e)}var z=D(),B=i(z);v(B);let V;var H=a(B,2),U=e=>{var o=E();C(o,23,()=>r(I),e=>e.dir+e.made,(e,o,l)=>{var f=T();let p;var h=i(f),g=i(h),_=b(g,!0),v=a(g),x=b(v,!0);m(h),m(f),t(e=>{S(f,`id`,`${A()??``}-opt-${r(l)??``}`),S(f,`aria-selected`,r(l)===r(N)),p=y(f,1,`svelte-35e6rs`,null,p,{at:r(l)===r(N)}),u(_,r(o).dir),u(x,e)},[()=>r(o).made?`new folder`:`${F(r(o).dir)} ${F(r(o).dir)===1?`note`:`notes`}`]),s(`mousedown`,h,e=>e.preventDefault()),s(`click`,h,()=>L(r(o).dir)),c(`mouseenter`,h,()=>d(N,r(l),!0)),n(e,f)}),m(o),t(()=>S(o,`id`,`${A()??``}-list`)),n(e,o)};l(H,e=>{r(M)&&r(I).length&&e(U)}),m(z),t(()=>{S(B,`id`,A()),V=y(B,1,`mono svelte-35e6rs`,null,V,{field:!j(),quiet:j()}),S(B,`placeholder`,k()),S(B,`aria-label`,_.label),S(B,`aria-expanded`,r(M)&&r(I).length>0),S(B,`aria-controls`,`${A()??``}-list`),S(B,`aria-activedescendant`,r(M)&&r(I)[r(N)]?`${A()}-opt-${r(N)}`:void 0)}),c(`focus`,B,()=>{d(M,!0),d(N,0)}),s(`input`,B,()=>{d(M,!0),d(N,0)}),c(`blur`,B,()=>setTimeout(()=>d(M,!1),120)),s(`keydown`,B,R),p(B,O),n(o,z),x()}o([`input`,`keydown`,`mousedown`,`click`]);export{O as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as e,X as t,Y as n,Z as r}from"./Bze-M_kr.js";var i=new class{#e=r(n(typeof document>`u`?``:document.documentElement.dataset.ground??``));get chosen(){return e(this.#e)}set chosen(e){t(this.#e,e,!0)}choose(e){this.chosen=e,e?document.documentElement.dataset.ground=e:delete document.documentElement.dataset.ground;try{e?localStorage.setItem(`isorite.ground`,e):localStorage.removeItem(`isorite.ground`)}catch{}}},a=[[``,`the system's`],[`lapis`,`lapis`],[`quartz`,`quartz`]];export{i as n,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as e,X as t,Z as n}from"./Bze-M_kr.js";import{o as r}from"./BZeALCyJ.js";var i=class extends Error{status;current;constructor(e,t,n){super(e),this.status=t,this.current=n}};function a(e=new URL(`api/`,document.baseURI).href){let t=null,n=async(t,n)=>{let r;try{r=await fetch(e+t,n)}catch{throw new i(`isorite is not answering`,0)}let a=await r.json().catch(()=>({}));if(!r.ok)throw new i(a.error??r.statusText,r.status,a.current);return a},r=()=>n(`session`),a=async(e,i,a)=>{t??=r().then(e=>e.token);let o={"Content-Type":`application/json`,"x-isorite-token":await t};return n(i,{method:e,headers:o,body:JSON.stringify(a)})},o=e=>`?id=${encodeURIComponent(e)}`;return{session:async()=>{let{token:e,...n}=await r();return t=Promise.resolve(e),n},notes:()=>n(`notes`),readNote:e=>n(`note`+o(e)),saveNote:(e,t)=>a(`PUT`,`note`+o(e),t),createNote:(e,t)=>a(`POST`,`note`+o(e),{text:t}),journal:e=>n(`journal`+o(e)),version:async(e,t)=>(await n(`version`+o(e)+`&entry=`+encodeURIComponent(t))).text,moveNote:(e,t,n)=>a(`POST`,`note/move`+o(e),{to:t,base:n}),deleteNote:async(e,t)=>{await a(`POST`,`note/delete`+o(e),{base:t})},restore:(e,t,n)=>a(`POST`,`note/restore`+o(e),{entry:t,base:n}),map:()=>n(`map`),timeline:()=>n(`timeline`),search:e=>n(`search?q=${encodeURIComponent(e)}`),ask:e=>a(`POST`,`iso/ask`,e),converse:e=>a(`POST`,`iso/converse`,e),understanding:e=>n(`understanding`+o(e)),saveScratchpad:(e,t,n)=>a(`POST`,`understanding/scratchpad`+o(e),{scratchpad:t,base:n}),undoTurn:(e,t)=>a(`POST`,`iso/undo`,{conversation:e,turn:t}),takeItem:(e,t,n)=>a(`POST`,`iso/take`,{conversation:e,turn:t,item:n}),nameRepository:async()=>!1,brokenNews:async()=>[],answer:async(e,t,n)=>{await a(`POST`,`iso/answer`,{turn:e,permission:t,decision:n})},conversation:async e=>{let t=await n(`conversation`+(e?o(e):``));return t.id?t:null},turnContext:e=>n(`turn/context?turn=${encodeURIComponent(JSON.stringify(e))}`),stop:async e=>{await a(`POST`,`iso/stop`,{request:e})},keep:(e,t,n)=>a(`POST`,`proposal/keep`+o(e),{proposal:t,...n===void 0?{}:{region:n}}),revise:async(e,t,n)=>{await a(`POST`,`proposal/revise`+o(e),{proposal:t,text:n})},discard:async(e,t,n)=>{await a(`POST`,`proposal/discard`+o(e),{proposal:t,...n===void 0?{}:{region:n}})},drafts:()=>n(`drafts`),createDraft:()=>a(`POST`,`drafts`,{}),keepDraft:(e,t,n)=>a(`POST`,`draft/keep`+o(e),{proposal:t,folder:n}),discardDraft:async e=>{await a(`POST`,`draft/discard`+o(e),{})},setDone:(e,t,n)=>a(`POST`,`note/done`+o(e),{done:t,base:n}),context:(e,t)=>n(`context`+(e?o(e):``)+(t?`${e?`&`:`?`}choice=${encodeURIComponent(JSON.stringify(t))}`:``)),clearConversation:async()=>{await a(`POST`,`context/clear`,{})},settings:()=>n(`settings`),setKey:e=>a(`PUT`,`settings/key`,{key:e}),spend:()=>n(`spend`),setSpendCap:e=>a(`PUT`,`settings/spend-cap`,{usd:e}),connect:e=>a(`POST`,`settings/connect`,{callback:e}),connected:(e,t)=>a(`POST`,`settings/connected`,{code:e,state:t}),agentTools:()=>n(`agent/tools`),agentLook:e=>a(`POST`,`agent/look`,e),agentWrite:e=>a(`POST`,`agent/write`,e),agentSend:e=>a(`POST`,`agent/send`,e),agentReceived:async(e,t)=>{await a(`POST`,`agent/received`,{id:e,agent:t})},agentStatus:async(e,t,n)=>{await a(`POST`,`agent/status`,{agent:e,session:t,busy:n})},terminal:{view:()=>n(`terminal`),prompt:async(e,t)=>{await a(`POST`,`terminal/prompt`,{asked:e,given:t})},stop:async()=>{await a(`POST`,`terminal/stop`,{})},reply:async(e,t)=>{await a(`POST`,`terminal/permission`,{id:e,decision:t})}},events(t){let n=new EventSource(e+`events`),r=e=>{try{t(JSON.parse(e.data))}catch{}};for(let e of[`note-changed`,`journal`,`record`,`iso-start`,`iso-step`,`iso-text`,`iso-item`,`iso-answer`,`iso-taken`,`iso-done`,`iso-stopped`,`iso-failed`,`agent-start`,`agent-step`,`agent-done`,`agent-sent`,`agent-received`,`terminal`])n.addEventListener(e,r);return()=>n.close()}}}var o=class{api;#e=n(null);get session(){return e(this.#e)}set session(e){t(this.#e,e)}#t=n({notes:[],dirs:[]});get listing(){return e(this.#t)}set listing(e){t(this.#t,e)}#n=n(``);get error(){return e(this.#n)}set error(e){t(this.#n,e,!0)}#r=n(``);get open(){return e(this.#r)}set open(e){t(this.#r,e,!0)}#i=n(``);get here(){return e(this.#i)}set here(e){t(this.#i,e,!0)}#a=n(null);get saving(){return e(this.#a)}set saving(e){t(this.#a,e,!0)}#o=n(null);get atlas(){return e(this.#o)}set atlas(e){t(this.#o,e)}#s=n(null);get signIn(){return e(this.#s)}set signIn(e){t(this.#s,e)}#c=n(null);get iso(){return e(this.#c)}set iso(e){t(this.#c,e)}watching=``;listeners=new Set;relist=null;async load(e=a()){this.api=e;try{[this.session,this.listing]=await Promise.all([e.session(),e.notes()])}catch(e){this.error=e.message;return}await this.signedIn(),e.events(e=>{this.follow(e);for(let t of this.listeners)t(e);e.type===`note-changed`&&(this.relist&&clearTimeout(this.relist),this.relist=setTimeout(()=>{this.refresh()},300))})}async startSignIn(){let{url:e}=await this.api.connect(location.origin+location.pathname);try{sessionStorage.setItem(s,location.hash)}catch{}location.assign(e)}async signedIn(){let e=new URLSearchParams(location.search),t,n;try{if(e.has(`code`)||e.has(`state`)||e.has(`error`)){let t=sessionStorage.getItem(s)??location.hash;return sessionStorage.removeItem(s),sessionStorage.setItem(c,JSON.stringify({code:e.get(`code`),state:e.get(`state`)})),location.replace(location.pathname+t),new Promise(()=>void 0)}let r=sessionStorage.getItem(c);if(r===null)return;sessionStorage.removeItem(c),{code:t,state:n}=JSON.parse(r)}catch{if({code:t,state:n}={code:e.get(`code`),state:e.get(`state`)},!t&&!n)return}if(!t||!n)this.signIn={ok:!1,message:`No key was made: the sign-in was left or refused.`};else try{let e=await this.api.connected(t,n);this.signIn={ok:!0,message:`Signed in at ${e.provider}: a key was made for isorite, and is held on this device.`}}catch(e){this.signIn={ok:!1,message:e.message}}}async refresh(){try{this.listing=await this.api.notes()}catch{}}follow(e){if(e.type===`iso-start`){this.iso={request:e.request,note:e.note,agent:null,state:`reading`,steps:[],message:``,start:e,text:``};return}if((e.type===`agent-start`||e.type===`agent-step`)&&this.iso?.request!==e.request){if(this.iso&&!this.iso.agent&&(this.iso.state===`reading`||this.iso.state===`writing`))return;this.iso={request:e.request,note:``,agent:e.agent,state:`reading`,steps:[],message:``}}let t=this.iso;t&&`request`in e&&e.request===t.request&&(e.type===`iso-step`||e.type===`agent-step`?this.iso={...t,state:`reading`,steps:[...t.steps,e.step]}:e.type===`iso-text`?this.iso={...t,state:`writing`,text:e.again?e.delta:(t.text??``)+e.delta}:e.type===`iso-done`||e.type===`agent-done`?this.iso={...t,state:`done`}:e.type===`iso-stopped`?this.iso={...t,state:`stopped`}:e.type===`iso-failed`&&(this.iso={...t,state:`failed`,message:e.message}))}on(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},s=`isorite.sign-in.back`,c=`isorite.sign-in.code`,l=new o,u=e=>r(`/n/[...id]`,{id:e});function d(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-+|-+$/g,``)}function f(e){let t=e.trim().replace(/^\/+/,``).replace(/\.md$/,``),n=t.includes(`/`)?l.listing.notes.filter(e=>e.id===t):l.listing.notes.filter(e=>e.id.split(`/`).at(-1)===t),r=n.length===1?n[0]:null;return r?{id:r.id,title:r.title,kind:r.kind??`note`,done:!!r.done}:null}export{i as a,d as i,f as n,u as r,l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as e,X as t,Y as n,Z as r}from"./Bze-M_kr.js";import{o as i,t as a}from"./BZeALCyJ.js";import{r as o}from"./BavLcJN1.js";var s=(e,t)=>{try{return localStorage.getItem(e)??t}catch{return t}},c=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},l=(e,t)=>{try{return{...t,...JSON.parse(s(e,`{}`))}}catch{return t}},u=[`note`,`atlas`,`iso`],d=[`cols`,`stack`,`one`],f={note:[`provenance`,`timeline`],atlas:[`questions`,`problems`,`web`,`code`,`context`],iso:[`notes`,`files`,`run`]},p={provenance:!1,timeline:!1,questions:!0,problems:!0,web:!1,code:!1,context:!1,notes:!1,files:!1,run:!1},m={note:1.25,atlas:1,iso:1.05},h={min:.4,max:3},g=new class{#e=r(n(d.includes(s(`isorite.layout`,``))?s(`isorite.layout`,``):`cols`));get layout(){return e(this.#e)}set layout(e){t(this.#e,e,!0)}#t=r(n(l(`isorite.show`,{note:!0,atlas:!0,iso:!0})));get show(){return e(this.#t)}set show(e){t(this.#t,e,!0)}#n=r(n(l(`isorite.widths`,m)));get widths(){return e(this.#n)}set widths(e){t(this.#n,e,!0)}#r=r(n(l(`isorite.switches`,p)));get on(){return e(this.#r)}set on(e){t(this.#r,e,!0)}#i=r(s(`isorite.understanding`,``)===`1`);get understanding(){return e(this.#i)}set understanding(e){t(this.#i,e,!0)}#a=r(`note`);get focus(){return e(this.#a)}set focus(e){t(this.#a,e,!0)}#o=r(!1);get narrow(){return e(this.#o)}set narrow(e){t(this.#o,e,!0)}#s=r(0);get unseen(){return e(this.#s)}set unseen(e){t(this.#s,e,!0)}#c=r(!1);get tree(){return e(this.#c)}set tree(e){t(this.#c,e,!0)}#l=r(``);get fresh(){return e(this.#l)}set fresh(e){t(this.#l,e,!0)}#u=r(null);get settings(){return e(this.#u)}set settings(e){t(this.#u,e,!0)}#d=r(n(s(`isorite.last`,``)));get last(){return e(this.#d)}set last(e){t(this.#d,e,!0)}get standing(){if(this.narrow)return[...u];let e=u.filter(e=>this.show[e]);return this.layout===`one`?[e.includes(this.focus)?this.focus:e[0]??`note`]:e}layoutChanges=0;setLayout(e){e!==this.layout&&this.layoutChanges++,this.layout=e,c(`isorite.layout`,e)}nextLayout(){this.setLayout(d[(d.indexOf(this.layout)+1)%d.length])}toggle(e){this.show[e]&&u.filter(e=>this.show[e]).length===1||(this.show[e]=!this.show[e],c(`isorite.show`,JSON.stringify(this.show)),!this.show[e]&&this.focus===e&&(this.focus=u.find(e=>this.show[e])))}setWidth(e,t){this.widths[e]=Math.min(h.max,Math.max(h.min,t)),c(`isorite.widths`,JSON.stringify(this.widths))}to(e){!this.narrow&&!this.show[e]&&this.toggle(e),this.focus=e,e===`iso`&&(this.unseen=0),this.scroll?.(e)}scroll=null;step(e){let t=this.narrow?[...u]:u.filter(e=>this.show[e]),n=t.indexOf(this.focus);this.to(t[(n+e+t.length)%t.length])}flip(e,t=!this.on[e]){this.on[e]=t,c(`isorite.switches`,JSON.stringify(this.on)),(e===`notes`||e===`files`||e===`run`)&&this.onMode?.()}showUnderstanding(e=!this.understanding){this.understanding=e,c(`isorite.understanding`,e?`1`:``),this.onMode?.()}busy(e){let t=typeof document>`u`?null:document.activeElement;return!!t&&!!t.closest(`[data-pane="${e}"]`)&&(t.matches(`input, textarea, [contenteditable=true]`)||!!t.closest(`.cm-editor`))}#f=r(!1);get terminal(){return e(this.#f)}set terminal(e){t(this.#f,e,!0)}setTerminal(e){this.terminal=e}get mode(){return this.terminal&&(this.on.files||this.on.run)?`build`:this.on.notes?`write`:`ask`}onMode=null;setLast(e){e&&!e.startsWith(`@`)&&(this.last=e,c(`isorite.last`,e))}async open(e,t=this.narrow){await a(o(e)),t&&this.to(`note`)}async home(){await a(i(`/notes`))}};export{g as i,u as n,f as r,d as t};
|