@schlenkr/ragents 0.1.7 → 0.1.9

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 (187) hide show
  1. package/apps/server/src/config-definition.ts +24 -2
  2. package/apps/server/src/config.ts +0 -6
  3. package/apps/server/src/host-api.json +3 -10
  4. package/apps/server/src/host-api.ts +6 -7
  5. package/apps/server/src/plugin-build/build.ts +28 -5
  6. package/apps/server/src/plugin-build/plugin-description.ts +1 -1
  7. package/apps/server/src/plugin-build/typecheck.ts +2 -2
  8. package/apps/server/src/plugin-support/language-server/plugin.ts +8 -7
  9. package/apps/server/src/plugin-support/language-server/tools.ts +7 -6
  10. package/apps/server/src/plugin-support/model-aliases.ts +55 -25
  11. package/apps/server/src/plugin-support/plugin-folder.ts +2 -1
  12. package/apps/server/src/plugin-support/product-relay.ts +10 -2
  13. package/apps/server/src/plugin-support/workspace-sandbox-host.ts +18 -9
  14. package/apps/server/src/profile/bundle-manifest.ts +7 -3
  15. package/apps/server/src/profile/compose.ts +6 -0
  16. package/apps/server/src/profile/plugin-discovery.ts +6 -1
  17. package/apps/server/src/profile/provisioning.ts +6 -5
  18. package/apps/server/src/ragents/engine.ts +18 -12
  19. package/apps/server/src/ragents/host-services.ts +4 -0
  20. package/apps/server/src/ragents/session.ts +1 -1
  21. package/apps/server/src/server.ts +1 -0
  22. package/apps/server/tsconfig.json +2 -0
  23. package/apps/web/dist/assets/{highlighted-body-KPVGNVTW-CFhTJEmH.js → highlighted-body-KPVGNVTW-xXXhTDbh.js} +1 -1
  24. package/apps/web/dist/assets/{main-DlzW4t4c.js → main-C7JeZFjs.js} +1 -1
  25. package/apps/web/dist/assets/{mermaid-HWGCJPDP-kxkB991i.js → mermaid-HWGCJPDP-DfsU5ofC.js} +2 -2
  26. package/apps/web/dist/assets/{runPanel-BJEFQ__w.js → runPanel-ZT6TPDLM.js} +1 -1
  27. package/apps/web/dist/help/guide-clients.html +14 -6
  28. package/apps/web/dist/help/guide-clients.md +14 -6
  29. package/apps/web/dist/help/guide-distributed.html +12 -4
  30. package/apps/web/dist/help/guide-distributed.md +12 -4
  31. package/apps/web/dist/help/guide-getting-started.html +12 -8
  32. package/apps/web/dist/help/guide-getting-started.md +12 -8
  33. package/apps/web/dist/help/guide-plugins.html +6 -2
  34. package/apps/web/dist/help/guide-plugins.md +6 -2
  35. package/apps/web/dist/help/guide-runtime.html +2 -1
  36. package/apps/web/dist/help/guide-runtime.md +2 -1
  37. package/apps/web/dist/help/index.html +3328 -1135
  38. package/apps/web/dist/host-web.json +4 -4
  39. package/apps/web/dist/index.html +2 -2
  40. package/apps/web/dist/run-panel.html +2 -2
  41. package/apps/web/src/StartTiles.tsx +1 -1
  42. package/bundles/ragents.activity/ragents-bundle.json +3 -3
  43. package/bundles/ragents.actor-programs/ragents-bundle.json +3 -3
  44. package/bundles/ragents.ask/ragents-bundle.json +4 -4
  45. package/bundles/ragents.ask/server/index.js +42 -11
  46. package/bundles/ragents.ask/server/index.js.map +3 -3
  47. package/bundles/ragents.ask/web/chunks/chunk-WFN4374U.js +2 -0
  48. package/bundles/ragents.ask/web/chunks/chunk-WFN4374U.js.map +7 -0
  49. package/bundles/ragents.ask/web/classes.json +1 -1
  50. package/bundles/ragents.ask/web/exports/ask-payload.js +1 -1
  51. package/bundles/ragents.ask/web/index.js +1 -1
  52. package/bundles/ragents.ask/web/index.js.map +3 -3
  53. package/bundles/ragents.browser/executor/index.mjs +357 -0
  54. package/bundles/ragents.browser/executor/index.mjs.map +7 -0
  55. package/bundles/ragents.browser/ragents-bundle.json +5 -8
  56. package/bundles/ragents.browser/server/chunks/{chunk-2GKLLCBE.js → chunk-CWLX4VA5.js} +1 -1
  57. package/bundles/ragents.browser/server/chunks/chunk-CWLX4VA5.js.map +7 -0
  58. package/bundles/ragents.browser/server/exports/server/contract.js +1 -1
  59. package/bundles/ragents.browser/server/index.js +20 -9
  60. package/bundles/ragents.browser/server/index.js.map +4 -4
  61. package/bundles/ragents.documents/ragents-bundle.json +3 -3
  62. package/bundles/ragents.lsp-fsharp/executor/index.mjs +68 -0
  63. package/bundles/ragents.lsp-fsharp/executor/index.mjs.map +7 -0
  64. package/bundles/ragents.lsp-fsharp/ragents-bundle.json +5 -9
  65. package/bundles/ragents.lsp-fsharp/server/index.js +21 -6
  66. package/bundles/ragents.lsp-fsharp/server/index.js.map +4 -4
  67. package/bundles/ragents.lsp-roslyn/executor/index.mjs +68 -0
  68. package/bundles/ragents.lsp-roslyn/executor/index.mjs.map +7 -0
  69. package/bundles/ragents.lsp-roslyn/ragents-bundle.json +6 -8
  70. package/bundles/ragents.lsp-roslyn/server/index.js +54 -15
  71. package/bundles/ragents.lsp-roslyn/server/index.js.map +4 -4
  72. package/bundles/ragents.lsp-typescript/executor/index.mjs +49 -0
  73. package/bundles/ragents.lsp-typescript/executor/index.mjs.map +7 -0
  74. package/bundles/ragents.lsp-typescript/ragents-bundle.json +5 -7
  75. package/bundles/ragents.lsp-typescript/server/index.js +22 -2
  76. package/bundles/ragents.lsp-typescript/server/index.js.map +3 -3
  77. package/bundles/ragents.model-relay/ragents-bundle.json +4 -4
  78. package/bundles/ragents.model-relay/server/index.js +3 -2
  79. package/bundles/ragents.model-relay/server/index.js.map +2 -2
  80. package/bundles/ragents.orchestration/ragents-bundle.json +3 -3
  81. package/bundles/ragents.overseer/ragents-bundle.json +3 -3
  82. package/bundles/ragents.processes/ragents-bundle.json +3 -3
  83. package/bundles/ragents.product/ragents-bundle.json +3 -3
  84. package/bundles/ragents.profile-distribution/ragents-bundle.json +4 -4
  85. package/bundles/ragents.profile-distribution/server/index.js +1 -1
  86. package/bundles/ragents.profile-distribution/server/index.js.map +2 -2
  87. package/bundles/ragents.reference/ragents-bundle.json +3 -3
  88. package/bundles/ragents.todo/ragents-bundle.json +3 -3
  89. package/bundles/ragents.transcript/ragents-bundle.json +3 -3
  90. package/bundles/ragents.watch/ragents-bundle.json +3 -3
  91. package/bundles/ragents.workspace/ragents-bundle.json +11 -5
  92. package/bundles/ragents.workspace/server/index.js +101 -28
  93. package/bundles/ragents.workspace/server/index.js.map +3 -3
  94. package/bundles/ragents.workspace/web/classes.json +1 -1
  95. package/bundles/ragents.workspace/web/index.js +1 -1
  96. package/bundles/ragents.workspace/web/index.js.map +3 -3
  97. package/package.json +2 -2
  98. package/packages/agent/dist/core/agent-settings.d.ts +1 -7
  99. package/packages/agent/dist/core/compaction/compaction.d.ts +17 -13
  100. package/packages/agent/dist/core/model-runtime.d.ts +5 -4
  101. package/packages/agent/dist/core/provider-composer.d.ts +2 -1
  102. package/packages/agent/dist/core/tools/bash.d.ts +9 -3
  103. package/packages/agent/dist/index.d.ts +1 -1
  104. package/packages/agent/src/core/agent-settings.ts +1 -4
  105. package/packages/agent/src/core/compaction/compaction.ts +68 -30
  106. package/packages/agent/src/core/model-runtime.ts +12 -5
  107. package/packages/agent/src/core/provider-composer.ts +5 -0
  108. package/packages/agent/src/core/tools/bash.ts +36 -30
  109. package/packages/agent/src/index.ts +3 -0
  110. package/packages/ai/dist/types.d.ts +11 -0
  111. package/packages/ai/src/types.ts +12 -0
  112. package/packages/ragents/src/agents/plugins.ts +5 -0
  113. package/packages/ragents/src/domain/event-semantics.ts +3 -0
  114. package/packages/ragents/src/domain/event-validation.ts +15 -2
  115. package/packages/ragents/src/domain/events.ts +3 -0
  116. package/packages/ragents/src/domain/model.ts +2 -0
  117. package/packages/ragents/src/domain/projection.ts +1 -0
  118. package/packages/ragents/src/drivers/agent-runtime.ts +1 -1
  119. package/packages/ragents/src/drivers/agent-turn.ts +8 -6
  120. package/packages/ragents/src/index.ts +1 -0
  121. package/packages/ragents/src/plugin-host.ts +58 -10
  122. package/packages/ragents/src/plugin-types.ts +7 -2
  123. package/packages/ragents/src/runtime/decisions/inputs.ts +6 -2
  124. package/packages/ragents/src/runtime/journal-storage.ts +5 -4
  125. package/packages/workspace-executor/package.json +0 -1
  126. package/packages/workspace-executor/src/bash-launch.ts +56 -10
  127. package/packages/workspace-executor/src/context.ts +4 -0
  128. package/packages/workspace-executor/src/contributions.ts +150 -0
  129. package/packages/workspace-executor/src/executor.ts +1 -1
  130. package/packages/workspace-executor/src/index.ts +16 -19
  131. package/packages/workspace-executor/src/language-server/host.ts +3 -0
  132. package/packages/workspace-executor/src/language-server/module.ts +12 -2
  133. package/packages/workspace-executor/src/language-server/roots.ts +0 -5
  134. package/packages/workspace-executor/src/modules.ts +7 -6
  135. package/packages/workspace-executor/src/sandbox-tools.ts +3 -9
  136. package/packages/workspace-executor/src/shell-platform.ts +14 -3
  137. package/packages/workspace-executor/src/tools.ts +0 -3
  138. package/plugins/ragents.ask/ask-payload.ts +9 -0
  139. package/plugins/ragents.ask/server/ask-service.ts +53 -13
  140. package/plugins/ragents.ask/web/AskActionView.tsx +3 -2
  141. package/plugins/ragents.browser/executor/index.ts +5 -0
  142. package/{packages/workspace-executor/src/browser → plugins/ragents.browser/executor}/module.ts +25 -31
  143. package/{packages/workspace-executor/src/browser → plugins/ragents.browser/executor}/playwright.ts +9 -23
  144. package/plugins/ragents.browser/provision.ts +1 -1
  145. package/plugins/ragents.browser/server/browser.ts +3 -3
  146. package/plugins/ragents.browser/server/contract.ts +2 -2
  147. package/plugins/ragents.browser/server/index.ts +1 -1
  148. package/plugins/ragents.lsp-fsharp/executor.ts +80 -0
  149. package/plugins/ragents.lsp-fsharp/provision.ts +1 -1
  150. package/plugins/ragents.lsp-fsharp/server/index.ts +2 -2
  151. package/plugins/ragents.lsp-roslyn/executor.ts +64 -0
  152. package/plugins/ragents.lsp-roslyn/provision.ts +1 -1
  153. package/plugins/ragents.lsp-roslyn/server/index.ts +28 -5
  154. package/plugins/ragents.lsp-roslyn/server/solution-on-start.ts +18 -6
  155. package/plugins/ragents.lsp-typescript/executor.ts +50 -0
  156. package/plugins/ragents.lsp-typescript/server/index.ts +2 -2
  157. package/plugins/ragents.model-relay/server/config.ts +1 -1
  158. package/plugins/ragents.model-relay/server/relay.ts +4 -2
  159. package/plugins/ragents.profile-distribution/server/archive.ts +2 -1
  160. package/plugins/ragents.workspace/client/workspace-client.ts +111 -28
  161. package/plugins/ragents.workspace/contract.ts +33 -2
  162. package/plugins/ragents.workspace/server/binding.ts +10 -4
  163. package/plugins/ragents.workspace/server/clients.ts +56 -9
  164. package/plugins/ragents.workspace/server/config.ts +9 -0
  165. package/plugins/ragents.workspace/server/index.ts +13 -4
  166. package/plugins/ragents.workspace/server/runtime.ts +10 -0
  167. package/plugins/ragents.workspace/server/shell-platform.ts +6 -5
  168. package/plugins/ragents.workspace/web/WorkspaceBinding.tsx +1 -1
  169. package/ragents.config.core.ts +4 -1
  170. package/ragents.config.showcase.ts +4 -1
  171. package/scripts/agent/journal.ts +3 -1
  172. package/scripts/package/build-package.ts +3 -1
  173. package/scripts/package/publish-package.ts +4 -3
  174. package/scripts/provision/run-provision.ts +2 -2
  175. package/scripts/workspace-client/run-workspace-client.ts +7 -4
  176. package/apps/web/dist/help/screenshots/release-checklist-vscode.png +0 -0
  177. package/apps/web/dist/help/screenshots/release-checklist-web.png +0 -0
  178. package/bundles/ragents.ask/web/chunks/chunk-HGFDGTNC.js +0 -2
  179. package/bundles/ragents.ask/web/chunks/chunk-HGFDGTNC.js.map +0 -7
  180. package/bundles/ragents.browser/server/chunks/chunk-2GKLLCBE.js.map +0 -7
  181. package/packages/workspace-executor/src/language-server/adapters/fsharp.ts +0 -60
  182. package/packages/workspace-executor/src/language-server/adapters/index.ts +0 -7
  183. package/packages/workspace-executor/src/language-server/adapters/roslyn.ts +0 -56
  184. package/packages/workspace-executor/src/language-server/adapters/typescript.ts +0 -74
  185. package/packages/workspace-executor/src/language-server/solution.ts +0 -13
  186. /package/{packages/workspace-executor/src/browser → plugins/ragents.browser/executor}/contract.ts +0 -0
  187. /package/{packages/workspace-executor/src/browser → plugins/ragents.browser/executor}/pages.ts +0 -0
@@ -7,7 +7,10 @@ export const config = {
7
7
  PRODUCT_PROFILE: "showcase",
8
8
  COMPACTION_MODEL: "google/gemma-4-26b-a4b-it",
9
9
  // Aliasse für andere RAgents-Server, die ihre Modelle über ragents.model-relay von hier beziehen.
10
- MODEL_ALIASES: ["showcase-standard=openrouter/z-ai/glm-5.3-flash", "showcase-coordinator=openrouter/deepseek/deepseek-v4-flash-0731"],
10
+ MODEL_ALIASES: [
11
+ { alias: "showcase-standard", model: "openrouter/z-ai/glm-5.3-flash", compaction: { threshold: 160_000, keepRecentTokens: 24_000, summaryTokens: 12_000 } },
12
+ { alias: "showcase-coordinator", model: "openrouter/deepseek/deepseek-v4-flash-0731", compaction: { threshold: 300_000, keepRecentTokens: 40_000, summaryTokens: 16_000 } },
13
+ ],
11
14
  PRODUCT_ID: "ragents-showcase",
12
15
  PRODUCT_TITLE: "RAgents Showcase",
13
16
  PLUGINS: [
@@ -114,7 +114,9 @@ export const journalLines = (events: readonly JournalEvent[], mode: JournalMode,
114
114
  const content = payload.subscriptionId ? `[event ${String((payload.sourceEventIds as string[] | undefined)?.[0] ?? "")}]` : text(payload.content);
115
115
  lines.push(`[${event.sequence}] INPUT -> ${String(payload.actorId ?? "").slice(0, 14)}: ${content.slice(0, 300)}`);
116
116
  } else if (type === "context.compacted" && mode !== "tools") {
117
- lines.push(`[${event.sequence}] CONTEXT COMPACTED ${actor}: about ${String(payload.tokensBefore)} tokens summarized`);
117
+ const threshold = payload.threshold as { tokens?: unknown; source?: unknown } | undefined;
118
+ const applied = threshold ? ` (threshold ${String(threshold.tokens)} from ${String(threshold.source)})` : "";
119
+ lines.push(`[${event.sequence}] CONTEXT COMPACTED ${actor}: about ${String(payload.tokensBefore)} tokens summarized${applied}`);
118
120
  } else if (type === "turn.input-steered" && mode !== "tools") {
119
121
  lines.push(`[${event.sequence}] STEERING -> ${actor}: ${String(payload.inputId ?? "")} in ${String(payload.turnId ?? "")}`);
120
122
  } else if (type.startsWith("tool.call.") && mode !== "chat") {
@@ -84,6 +84,8 @@ const PACKAGE_NAME_PATTERN = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._
84
84
  const SCAN_SKIPPED = new Set(["node_modules", "dist"]);
85
85
  const SCANNED_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".mjs", ".js", ".css"]);
86
86
  const IMPORT_PATTERN = /\b(?:from|import|require(?:\.resolve)?)\s*\(?\s*["']([^"'\n]+)["']/g;
87
+ /** Ein Beitrag zum Executor löst Pakete zur Laufzeit aus dem Host auf; auch sie muss das Paket tragen. */
88
+ const HOST_PACKAGE_PATTERN = /\bhostPackageFile\([^,()]*,\s*["']([^"'\n]+)["']/g;
87
89
 
88
90
  const files = async (folder: string, skippedFolders: ReadonlySet<string> = SKIPPED_FOLDERS): Promise<readonly string[]> => {
89
91
  const found: string[] = [];
@@ -149,7 +151,7 @@ export const requiredPackages = (packageDirectory: string): ReadonlyMap<string,
149
151
  for (const folder of scanRoots(packageDirectory)) {
150
152
  for (const file of scannedFiles(folder)) {
151
153
  const content = readFileSync(file, "utf8");
152
- for (const match of content.matchAll(IMPORT_PATTERN)) {
154
+ for (const match of [...content.matchAll(IMPORT_PATTERN), ...content.matchAll(HOST_PACKAGE_PATTERN)]) {
153
155
  const name = packageNameOf(match[1]!);
154
156
  if (name && !sources.has(name)) sources.set(name, path.relative(packageDirectory, file));
155
157
  }
@@ -1,7 +1,7 @@
1
1
  import { spawnSync } from "node:child_process";
2
2
  import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
- import { compareVersions, nextVersion, readVersion, versionLine, writeHostPackageVersion, writeVersion } from "../publish-version.ts";
4
+ import { compareVersions, readVersion, releaseVersion, versionLine, writeHostPackageVersion, writeVersion } from "../publish-version.ts";
5
5
  import { buildPackage, PACKAGE_FOLDER, PACKAGE_NAME } from "./build-package.ts";
6
6
 
7
7
  const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
@@ -121,11 +121,12 @@ const main = async (): Promise<void> => {
121
121
  if (!token) throw new Error(`npm_key fehlt: der npm-Token mit Schreibrecht auf ${PACKAGE_NAME}.\n${usage}`);
122
122
  const manifestFile = path.join(repositoryRoot, "package.json");
123
123
  const published = publishedVersions(PACKAGE_NAME, runNpm);
124
- const next = nextVersion(readVersion(manifestFile), published);
125
- console.log(versionLine(next));
126
124
  const extensionManifestFile = path.join(repositoryRoot, "apps", "vscode", "package.json");
125
+ const next = releaseVersion([readVersion(manifestFile), readVersion(extensionManifestFile)], published);
126
+ console.log(versionLine(next));
127
127
  if (!dryRun) {
128
128
  writeVersion(manifestFile, next.version);
129
+ writeVersion(extensionManifestFile, next.version);
129
130
  writeHostPackageVersion(extensionManifestFile, next.version);
130
131
  }
131
132
  const built = await buildPackage(path.join(repositoryRoot, "dist", PACKAGE_FOLDER));
@@ -19,8 +19,8 @@ const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url))
19
19
 
20
20
  const usage = (): string => `Verwendung: pnpm provision [<profil>|<pfad zu ragents.config.<profil>.ts>|--workspace]
21
21
  Provisioniert die Werkzeuge der Plugins eines Profils nach <Datenordner>/tools/<plugin-id>/ und
22
- berichtet je Plugin bereit, installiert oder fehlt. --workspace provisioniert stattdessen
23
- Sprachserver und Browser eines Arbeitsplatzes auf dieser Maschine. Ein relativer Pfad gilt ab dem
22
+ berichtet je Plugin bereit, installiert oder fehlt. --workspace provisioniert stattdessen die
23
+ eingebauten Plugins, die zum Executor eines Arbeitsplatzes beitragen. Ein relativer Pfad gilt ab dem
24
24
  aufrufenden Ordner; ohne Argument gilt das Profil aus der Umgebung (PRODUCT_PROFILE_FILE oder
25
25
  PRODUCT_PROFILE).`;
26
26
 
@@ -13,11 +13,13 @@ const usage = (): string => `Verwendung: [RAGENTS_TOKEN=<token>] pnpm workspace-
13
13
  Meldet die Ordner als Arbeitsplatz beim Server an und führt dessen Aufträge mit dem Executor
14
14
  dieses Rechners aus - dasselbe, was die VS-Code-Erweiterung tut, nur ohne VS Code. Ohne Ordner
15
15
  gilt das aktuelle Verzeichnis. Jeder Werkzeugaufruf erscheint als eine Zeile auf stdout.
16
- Sprachserver und Chromium holt der Start auf diesen Rechner (dasselbe wie pnpm provision
17
- --workspace); ROSLYN_LANGUAGE_SERVER, FSHARP_LANGUAGE_SERVER und BROWSER_EXECUTABLE_PATH
18
- übersteuern das, TypeScript und playwright-core kommen aus dem Host-Ordner. Unter Windows nennt
16
+ Was die Plugins des Servers zum Executor beitragen, etwa Sprachserver, lädt der Arbeitsplatz bei
17
+ der Anmeldung aus den Bundles dieses Hosts; ihre Werkzeuge holt der Start auf diesen Rechner
18
+ (dasselbe wie pnpm provision --workspace). Unter Windows nennt
19
19
  RAGENTS_BASH die bash.exe, die RAgents mitbringt (aus der Windows-Fassung der VS-Code-Erweiterung);
20
- ohne sie scheitert das Werkzeug bash. Das Skript läuft, bis es mit Strg-C beendet wird.`;
20
+ ohne sie scheitert das Werkzeug bash. RAGENTS_RG nennt ein rg, dessen Ordner die Bash vorn im PATH
21
+ hat, etwa das aus der Erweiterung; ohne Angabe gilt eines im PATH. Das Skript läuft, bis es mit
22
+ Strg-C beendet wird.`;
21
23
 
22
24
  export interface WorkspaceClientArguments {
23
25
  readonly serverUrl: string;
@@ -79,6 +81,7 @@ const main = async (): Promise<void> => {
79
81
  const client = new WorkspaceClient(transport, identity, {
80
82
  hostRoot,
81
83
  bash: process.env.RAGENTS_BASH || undefined,
84
+ rg: process.env.RAGENTS_RG || undefined,
82
85
  onExecuted: ({ runId, operation, durationMs, error }) =>
83
86
  console.log(`== ${runId.slice(0, 8)} ${operation} ${durationMs} ms ${error ?? "ok"}`),
84
87
  });
@@ -1,2 +0,0 @@
1
- var r="ragents.ask",i=t=>Array.isArray(t)&&t.every(n=>typeof n=="string")?[...t]:void 0,o=t=>{if(typeof t!="object"||t===null)return;let n=t,e=i(n.options);if(!(typeof n.question!="string"||!e))return{question:n.question,options:e,multi:n.multi===!0,...typeof n.recipient=="string"?{recipient:n.recipient}:{}}};export{r as a,o as b};
2
- //# sourceMappingURL=/plugins/ragents.ask/web/chunks/chunk-HGFDGTNC.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../plugins/ragents.ask/ask-payload.ts"],
4
- "sourcesContent": ["export const ASK_PLUGIN_ID = \"ragents.ask\";\n\nexport interface AskPayload {\n question: string;\n options: string[];\n multi: boolean;\n /** Der Actor, f\u00FCr den die Frage steht, wenn der Eigent\u00FCmer des Runs sie au\u00DFerhalb eines Turns stellt. */\n recipient?: string;\n}\n\nconst stringArrayOf = (value: unknown): string[] | undefined =>\n Array.isArray(value) && value.every((entry) => typeof entry === \"string\") ? [...value] : undefined;\n\nexport const askPayloadOf = (payload: unknown): AskPayload | undefined => {\n if (typeof payload !== \"object\" || payload === null) return undefined;\n const candidate = payload as Partial<AskPayload>;\n const options = stringArrayOf(candidate.options);\n if (typeof candidate.question !== \"string\" || !options) return undefined;\n return {\n question: candidate.question,\n options,\n multi: candidate.multi === true,\n ...(typeof candidate.recipient === \"string\" ? { recipient: candidate.recipient } : {}),\n };\n};\n"],
5
- "mappings": "AAAO,IAAMA,EAAgB,cAUvBC,EAAiBC,GACrB,MAAM,QAAQA,CAAK,GAAKA,EAAM,MAAOC,GAAU,OAAOA,GAAU,QAAQ,EAAI,CAAC,GAAGD,CAAK,EAAI,OAE9EE,EAAgBC,GAA6C,CACxE,GAAI,OAAOA,GAAY,UAAYA,IAAY,KAAM,OACrD,IAAMC,EAAYD,EACZE,EAAUN,EAAcK,EAAU,OAAO,EAC/C,GAAI,SAAOA,EAAU,UAAa,UAAY,CAACC,GAC/C,MAAO,CACL,SAAUD,EAAU,SACpB,QAAAC,EACA,MAAOD,EAAU,QAAU,GAC3B,GAAI,OAAOA,EAAU,WAAc,SAAW,CAAE,UAAWA,EAAU,SAAU,EAAI,CAAC,CACtF,CACF",
6
- "names": ["ASK_PLUGIN_ID", "stringArrayOf", "value", "entry", "askPayloadOf", "payload", "candidate", "options"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../plugins/ragents.browser/server/contract.ts"],
4
- "sourcesContent": ["import { serviceToken } from \"@ragents/engine\";\nimport type { BrowserSnapshot } from \"@ragents/workspace-executor\";\n\nexport type { BrowserSnapshot, BrowserTarget } from \"@ragents/workspace-executor\";\n\nexport interface BrowserEvidence {\n checkedAt?: string;\n url?: string;\n screenshots: { name: string; url: string }[];\n currentScreenshots: { name: string; url: string }[];\n errors: string[];\n}\n\n/** Wer eine Operation an der Seite ausl\u00F6st: bei einem Werkzeugaufruf dessen Kennung, dazu der Abbruch. */\nexport interface BrowserCallOptions {\n signal?: AbortSignal;\n toolCallId?: string;\n}\n\nexport interface BrowserRuntime {\n open: (runId: string, url: string, options?: BrowserCallOptions) => Promise<BrowserSnapshot>;\n evidence: (runId: string) => BrowserEvidence;\n}\n\nexport const browserRuntimeToken = serviceToken<BrowserRuntime>(\"ragents.browser.runtime\");\n"],
5
- "mappings": ";;;;AAAA,SAAS,oBAAoB;AAwBtB,IAAM,sBAAsB,aAA6B,yBAAyB;",
6
- "names": []
7
- }
@@ -1,60 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import path from "node:path";
3
- import { pathToFileURL } from "node:url";
4
- import { hostToolFile } from "../../tools.js";
5
- import type { LanguageServerAdapter } from "../host.js";
6
- import { dotnetCommand, resolveRootFile } from "../roots.js";
7
- import { solutionProjects } from "../solution.js";
8
-
9
- export const FSHARP_SERVER_VARIABLE = "FSHARP_LANGUAGE_SERVER";
10
- export const FSHARP_PLUGIN_ID = "ragents.lsp-fsharp";
11
- export const FSHARP_SERVER_FILE = "fsautocomplete/fsautocomplete.dll";
12
-
13
- const languages = { ".fs": "fsharp", ".fsi": "fsharp", ".fsx": "fsharp" } as const;
14
-
15
- const serverPath = (): string => {
16
- const configured = process.env[FSHARP_SERVER_VARIABLE];
17
- if (configured) return configured;
18
- const provisioned = hostToolFile(FSHARP_PLUGIN_ID, FSHARP_SERVER_FILE);
19
- if (existsSync(provisioned)) return provisioned;
20
- throw new Error("fsautocomplete gibt es auf diesem Rechner nicht: weder "
21
- + `${FSHARP_SERVER_VARIABLE} gesetzt noch ${provisioned} vorhanden. Ein Arbeitsplatz holt es mit `
22
- + `pnpm provision --workspace, ein Server über pnpm provision <profil>; ${FSHARP_SERVER_VARIABLE} übersteuert beides`);
23
- };
24
-
25
- const contentOf = (params: unknown): string => (params as { content?: string } | undefined)?.content ?? "";
26
-
27
- export const fsharpAdapter: LanguageServerAdapter = {
28
- id: "fsharp",
29
- label: "FSAC",
30
- languages,
31
- rootDescription: "the .sln file (or a single .fsproj)",
32
- resolveRoot: (workspaceRoot, root) => resolveRootFile(workspaceRoot, root, [".sln", ".fsproj"]),
33
- rootDirectory: (root) => path.dirname(root),
34
- launch: async (context, root) => ({
35
- label: "FSAC",
36
- ...dotnetCommand(serverPath(), ["--state-directory", path.join(context.logDirectory, "fsautocomplete")]),
37
- cwd: path.dirname(root),
38
- env: context.env,
39
- uid: context.uid,
40
- gid: context.gid,
41
- rootUri: pathToFileURL(path.dirname(root)).href,
42
- initializationOptions: { AutomaticWorkspaceInit: false },
43
- languages,
44
- }),
45
- open: async (session, root, timeoutMs) => {
46
- const projects = root.toLowerCase().endsWith(".sln")
47
- ? (await solutionProjects(root)).filter((project) => project.toLowerCase().endsWith(".fsproj"))
48
- : [root];
49
- if (projects.length === 0) throw new Error(`${path.basename(root)} enthält keine F#-Projekte`);
50
- const finished = session.waitForNotification(timeoutMs, "Projekte geladen", (method, params) =>
51
- method === "fsharp/notifyWorkspace"
52
- && contentOf(params).includes("\"workspaceLoad\"")
53
- && contentOf(params).includes("\"finished\""));
54
- await session.request("fsharp/workspaceLoad", {
55
- textDocuments: projects.map((project) => ({ uri: pathToFileURL(project).href })),
56
- });
57
- await finished;
58
- return `${projects.length} F#-Projekt${projects.length === 1 ? "" : "e"} aus ${path.basename(root)} geladen`;
59
- },
60
- };
@@ -1,7 +0,0 @@
1
- import type { LanguageServerAdapter } from "../host.js";
2
- import { fsharpAdapter } from "./fsharp.js";
3
- import { roslynAdapter } from "./roslyn.js";
4
- import { typescriptAdapter } from "./typescript.js";
5
-
6
- /** Jeder Executor bietet dieselbe Menge Sprachserver an; fehlt einer auf der Maschine, scheitert erst der Aufruf. */
7
- export const workspaceLanguageServers: readonly LanguageServerAdapter[] = [roslynAdapter, fsharpAdapter, typescriptAdapter];
@@ -1,56 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import path from "node:path";
3
- import { pathToFileURL } from "node:url";
4
- import { hostToolFile } from "../../tools.js";
5
- import type { LanguageServerAdapter } from "../host.js";
6
- import { dotnetCommand, resolveRootFile } from "../roots.js";
7
-
8
- export const ROSLYN_SERVER_VARIABLE = "ROSLYN_LANGUAGE_SERVER";
9
- export const ROSLYN_PLUGIN_ID = "ragents.lsp-roslyn";
10
- export const ROSLYN_SERVER_FILE = "roslyn/Microsoft.CodeAnalysis.LanguageServer.dll";
11
-
12
- const languages = { ".cs": "csharp" } as const;
13
-
14
- const serverPath = (): string => {
15
- const configured = process.env[ROSLYN_SERVER_VARIABLE];
16
- if (configured) return configured;
17
- const provisioned = hostToolFile(ROSLYN_PLUGIN_ID, ROSLYN_SERVER_FILE);
18
- if (existsSync(provisioned)) return provisioned;
19
- throw new Error("Microsoft.CodeAnalysis.LanguageServer gibt es auf diesem Rechner nicht: weder "
20
- + `${ROSLYN_SERVER_VARIABLE} gesetzt noch ${provisioned} vorhanden. Ein Arbeitsplatz holt ihn mit `
21
- + `pnpm provision --workspace, ein Server über pnpm provision <profil>; ${ROSLYN_SERVER_VARIABLE} übersteuert beides`);
22
- };
23
-
24
- export const roslynAdapter: LanguageServerAdapter = {
25
- id: "roslyn",
26
- label: "Roslyn",
27
- languages,
28
- rootDescription: "the .sln file (or a single .csproj)",
29
- solutionExtensions: [".sln", ".slnx"],
30
- resolveRoot: (workspaceRoot, root) => resolveRootFile(workspaceRoot, root, [".sln", ".slnx", ".csproj"]),
31
- rootDirectory: (root) => path.dirname(root),
32
- launch: async (context, root) => ({
33
- label: "Roslyn",
34
- ...dotnetCommand(serverPath(), [
35
- "--stdio",
36
- "--logLevel", "Warning",
37
- "--extensionLogDirectory", path.join(context.logDirectory, "roslyn-logs"),
38
- ]),
39
- cwd: path.dirname(root),
40
- env: context.env,
41
- uid: context.uid,
42
- gid: context.gid,
43
- rootUri: pathToFileURL(path.dirname(root)).href,
44
- languages,
45
- newFileSettleMs: 2_000,
46
- }),
47
- open: async (session, root, timeoutMs) => {
48
- const uri = pathToFileURL(root).href;
49
- const loaded = session.waitForNotification(timeoutMs, "Projekte geladen",
50
- (method) => method === "workspace/projectInitializationComplete");
51
- if (root.toLowerCase().endsWith(".csproj")) session.notify("project/open", { projects: [uri] });
52
- else session.notify("solution/open", { solution: uri });
53
- await loaded;
54
- return `${path.basename(root)} geladen`;
55
- },
56
- };
@@ -1,74 +0,0 @@
1
- import { stat } from "node:fs/promises";
2
- import { createRequire } from "node:module";
3
- import path from "node:path";
4
- import { pathToFileURL } from "node:url";
5
- import type { LanguageServerAdapter } from "../host.js";
6
- import { resolveRootDirectory } from "../roots.js";
7
-
8
- const languages = {
9
- ".ts": "typescript",
10
- ".tsx": "typescriptreact",
11
- ".mts": "typescript",
12
- ".cts": "typescript",
13
- ".js": "javascript",
14
- ".jsx": "javascriptreact",
15
- } as const;
16
-
17
- /** Der Sprachserver liegt in den node_modules des Hosts; ohne Host gibt es ihn auf dieser Maschine nicht. */
18
- const hostRequire = (hostRoot: string | undefined): NodeRequire => {
19
- if (!hostRoot) {
20
- throw new Error("Für TypeScript ist auf diesem Rechner kein Host bekannt, aus dem sich typescript-language-server "
21
- + "auflösen ließe. Ein Arbeitsplatz bekommt ihn mit der ersten Verbindung zu einem verteilenden Server oder über "
22
- + "die Einstellung ragents.hostPath");
23
- }
24
- return createRequire(path.join(hostRoot, "package.json"));
25
- };
26
-
27
- const missing = (hostRoot: string | undefined, name: string, cause: unknown): Error =>
28
- new Error(`${name} liegt nicht im Host ${hostRoot}: ${cause instanceof Error ? cause.message : String(cause)}`);
29
-
30
- const serverScript = (hostRoot: string | undefined): string => {
31
- const require = hostRequire(hostRoot);
32
- try {
33
- return require.resolve("typescript-language-server/lib/cli.mjs");
34
- } catch (cause) {
35
- throw missing(hostRoot, "typescript-language-server", cause);
36
- }
37
- };
38
-
39
- const bundledTypeScriptLib = (hostRoot: string | undefined): string => {
40
- const require = hostRequire(hostRoot);
41
- try {
42
- return path.dirname(require.resolve("typescript"));
43
- } catch (cause) {
44
- throw missing(hostRoot, "typescript", cause);
45
- }
46
- };
47
-
48
- const hasWorkspaceTypeScript = (root: string): Promise<boolean> =>
49
- stat(path.join(root, "node_modules", "typescript", "lib", "tsserver.js")).then((info) => info.isFile(), () => false);
50
-
51
- export const typescriptAdapter: LanguageServerAdapter = {
52
- id: "typescript",
53
- label: "TypeScript",
54
- languages,
55
- rootDescription: "the directory whose tsconfig.json projects should be served (e.g. src)",
56
- resolveRoot: resolveRootDirectory,
57
- rootDirectory: (root) => root,
58
- launch: async (context, root) => ({
59
- label: "TypeScript",
60
- command: process.execPath,
61
- args: [serverScript(context.hostRoot), "--stdio"],
62
- cwd: root,
63
- // Im Extension-Host ist process.execPath Electron; ohne diese Variable startet es die Anwendung statt des Skripts.
64
- env: { ...context.env, ELECTRON_RUN_AS_NODE: "1" },
65
- uid: context.uid,
66
- gid: context.gid,
67
- rootUri: pathToFileURL(root).href,
68
- initializationOptions: await hasWorkspaceTypeScript(root) ? {} : { tsserver: { path: bundledTypeScriptLib(context.hostRoot) } },
69
- languages,
70
- publishesOnlyChangedDiagnostics: true,
71
- }),
72
- open: async (_session, root) =>
73
- `TypeScript-Server auf ${path.basename(root)} bereit; Projekte werden je Datei aus der nächsten tsconfig.json geladen`,
74
- };
@@ -1,13 +0,0 @@
1
- import { readFile } from "node:fs/promises";
2
- import path from "node:path";
3
-
4
- const PROJECT_LINE = /^Project\("\{[^}]+\}"\)\s*=\s*"[^"]*",\s*"([^"]+)"/gm;
5
-
6
- export const solutionProjects = async (solutionFile: string): Promise<string[]> => {
7
- const text = await readFile(solutionFile, "utf8");
8
- const directory = path.dirname(solutionFile);
9
- return [...text.matchAll(PROJECT_LINE)]
10
- .map((match) => match[1].replaceAll("\\", "/"))
11
- .filter((relative) => /\.[a-z]+proj$/i.test(relative))
12
- .map((relative) => path.resolve(directory, relative));
13
- };