isorite 0.12.0 → 0.13.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.
Files changed (166) hide show
  1. package/README.md +6 -5
  2. package/dist/main.js +5688 -8903
  3. package/docs/setup-for-agents.md +44 -102
  4. package/docs/setup.md +23 -87
  5. package/docs/terminal.md +54 -55
  6. package/guide/AGENTS.md +4 -0
  7. package/guide/atlas/find-what-it-rests-on.md +9 -0
  8. package/guide/atlas/the-atlas.md +21 -0
  9. package/guide/atlas/the-switches/satellites.svg +17 -0
  10. package/guide/atlas/the-switches.md +27 -0
  11. package/guide/iso/agents-md.md +13 -0
  12. package/guide/iso/artifacts/the-guide.csv +8 -0
  13. package/guide/iso/artifacts/the-guide.html +35 -0
  14. package/guide/iso/artifacts.md +15 -0
  15. package/guide/iso/ask-iso.md +7 -0
  16. package/guide/iso/give-it-notes.md +9 -0
  17. package/guide/iso/in-hand.md +18 -0
  18. package/guide/iso/iso-writes-marked.md +15 -0
  19. package/guide/iso/iso.md +17 -0
  20. package/guide/iso/let-it-write.md +11 -0
  21. package/guide/iso/write-agents-md.md +11 -0
  22. package/guide/notes/a-note-is-markdown.md +17 -0
  23. package/guide/notes/a-notes-details.md +23 -0
  24. package/guide/notes/diagrams-and-code.md +43 -0
  25. package/guide/notes/every-change-is-kept.md +14 -0
  26. package/guide/notes/folders.md +11 -0
  27. package/guide/notes/go-back-a-version.md +9 -0
  28. package/guide/notes/link-your-notes.md +9 -0
  29. package/guide/notes/links-and-their-kinds.md +23 -0
  30. package/guide/notes/make-move-delete.md +9 -0
  31. package/guide/notes/write-in-your-notes.md +9 -0
  32. package/guide/out-of-the-base/web-and-code-links.md +13 -0
  33. package/guide/questions-and-problems/ask-a-question.md +9 -0
  34. package/guide/questions-and-problems/how-iso-reads-you.md +9 -0
  35. package/guide/questions-and-problems/problems.md +15 -0
  36. package/guide/questions-and-problems/questions.md +27 -0
  37. package/guide/questions-and-problems/resolve-a-question.md +9 -0
  38. package/guide/questions-and-problems/why-markdown-links.md +7 -0
  39. package/guide/solve-this-one.md +11 -0
  40. package/guide/start-here.md +39 -0
  41. package/guide/terminal/let-the-agent-remember.md +9 -0
  42. package/guide/terminal/memory.md +13 -0
  43. package/guide/terminal/your-own-agent.md +24 -0
  44. package/guide/your-notes.md +6 -0
  45. package/guide/your-own-base/keeping-a-base-well.md +16 -0
  46. package/guide/your-own-base/starting-a-base.md +21 -0
  47. package/package.json +4 -7
  48. package/web/_app/immutable/assets/0.BEjn1Bfl.css +1 -0
  49. package/web/_app/immutable/assets/4.fOHsAKBF.css +1 -0
  50. package/web/_app/immutable/assets/drawn.D6lJzDcc.css +1 -0
  51. package/web/_app/immutable/chunks/{BK6pLgdi.js → 3fCuxe18.js} +1 -1
  52. package/web/_app/immutable/chunks/{D5XlJBy8.js → B-DzK7Gb.js} +1 -1
  53. package/web/_app/immutable/chunks/{BuUzVkG2.js → B35sQTcK.js} +1 -1
  54. package/web/_app/immutable/chunks/{D4YEq54N.js → B6uHgLdT.js} +1 -1
  55. package/web/_app/immutable/chunks/{Dh1lBxfx.js → BA78_vo5.js} +1 -1
  56. package/web/_app/immutable/chunks/{tUSDgbpy.js → BCGaqnao.js} +1 -1
  57. package/web/_app/immutable/chunks/BCyLp7pS.js +1 -0
  58. package/web/_app/immutable/chunks/{EMo1IeTW.js → BK31dpt6.js} +1 -1
  59. package/web/_app/immutable/chunks/BOxykeIc.js +1 -0
  60. package/web/_app/immutable/chunks/{DlXrOzlh.js → BT_btfh0.js} +1 -1
  61. package/web/_app/immutable/chunks/{Xm0YTnxV.js → BWE_HS0c.js} +1 -1
  62. package/web/_app/immutable/chunks/{BLmF1B2i.js → BXBhaEho.js} +1 -1
  63. package/web/_app/immutable/chunks/{BAclEN0O.js → Bb_N98K9.js} +1 -1
  64. package/web/_app/immutable/chunks/{gPtCGHiy.js → Bd-WxALw.js} +1 -1
  65. package/web/_app/immutable/chunks/{BA8Hpxhg.js → BhEqJU15.js} +1 -1
  66. package/web/_app/immutable/chunks/{DkxkvOjx.js → BiATTH-R.js} +1 -1
  67. package/web/_app/immutable/chunks/{D5vocsTl.js → Bj-5n5Pb.js} +1 -1
  68. package/web/_app/immutable/chunks/{DRX-TQzj.js → BqipEJXw.js} +1 -1
  69. package/web/_app/immutable/chunks/{CiMp12cC.js → Bt-fHApV.js} +1 -1
  70. package/web/_app/immutable/chunks/{DXTK-eyo.js → BvPxdlBc.js} +1 -1
  71. package/web/_app/immutable/chunks/{DfCZPwp1.js → C2npZzkn.js} +1 -1
  72. package/web/_app/immutable/chunks/{DF89zyH-.js → C5Z-Y7Lu.js} +1 -1
  73. package/web/_app/immutable/chunks/{CD6xPodA.js → C8h1oeAZ.js} +1 -1
  74. package/web/_app/immutable/chunks/{DDCg82xL.js → C8nK3Jvr.js} +1 -1
  75. package/web/_app/immutable/chunks/{CFEI5lV9.js → CAlIuau0.js} +1 -1
  76. package/web/_app/immutable/chunks/{9z49435t.js → CFf_dAzX.js} +1 -1
  77. package/web/_app/immutable/chunks/{D3-rqfsM.js → CMIt1Ma8.js} +1 -1
  78. package/web/_app/immutable/chunks/{-2Meesge.js → CMikI1NP.js} +3 -3
  79. package/web/_app/immutable/chunks/{Czz9qOh8.js → CT4_O9X_.js} +1 -1
  80. package/web/_app/immutable/chunks/{DX4bJJO0.js → CTDYUZPz.js} +1 -1
  81. package/web/_app/immutable/chunks/{By4S_gy5.js → CdY1G_wk.js} +1 -1
  82. package/web/_app/immutable/chunks/Cd_SqIWq.js +523 -0
  83. package/web/_app/immutable/chunks/{DBC2xjOo.js → CdmC_l9F.js} +1 -1
  84. package/web/_app/immutable/chunks/{DbNETcPs.js → Cf-5I5_6.js} +1 -1
  85. package/web/_app/immutable/chunks/Cl5gQm2e.js +1 -0
  86. package/web/_app/immutable/chunks/{BWVMfAMh.js → CryuQgNh.js} +1 -1
  87. package/web/_app/immutable/chunks/{CT_Ry4q8.js → Ct_EK1xu.js} +1 -1
  88. package/web/_app/immutable/chunks/{BymwHy7o.js → CtkUy_15.js} +1 -1
  89. package/web/_app/immutable/chunks/{Dpa4Syyy.js → CzYPMYd4.js} +1 -1
  90. package/web/_app/immutable/chunks/{RlApGeew.js → D1LK3xRu.js} +1 -1
  91. package/web/_app/immutable/chunks/{DXK7PB4g.js → D6sVhEz3.js} +1 -1
  92. package/web/_app/immutable/chunks/{jTXVas70.js → D9JwUycj.js} +1 -1
  93. package/web/_app/immutable/chunks/{rghE0CVz.js → DCZYeMlH.js} +1 -1
  94. package/web/_app/immutable/chunks/{RFxekmX-.js → DDAG55ce.js} +1 -1
  95. package/web/_app/immutable/chunks/{CyFLqlvP.js → DFuPQaNa.js} +1 -1
  96. package/web/_app/immutable/chunks/{BXAOBcPb.js → DHJ8FcFD.js} +1 -1
  97. package/web/_app/immutable/chunks/{Bt7VOT5H.js → DKqMzyyE.js} +1 -1
  98. package/web/_app/immutable/chunks/{Bq2GBAJ0.js → DRcTlHZP.js} +1 -1
  99. package/web/_app/immutable/chunks/{C_amgxV1.js → DjUnonHY.js} +1 -1
  100. package/web/_app/immutable/chunks/{whhiiiga.js → Djr0h_v1.js} +1 -1
  101. package/web/_app/immutable/chunks/{vfDvz3qP.js → DrVtdHUW.js} +1 -1
  102. package/web/_app/immutable/chunks/{Uo6irDQW.js → O98JkczU.js} +74 -74
  103. package/web/_app/immutable/chunks/{oWM_kgYq.js → PsfIQCJ1.js} +1 -1
  104. package/web/_app/immutable/chunks/{Cl5zRP_n.js → TanDZqdf.js} +1 -1
  105. package/web/_app/immutable/chunks/{D95RKsvN.js → UDPiRmKc.js} +1 -1
  106. package/web/_app/immutable/chunks/WLe0MT1c.js +1 -0
  107. package/web/_app/immutable/chunks/{BTclWEfx.js → ZwM5k8r0.js} +1 -1
  108. package/web/_app/immutable/chunks/e2LGvGEb.js +3 -0
  109. package/web/_app/immutable/chunks/ej_0XxR7.js +1 -0
  110. package/web/_app/immutable/chunks/{CjtKPNlv.js → kG4HctVa.js} +1 -1
  111. package/web/_app/immutable/chunks/{CQd9D8Nc.js → l1LsK1sB.js} +1 -1
  112. package/web/_app/immutable/chunks/{D_jbSWJl.js → s_hW4oA1.js} +1 -1
  113. package/web/_app/immutable/entry/app.DM_AWBgH.js +2 -0
  114. package/web/_app/immutable/entry/start.BLhIKDcR.js +1 -0
  115. package/web/_app/immutable/nodes/0.xSbkmYPn.js +2 -0
  116. package/web/_app/immutable/nodes/1.BD2wJdoH.js +1 -0
  117. package/web/_app/immutable/nodes/2.shPqwtS_.js +1 -0
  118. package/web/_app/immutable/nodes/3.e_5kWaf_.js +1 -0
  119. package/web/_app/immutable/nodes/4.BEMEU6Jz.js +15 -0
  120. package/web/_app/immutable/nodes/5.DxaO-e4O.js +1 -0
  121. package/web/_app/immutable/nodes/6.C9ia8cDm.js +1 -0
  122. package/web/_app/version.json +1 -1
  123. package/web/index.html +16 -19
  124. package/dist/core.js +0 -2464
  125. package/plugin/assets/mark-lapis.png +0 -0
  126. package/plugin/assets/mark-quartz.png +0 -0
  127. package/plugin/assets/wordmark-lapis.png +0 -0
  128. package/plugin/assets/wordmark-quartz.png +0 -0
  129. package/plugin/isorite.ts +0 -65
  130. package/plugin/logo.ts +0 -99
  131. package/plugin/notepage.tsx +0 -165
  132. package/plugin/notes.ts +0 -10
  133. package/plugin/noteview.ts +0 -60
  134. package/plugin/oneatlas.ts +0 -83
  135. package/plugin/palette.ts +0 -21
  136. package/plugin/play.ts +0 -104
  137. package/plugin/server.ts +0 -76
  138. package/plugin/sources.ts +0 -18
  139. package/plugin/tui.tsx +0 -556
  140. package/plugin/wordmark.ts +0 -180
  141. package/web/_app/immutable/assets/0.BXPxx6Q0.css +0 -1
  142. package/web/_app/immutable/assets/4.CUdclsPi.css +0 -1
  143. package/web/_app/immutable/assets/5.rBvyRuST.css +0 -1
  144. package/web/_app/immutable/assets/Drawing.Q7J9MyIo.css +0 -1
  145. package/web/_app/immutable/assets/NoteEditor.S3q5lmKq.css +0 -1
  146. package/web/_app/immutable/assets/Timeline.LsRXYIBv.css +0 -1
  147. package/web/_app/immutable/chunks/4kgFUGOH.js +0 -1
  148. package/web/_app/immutable/chunks/8SS1q0nk.js +0 -7
  149. package/web/_app/immutable/chunks/Bk_JinGf.js +0 -1
  150. package/web/_app/immutable/chunks/BqrMZ9MX.js +0 -1
  151. package/web/_app/immutable/chunks/DThNJvmp.js +0 -1
  152. package/web/_app/immutable/chunks/DbeMVOH4.js +0 -1
  153. package/web/_app/immutable/chunks/DsQj0LyB.js +0 -523
  154. package/web/_app/immutable/chunks/DshHzxgH.js +0 -1
  155. package/web/_app/immutable/chunks/Iqr2CudW.js +0 -3
  156. package/web/_app/immutable/entry/app.CvK8zypr.js +0 -2
  157. package/web/_app/immutable/entry/start.Dcgm6sQd.js +0 -1
  158. package/web/_app/immutable/nodes/0.0TdRBEoR.js +0 -26
  159. package/web/_app/immutable/nodes/1.Dchqgt4j.js +0 -1
  160. package/web/_app/immutable/nodes/2.C0CMUdSu.js +0 -1
  161. package/web/_app/immutable/nodes/3.MjtWDMWd.js +0 -1
  162. package/web/_app/immutable/nodes/4.hhS0SQta.js +0 -2
  163. package/web/_app/immutable/nodes/5.C33_cw2J.js +0 -9
  164. package/web/_app/immutable/nodes/6.owNfwwRl.js +0 -1
  165. package/web/_app/immutable/nodes/7.BpxHVHoY.js +0 -1
  166. /package/web/_app/immutable/assets/{7.C00vyVPo.css → 6.C00vyVPo.css} +0 -0
package/plugin/server.ts DELETED
@@ -1,76 +0,0 @@
1
- // isorite's server half: the knowledge base as tools, the isorite server's own (Iso's look-ups, and changing a
2
- // note), so that what the agent looks up is drawn on the Atlas in the browser as Iso's path is, and what it changes
3
- // in a note is entered under its name, its words marked and undone there, as Iso's Write mode's (M11). Edits
4
- // anywhere else are OpenCode's own.
5
- //
6
- // A turn is told to the server when a prompt is sent, and ended when the session has settled. (A plugin's event
7
- // stream carries no session status.)
8
-
9
- import { Plugin } from "@opencode/plugin";
10
- import * as Isorite from "./isorite.ts";
11
- import { noteOf } from "./notes.ts";
12
- import { CITING } from "./sources.ts";
13
-
14
- const SETTLE = 500;
15
-
16
- export default Plugin.define({
17
- id: "isorite",
18
- async setup(ctx) {
19
- const [tools, base] = await Promise.all([Isorite.get<Isorite.ToolDef[]>("/api/agent/tools"), Isorite.get<{ notes: string | null; name?: string | null; lent?: string[] }>("/api/agent/base")]);
20
- /** What the person last asked in each session: a change to a note says what it answers. */
21
- const asked = new Map<string, string>();
22
-
23
- await ctx.tool.transform((editor) => {
24
- for (const { function: tool } of tools) {
25
- editor.add({
26
- name: tool.name,
27
- description: tool.description,
28
- // Each look-up is a call of its own, so the transcript shows each step, as the board does.
29
- options: { codemode: false },
30
- input: tool.parameters as never,
31
- output: undefined,
32
- execute: async (args, context) => {
33
- const { text } = await Isorite.post<{ text: string }>("/api/agent/look", { agent: Isorite.AGENT, session: context.sessionID, tool: tool.name, args, asked: asked.get(context.sessionID) ?? "" });
34
- return { content: text };
35
- },
36
- });
37
- }
38
- });
39
-
40
- // The agent is told where the notes are, and that they are changed only with isorite's tools.
41
- if (base.notes) {
42
- const notes = base.notes;
43
- // Other bases lent to every session (M20): the agent's memory among them. Each says how it is kept.
44
- const lent = base.lent?.length ? `\n\nOther knowledge bases are lent to you: ${base.lent.join(", ")}. Pass base to the same tools to look or write in one; brief_base with its base first, and follow the practice it gives. A note there is named <base>:folder/name.` : "";
45
- await ctx.session.hook("context", (request) => {
46
- request.system.push({
47
- type: "text",
48
- text: `The person's knowledge base is the folder ${notes}: notes in Markdown with YAML frontmatter, linked to each other. Look things up in it with brief_base, search_notes, outline_note and read_note rather than reading its files. Never edit or write its files directly: change a note with edit_note or write_note, which write it at once and mark your words as yours for the person to see. Your edits to code and other files are yours to make as usual. In a note, and in what you say, a fenced block in the language mermaid is drawn as a diagram in isorite, and code fenced with its language is coloured: draw a diagram where it helps or when asked. A picture in a note is ![what it shows](path), drawn in isorite: you have only its words, so keep its line when you edit around it.${lent}\n\n${CITING}`,
49
- });
50
- });
51
- // A write or an edit to a note anyway is made the same change through isorite, so it is entered and marked.
52
- await ctx.tool.hook("execute.before", (event) => {
53
- if (event.tool !== "write" && event.tool !== "edit") return;
54
- const input = event.input as Record<string, unknown>;
55
- const note = noteOf(notes, ctx.location.directory, input.path);
56
- if (!note) return;
57
- const { path: _, ...rest } = input;
58
- event.tool = event.tool === "write" ? "write_note" : "edit_note";
59
- event.input = { note, ...rest };
60
- });
61
- }
62
-
63
- const status = (session: string, busy: boolean) =>
64
- Isorite.post("/api/agent/status", { agent: Isorite.AGENT, session, busy }).catch(() => undefined);
65
- await ctx.session.hook("prompt", ({ sessionID, prompt }) => {
66
- asked.set(sessionID, prompt.text.trim());
67
- void (async () => {
68
- await status(sessionID, true);
69
- // The prompt is taken up just after this hook; waiting at once could find the session not yet busy.
70
- await new Promise((r) => setTimeout(r, SETTLE));
71
- await ctx.session.wait({ sessionID }).catch(() => undefined);
72
- await status(sessionID, false);
73
- })();
74
- });
75
- },
76
- });
package/plugin/sources.ts DELETED
@@ -1,18 +0,0 @@
1
- // The notes an answer rests on, as the agent is asked to end an answer: a fenced block in the `isorite` language,
2
- // a line a source, `[1] integrators/leapfrog § Kick`. The plugin draws them as the board does (`[1] the dmft loop
3
- // § mixing`), and counts the notes they name as used.
4
-
5
- /** What the agent is told, in the system prompt, about citing notes. */
6
- export const CITING = "When your answer rests on notes of the knowledge base, cite each in your text as `[1]`, `[2]`, in backticks, and end the answer with a fenced code block in the language isorite holding a line a source: [1] the note's path, and § the section when you read one. For example:\n```isorite\n[1] integrators/leapfrog\n[2] physics/energy-conservation\n```";
7
-
8
- export interface Source { n: string; note: string; section?: string }
9
-
10
- /** The sources a block names, each with its number, its note (as an id, without a leading / or .md) and section. */
11
- export function parseSources(block: string): Source[] {
12
- return block.split("\n").flatMap((line) => {
13
- const m = /^\s*\[(\d+)\]\s+([^§\s]+)\s*(?:§\s*(.*?))?\s*$/.exec(line);
14
- if (!m) return [];
15
- const note = m[2]!.replace(/^\/+/, "").replace(/\.md$/i, "");
16
- return [{ n: m[1]!, note, ...(m[3] ? { section: m[3] } : {}) }];
17
- });
18
- }