@schlenkr/ragents 0.1.8 → 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.
- package/apps/server/src/config-definition.ts +24 -2
- package/apps/server/src/config.ts +0 -6
- package/apps/server/src/host-api.json +3 -10
- package/apps/server/src/host-api.ts +6 -7
- package/apps/server/src/plugin-build/build.ts +28 -5
- package/apps/server/src/plugin-build/plugin-description.ts +1 -1
- package/apps/server/src/plugin-build/typecheck.ts +2 -2
- package/apps/server/src/plugin-support/language-server/plugin.ts +8 -7
- package/apps/server/src/plugin-support/language-server/tools.ts +7 -6
- package/apps/server/src/plugin-support/model-aliases.ts +55 -25
- package/apps/server/src/plugin-support/product-relay.ts +10 -2
- package/apps/server/src/plugin-support/workspace-sandbox-host.ts +18 -9
- package/apps/server/src/profile/bundle-manifest.ts +7 -3
- package/apps/server/src/profile/compose.ts +6 -0
- package/apps/server/src/profile/plugin-discovery.ts +6 -1
- package/apps/server/src/profile/provisioning.ts +6 -5
- package/apps/server/src/ragents/engine.ts +0 -1
- package/apps/server/src/ragents/host-services.ts +4 -0
- package/apps/server/src/ragents/session.ts +1 -1
- package/apps/server/src/server.ts +1 -0
- package/apps/server/tsconfig.json +2 -0
- package/apps/web/dist/help/guide-clients.html +14 -6
- package/apps/web/dist/help/guide-clients.md +14 -6
- package/apps/web/dist/help/guide-distributed.html +12 -4
- package/apps/web/dist/help/guide-distributed.md +12 -4
- package/apps/web/dist/help/guide-getting-started.html +12 -8
- package/apps/web/dist/help/guide-getting-started.md +12 -8
- package/apps/web/dist/help/guide-plugins.html +6 -2
- package/apps/web/dist/help/guide-plugins.md +6 -2
- package/apps/web/dist/help/guide-runtime.html +2 -1
- package/apps/web/dist/help/guide-runtime.md +2 -1
- package/apps/web/dist/help/index.html +3328 -1135
- package/apps/web/dist/host-web.json +3 -3
- package/bundles/ragents.activity/ragents-bundle.json +3 -3
- package/bundles/ragents.actor-programs/ragents-bundle.json +3 -3
- package/bundles/ragents.ask/ragents-bundle.json +4 -4
- package/bundles/ragents.ask/server/index.js +42 -11
- package/bundles/ragents.ask/server/index.js.map +3 -3
- package/bundles/ragents.ask/web/chunks/chunk-WFN4374U.js +2 -0
- package/bundles/ragents.ask/web/chunks/chunk-WFN4374U.js.map +7 -0
- package/bundles/ragents.ask/web/classes.json +1 -1
- package/bundles/ragents.ask/web/exports/ask-payload.js +1 -1
- package/bundles/ragents.ask/web/index.js +1 -1
- package/bundles/ragents.ask/web/index.js.map +3 -3
- package/bundles/ragents.browser/executor/index.mjs +357 -0
- package/bundles/ragents.browser/executor/index.mjs.map +7 -0
- package/bundles/ragents.browser/ragents-bundle.json +5 -8
- package/bundles/ragents.browser/server/chunks/{chunk-2GKLLCBE.js → chunk-CWLX4VA5.js} +1 -1
- package/bundles/ragents.browser/server/chunks/chunk-CWLX4VA5.js.map +7 -0
- package/bundles/ragents.browser/server/exports/server/contract.js +1 -1
- package/bundles/ragents.browser/server/index.js +20 -9
- package/bundles/ragents.browser/server/index.js.map +4 -4
- package/bundles/ragents.documents/ragents-bundle.json +3 -3
- package/bundles/ragents.lsp-fsharp/executor/index.mjs +68 -0
- package/bundles/ragents.lsp-fsharp/executor/index.mjs.map +7 -0
- package/bundles/ragents.lsp-fsharp/ragents-bundle.json +5 -9
- package/bundles/ragents.lsp-fsharp/server/index.js +21 -6
- package/bundles/ragents.lsp-fsharp/server/index.js.map +4 -4
- package/bundles/ragents.lsp-roslyn/executor/index.mjs +68 -0
- package/bundles/ragents.lsp-roslyn/executor/index.mjs.map +7 -0
- package/bundles/ragents.lsp-roslyn/ragents-bundle.json +6 -8
- package/bundles/ragents.lsp-roslyn/server/index.js +54 -15
- package/bundles/ragents.lsp-roslyn/server/index.js.map +4 -4
- package/bundles/ragents.lsp-typescript/executor/index.mjs +49 -0
- package/bundles/ragents.lsp-typescript/executor/index.mjs.map +7 -0
- package/bundles/ragents.lsp-typescript/ragents-bundle.json +5 -7
- package/bundles/ragents.lsp-typescript/server/index.js +22 -2
- package/bundles/ragents.lsp-typescript/server/index.js.map +3 -3
- package/bundles/ragents.model-relay/ragents-bundle.json +4 -4
- package/bundles/ragents.model-relay/server/index.js +3 -2
- package/bundles/ragents.model-relay/server/index.js.map +2 -2
- package/bundles/ragents.orchestration/ragents-bundle.json +3 -3
- package/bundles/ragents.overseer/ragents-bundle.json +3 -3
- package/bundles/ragents.processes/ragents-bundle.json +3 -3
- package/bundles/ragents.product/ragents-bundle.json +3 -3
- package/bundles/ragents.profile-distribution/ragents-bundle.json +4 -4
- package/bundles/ragents.profile-distribution/server/index.js +1 -1
- package/bundles/ragents.profile-distribution/server/index.js.map +2 -2
- package/bundles/ragents.reference/ragents-bundle.json +3 -3
- package/bundles/ragents.todo/ragents-bundle.json +3 -3
- package/bundles/ragents.transcript/ragents-bundle.json +3 -3
- package/bundles/ragents.watch/ragents-bundle.json +3 -3
- package/bundles/ragents.workspace/ragents-bundle.json +11 -5
- package/bundles/ragents.workspace/server/index.js +101 -28
- package/bundles/ragents.workspace/server/index.js.map +3 -3
- package/bundles/ragents.workspace/web/classes.json +1 -1
- package/bundles/ragents.workspace/web/index.js +1 -1
- package/bundles/ragents.workspace/web/index.js.map +3 -3
- package/package.json +2 -2
- package/packages/agent/dist/core/agent-settings.d.ts +1 -7
- package/packages/agent/dist/core/compaction/compaction.d.ts +17 -13
- package/packages/agent/dist/core/model-runtime.d.ts +5 -4
- package/packages/agent/dist/core/provider-composer.d.ts +2 -1
- package/packages/agent/dist/core/tools/bash.d.ts +9 -3
- package/packages/agent/dist/index.d.ts +1 -1
- package/packages/agent/src/core/agent-settings.ts +1 -4
- package/packages/agent/src/core/compaction/compaction.ts +68 -30
- package/packages/agent/src/core/model-runtime.ts +12 -5
- package/packages/agent/src/core/provider-composer.ts +5 -0
- package/packages/agent/src/core/tools/bash.ts +36 -30
- package/packages/agent/src/index.ts +3 -0
- package/packages/ai/dist/types.d.ts +11 -0
- package/packages/ai/src/types.ts +12 -0
- package/packages/ragents/src/domain/event-semantics.ts +3 -0
- package/packages/ragents/src/domain/event-validation.ts +15 -2
- package/packages/ragents/src/domain/events.ts +3 -0
- package/packages/ragents/src/domain/model.ts +2 -0
- package/packages/ragents/src/domain/projection.ts +1 -0
- package/packages/ragents/src/drivers/agent-runtime.ts +1 -1
- package/packages/ragents/src/drivers/agent-turn.ts +8 -6
- package/packages/ragents/src/runtime/decisions/inputs.ts +6 -2
- package/packages/ragents/src/runtime/journal-storage.ts +5 -4
- package/packages/workspace-executor/package.json +0 -1
- package/packages/workspace-executor/src/bash-launch.ts +56 -10
- package/packages/workspace-executor/src/context.ts +4 -0
- package/packages/workspace-executor/src/contributions.ts +150 -0
- package/packages/workspace-executor/src/executor.ts +1 -1
- package/packages/workspace-executor/src/index.ts +16 -19
- package/packages/workspace-executor/src/language-server/host.ts +3 -0
- package/packages/workspace-executor/src/language-server/module.ts +12 -2
- package/packages/workspace-executor/src/language-server/roots.ts +0 -5
- package/packages/workspace-executor/src/modules.ts +7 -6
- package/packages/workspace-executor/src/sandbox-tools.ts +3 -9
- package/packages/workspace-executor/src/shell-platform.ts +14 -3
- package/packages/workspace-executor/src/tools.ts +0 -3
- package/plugins/ragents.ask/ask-payload.ts +9 -0
- package/plugins/ragents.ask/server/ask-service.ts +53 -13
- package/plugins/ragents.ask/web/AskActionView.tsx +3 -2
- package/plugins/ragents.browser/executor/index.ts +5 -0
- package/{packages/workspace-executor/src/browser → plugins/ragents.browser/executor}/module.ts +25 -31
- package/{packages/workspace-executor/src/browser → plugins/ragents.browser/executor}/playwright.ts +9 -23
- package/plugins/ragents.browser/provision.ts +1 -1
- package/plugins/ragents.browser/server/browser.ts +3 -3
- package/plugins/ragents.browser/server/contract.ts +2 -2
- package/plugins/ragents.browser/server/index.ts +1 -1
- package/plugins/ragents.lsp-fsharp/executor.ts +80 -0
- package/plugins/ragents.lsp-fsharp/provision.ts +1 -1
- package/plugins/ragents.lsp-fsharp/server/index.ts +2 -2
- package/plugins/ragents.lsp-roslyn/executor.ts +64 -0
- package/plugins/ragents.lsp-roslyn/provision.ts +1 -1
- package/plugins/ragents.lsp-roslyn/server/index.ts +28 -5
- package/plugins/ragents.lsp-roslyn/server/solution-on-start.ts +18 -6
- package/plugins/ragents.lsp-typescript/executor.ts +50 -0
- package/plugins/ragents.lsp-typescript/server/index.ts +2 -2
- package/plugins/ragents.model-relay/server/config.ts +1 -1
- package/plugins/ragents.model-relay/server/relay.ts +4 -2
- package/plugins/ragents.profile-distribution/server/archive.ts +2 -1
- package/plugins/ragents.workspace/client/workspace-client.ts +111 -28
- package/plugins/ragents.workspace/contract.ts +33 -2
- package/plugins/ragents.workspace/server/binding.ts +10 -4
- package/plugins/ragents.workspace/server/clients.ts +56 -9
- package/plugins/ragents.workspace/server/config.ts +9 -0
- package/plugins/ragents.workspace/server/index.ts +13 -4
- package/plugins/ragents.workspace/server/runtime.ts +10 -0
- package/plugins/ragents.workspace/server/shell-platform.ts +6 -5
- package/plugins/ragents.workspace/web/WorkspaceBinding.tsx +1 -1
- package/ragents.config.core.ts +4 -1
- package/ragents.config.showcase.ts +4 -1
- package/scripts/agent/journal.ts +3 -1
- package/scripts/package/build-package.ts +3 -1
- package/scripts/provision/run-provision.ts +2 -2
- package/scripts/workspace-client/run-workspace-client.ts +7 -4
- package/apps/web/dist/help/screenshots/release-checklist-vscode.png +0 -0
- package/apps/web/dist/help/screenshots/release-checklist-web.png +0 -0
- package/bundles/ragents.ask/web/chunks/chunk-HGFDGTNC.js +0 -2
- package/bundles/ragents.ask/web/chunks/chunk-HGFDGTNC.js.map +0 -7
- package/bundles/ragents.browser/server/chunks/chunk-2GKLLCBE.js.map +0 -7
- package/packages/workspace-executor/src/language-server/adapters/fsharp.ts +0 -60
- package/packages/workspace-executor/src/language-server/adapters/index.ts +0 -7
- package/packages/workspace-executor/src/language-server/adapters/roslyn.ts +0 -56
- package/packages/workspace-executor/src/language-server/adapters/typescript.ts +0 -74
- package/packages/workspace-executor/src/language-server/solution.ts +0 -13
- /package/{packages/workspace-executor/src/browser → plugins/ragents.browser/executor}/contract.ts +0 -0
- /package/{packages/workspace-executor/src/browser → plugins/ragents.browser/executor}/pages.ts +0 -0
|
@@ -2,6 +2,7 @@ import { statSync } from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Type } from "typebox";
|
|
4
4
|
import { DomainError, type JsonValue, type RunState, type StartOptionContribution } from "@ragents/engine";
|
|
5
|
+
import type { ShellTools } from "@ragents/workspace-executor";
|
|
5
6
|
import { shellPlatformChapter } from "./shell-platform.js";
|
|
6
7
|
import { storedStartOption } from "@ragents/host/ragents/start-option-state.js";
|
|
7
8
|
import type { WorkspaceResolver } from "@ragents/host/ragents/workspace-runtime.js";
|
|
@@ -87,13 +88,18 @@ export const serverDirectoryFolder = (directory: string): ExistingWorkspaceFolde
|
|
|
87
88
|
return { path: resolved };
|
|
88
89
|
};
|
|
89
90
|
|
|
90
|
-
/** Die Bash eines Runs läuft auf dem Executor seiner Bindung; der Prompt nennt deshalb dessen Plattform, nicht die des Servers. */
|
|
91
|
-
export const executorShellChapter = (
|
|
91
|
+
/** Die Bash eines Runs läuft auf dem Executor seiner Bindung; der Prompt nennt deshalb dessen Plattform und Werkzeuge, nicht die des Servers. */
|
|
92
|
+
export const executorShellChapter = (
|
|
93
|
+
registry: WorkspaceClientRegistry,
|
|
94
|
+
owner: string | null,
|
|
95
|
+
binding: WorkspaceBinding,
|
|
96
|
+
serverTools: ShellTools,
|
|
97
|
+
): string => {
|
|
92
98
|
const { machine } = binding;
|
|
93
|
-
if (machine === "server") return shellPlatformChapter(process.platform);
|
|
99
|
+
if (machine === "server") return shellPlatformChapter(process.platform, serverTools);
|
|
94
100
|
const client = registry.info(owner, machine.client);
|
|
95
101
|
return client
|
|
96
|
-
? shellPlatformChapter(client.platform as NodeJS.Platform)
|
|
102
|
+
? shellPlatformChapter(client.platform as NodeJS.Platform, { ripgrep: client.ripgrep })
|
|
97
103
|
: `## Shell platform\n\nThe workstation ${machine.label} that holds this project is not registered right now, `
|
|
98
104
|
+ "so the platform of its shell is unknown; the workspace tools fail until it connects again.";
|
|
99
105
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { Value } from "typebox/value";
|
|
1
2
|
import {
|
|
2
3
|
DomainError,
|
|
3
4
|
RPC_ERROR_CODES,
|
|
4
5
|
RpcError,
|
|
5
6
|
implement,
|
|
7
|
+
schemaComplaints,
|
|
6
8
|
type AccessContext,
|
|
7
9
|
type MethodConnection,
|
|
8
10
|
type MethodContribution,
|
|
@@ -10,11 +12,13 @@ import {
|
|
|
10
12
|
import {
|
|
11
13
|
WORKSPACE_EXECUTOR_VERSION,
|
|
12
14
|
sandboxRunEnvironment,
|
|
15
|
+
type ExecutorContributionStand,
|
|
13
16
|
type WorkspaceExecuteOptions,
|
|
14
17
|
type WorkspaceExecutor,
|
|
15
18
|
} from "@ragents/workspace-executor";
|
|
16
19
|
import {
|
|
17
20
|
WORKSPACE_CLIENT_STOP_OPERATION,
|
|
21
|
+
clientRegistrationSchema,
|
|
18
22
|
workspaceClientContracts,
|
|
19
23
|
workspaceContracts,
|
|
20
24
|
type WorkspaceClientDescription,
|
|
@@ -75,6 +79,35 @@ const messageOf = (cause: unknown): string => cause instanceof Error ? cause.mes
|
|
|
75
79
|
/** Ein Arbeitsplatz ist erst durch Besitzer und Kennung bestimmt; zwei Benutzer mit derselben Kennung teilen nichts. */
|
|
76
80
|
const keyOf = (owner: string | null, id: string): string => JSON.stringify([owner, id]);
|
|
77
81
|
|
|
82
|
+
/** Server und Arbeitsplatz brauchen denselben Executor; die Meldung sagt, wer von beiden zu alt ist. */
|
|
83
|
+
const assertExecutor = (label: string, executor: string): void => {
|
|
84
|
+
if (executor === WORKSPACE_EXECUTOR_VERSION) return;
|
|
85
|
+
const action = Number(executor) > Number(WORKSPACE_EXECUTOR_VERSION)
|
|
86
|
+
? "Den Server auf die Fassung des Arbeitsplatzes aktualisieren."
|
|
87
|
+
: "Die RAgents-Erweiterung in VS Code beziehungsweise das Paket @schlenkr/ragents auf dem Arbeitsplatz aktualisieren.";
|
|
88
|
+
throw new DomainError(
|
|
89
|
+
"workspace-executor-version",
|
|
90
|
+
`Der Arbeitsplatz ${label} bringt den Executor ${executor} mit, der Server verlangt ${WORKSPACE_EXECUTOR_VERSION}. ${action}`,
|
|
91
|
+
409,
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const described = (contributions: readonly ExecutorContributionStand[]): string =>
|
|
96
|
+
contributions.map(({ plugin, stand }) => `${plugin} (${stand.slice(0, 12)})`).join(", ") || "keine";
|
|
97
|
+
|
|
98
|
+
/** Ein Arbeitsplatz führt aus, was die Plugins des Servers beitragen; mit anderen Beiträgen liefen dieselben Werkzeuge dort anders als auf dem Server. */
|
|
99
|
+
const assertContributions = (label: string, expected: readonly ExecutorContributionStand[], given: readonly ExecutorContributionStand[]): void => {
|
|
100
|
+
const key = (entry: ExecutorContributionStand): string => `${entry.plugin}\0${entry.stand}`;
|
|
101
|
+
const same = expected.length === given.length && expected.every((entry) => given.some((other) => key(other) === key(entry)));
|
|
102
|
+
if (same) return;
|
|
103
|
+
throw new DomainError(
|
|
104
|
+
"workspace-executor-contributions",
|
|
105
|
+
`Der Arbeitsplatz ${label} bringt die Executor-Beiträge ${described(given)} mit, der Server verlangt ${described(expected)}. `
|
|
106
|
+
+ "Der Arbeitsplatz fragt sie mit ragents.workspace.clients.contributions ab und meldet sich danach erneut an.",
|
|
107
|
+
409,
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
78
111
|
/** Über das Netz nimmt der Server Arbeitsplätze nur von angemeldeten Benutzern an; ohne Benutzer gäbe es nur einen Besitzer für alle Zugänge. */
|
|
79
112
|
export const assertMayRegister = (access: AccessContext, local: boolean): void => {
|
|
80
113
|
if (local || (access.enabled && access.user !== null)) return;
|
|
@@ -88,27 +121,29 @@ export const assertMayRegister = (access: AccessContext, local: boolean): void =
|
|
|
88
121
|
|
|
89
122
|
/** Kennt die angemeldeten Arbeitsplätze je Besitzer, hält je Client die Verbindung, über die der Server ihn zurückruft, und die Stopps, die ihn nicht erreicht haben. */
|
|
90
123
|
export class WorkspaceClientRegistry {
|
|
124
|
+
/** Was die Plugins des Servers zum Executor beitragen; jeder Arbeitsplatz muss genau diese Beiträge tragen. */
|
|
125
|
+
readonly contributions: readonly ExecutorContributionStand[];
|
|
91
126
|
readonly #clients = new Map<string, ClientEntry>();
|
|
92
127
|
/** Stopps, die den Arbeitsplatz noch nicht erreicht haben, je Arbeitsplatz und Run mit dem Ordner der Bindung. */
|
|
93
128
|
readonly #pendingStops = new Map<string, Map<string, string>>();
|
|
94
129
|
readonly #stopRetries = new Map<string, NodeJS.Timeout>();
|
|
95
130
|
|
|
131
|
+
constructor(contributions: readonly ExecutorContributionStand[]) {
|
|
132
|
+
this.contributions = contributions.map(({ plugin, stand }) => ({ plugin, stand }));
|
|
133
|
+
}
|
|
134
|
+
|
|
96
135
|
async register(
|
|
97
136
|
id: string,
|
|
98
137
|
description: WorkspaceClientDescription,
|
|
99
138
|
executor: string,
|
|
139
|
+
contributions: readonly ExecutorContributionStand[],
|
|
100
140
|
connection: MethodConnection,
|
|
101
141
|
): Promise<WorkspaceClientInfo> {
|
|
102
142
|
if (connection.streamless) {
|
|
103
143
|
throw new DomainError("stream-required", "Die Anmeldung eines Arbeitsplatzes braucht einen Ereignisstrom.", 409);
|
|
104
144
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"workspace-executor-version",
|
|
108
|
-
`Der Arbeitsplatz ${description.label} bringt den Executor ${executor} mit, der Server verlangt ${WORKSPACE_EXECUTOR_VERSION}.`,
|
|
109
|
-
409,
|
|
110
|
-
);
|
|
111
|
-
}
|
|
145
|
+
assertExecutor(description.label, executor);
|
|
146
|
+
assertContributions(description.label, this.contributions, contributions);
|
|
112
147
|
const owner = connection.userId;
|
|
113
148
|
const key = keyOf(owner, id);
|
|
114
149
|
const previous = this.#clients.get(key);
|
|
@@ -318,9 +353,21 @@ export class WorkspaceClientRegistry {
|
|
|
318
353
|
|
|
319
354
|
export const clientMethods = (registry: WorkspaceClientRegistry): MethodContribution[] => [
|
|
320
355
|
implement(workspaceContracts.clients.list, (_input, { access }) => registry.list(ownerOf(access))),
|
|
321
|
-
implement(workspaceContracts.clients.
|
|
356
|
+
implement(workspaceContracts.clients.contributions, ({ label, executor }, { access, local }) => {
|
|
322
357
|
assertMayRegister(access, local);
|
|
323
|
-
|
|
358
|
+
assertExecutor(label, executor);
|
|
359
|
+
return registry.contributions.map((entry) => ({ ...entry }));
|
|
360
|
+
}),
|
|
361
|
+
implement(workspaceContracts.clients.register, (input, { access, connection, local }) => {
|
|
362
|
+
assertMayRegister(access, local);
|
|
363
|
+
// Erst der Stand: ein Arbeitsplatz mit einem anderen kennt die Form dieses Stands nicht, mit diesem gilt sie ganz.
|
|
364
|
+
assertExecutor(input.label, input.executor);
|
|
365
|
+
if (!Value.Check(clientRegistrationSchema, input)) {
|
|
366
|
+
throw new RpcError(RPC_ERROR_CODES.invalidParams,
|
|
367
|
+
`Ungültige Eingabe für ${workspaceContracts.clients.register.id}: ${schemaComplaints(clientRegistrationSchema, input, "params")}`);
|
|
368
|
+
}
|
|
369
|
+
const { id, executor, contributions, ...description } = input;
|
|
370
|
+
return registry.register(id, description, executor, contributions, connection);
|
|
324
371
|
}),
|
|
325
372
|
implement(workspaceContracts.clients.unregister, ({ id }, { access, connection }) => {
|
|
326
373
|
registry.unregister(ownerOf(access), id, connection);
|
|
@@ -5,6 +5,8 @@ export const workspaceConfigDescriptors = [
|
|
|
5
5
|
{ key: "PROCESS_SANDBOX", source: "environment" },
|
|
6
6
|
{ key: "PROCESS_SANDBOX_NETWORK", source: "environment" },
|
|
7
7
|
{ key: "RAGENTS_BASH", source: "environment" },
|
|
8
|
+
{ key: "RAGENTS_RG", source: "environment" },
|
|
9
|
+
{ key: "RAGENTS_BASH_TIMEOUT_SECONDS", source: "environment" },
|
|
8
10
|
] as const;
|
|
9
11
|
|
|
10
12
|
const env = declaredEnvironment(workspaceConfigDescriptors);
|
|
@@ -28,3 +30,10 @@ export const processSandboxSetting = (): ProcessSandboxSetting => {
|
|
|
28
30
|
|
|
29
31
|
/** Die Bash, mit der der Executor dieses Servers das Werkzeug bash startet; unter Windows setzt sie die VS-Code-Erweiterung für ihren lokalen Host. */
|
|
30
32
|
export const bashSetting = (): string | undefined => env.optional("RAGENTS_BASH") || undefined;
|
|
33
|
+
|
|
34
|
+
/** Das rg, das der Executor dieses Servers vorn in den PATH der Bash setzt; die VS-Code-Erweiterung setzt es für ihren lokalen Host. */
|
|
35
|
+
export const rgSetting = (): string | undefined => env.optional("RAGENTS_RG") || undefined;
|
|
36
|
+
|
|
37
|
+
/** Die Zeitgrenze von bash in Sekunden für Aufrufe ohne eigene; mehr als die größte, die ein Aufruf nennen darf, lehnt das Werkzeug beim Start ab. */
|
|
38
|
+
export const bashTimeoutSetting = (): number | undefined =>
|
|
39
|
+
env.optional("RAGENTS_BASH_TIMEOUT_SECONDS") ? env.positiveNumber("RAGENTS_BASH_TIMEOUT_SECONDS", "") : undefined;
|
|
@@ -4,6 +4,7 @@ import { documentStoreToken } from "@ragents/host/ragents/document-store.js";
|
|
|
4
4
|
import { workspaceResolverToken, workspaceRuntimeToken, type WorkspaceResolver } from "@ragents/host/ragents/workspace-runtime.js";
|
|
5
5
|
import { sandboxServicesToken } from "@ragents/host/plugin-support/workspace-sandbox-host.js";
|
|
6
6
|
import {
|
|
7
|
+
executorContributionsToken,
|
|
7
8
|
hostAddressToken,
|
|
8
9
|
runtimeProviderToken,
|
|
9
10
|
runGuardToken,
|
|
@@ -12,6 +13,7 @@ import {
|
|
|
12
13
|
} from "@ragents/host/ragents/host-services.js";
|
|
13
14
|
import { pluginAsset } from "@ragents/host/plugin-support/plugin-folder.js";
|
|
14
15
|
import { ServerProcessSandbox } from "@ragents/host/plugin-support/process-sandbox.js";
|
|
16
|
+
import { ripgrepAvailable } from "@ragents/workspace-executor";
|
|
15
17
|
import type { PluginModule } from "@ragents/host/plugin-support/plugin-module.js";
|
|
16
18
|
import { boundToTools, handlebarsPrompt } from "@ragents/host/plugin-support/prompt.js";
|
|
17
19
|
import { shellPlatformPrompt } from "./shell-platform.js";
|
|
@@ -21,7 +23,7 @@ import { WORKSPACE_BINDING_OPTION_ID, WORKSPACE_METADATA_ID } from "../contract.
|
|
|
21
23
|
import { bindingOf, executorShellChapter, sessionMetadataOf, workspaceBindingOption, workspaceLocation, workspaceOwnerOf } from "./binding.js";
|
|
22
24
|
import { createBrowseChannel, createBrowseMethods } from "./browse-route.js";
|
|
23
25
|
import { clientMethods, WorkspaceClientRegistry } from "./clients.js";
|
|
24
|
-
import { bashSetting, processSandboxSetting, workspaceConfigDescriptors } from "./config.js";
|
|
26
|
+
import { bashSetting, bashTimeoutSetting, processSandboxSetting, rgSetting, workspaceConfigDescriptors } from "./config.js";
|
|
25
27
|
import { RunWorkspaceRuntime } from "./runtime.js";
|
|
26
28
|
|
|
27
29
|
const warnWithoutSandbox = (): void => {
|
|
@@ -48,7 +50,8 @@ const ragentsWorkspacePlugin = (skillPaths: () => Promise<readonly string[]>): R
|
|
|
48
50
|
if (!directory) throw new Error("In diesem Profil gibt es keine Dateiablage; das Plugin ragents.documents fehlt");
|
|
49
51
|
return directory;
|
|
50
52
|
};
|
|
51
|
-
const
|
|
53
|
+
const contributions = host.service(executorContributionsToken);
|
|
54
|
+
const clients = new WorkspaceClientRegistry(contributions);
|
|
52
55
|
const contribution = (): WorkspaceResolver | undefined => host.optionalService(workspaceResolverToken);
|
|
53
56
|
host.config(...workspaceConfigDescriptors);
|
|
54
57
|
const sandboxSetting = processSandboxSetting();
|
|
@@ -60,10 +63,16 @@ const ragentsWorkspacePlugin = (skillPaths: () => Promise<readonly string[]>): R
|
|
|
60
63
|
})
|
|
61
64
|
: undefined;
|
|
62
65
|
const bash = bashSetting();
|
|
66
|
+
const rg = rgSetting();
|
|
67
|
+
const bashTimeoutSeconds = bashTimeoutSetting();
|
|
68
|
+
const serverTools = { ripgrep: ripgrepAvailable(rg, process.env) };
|
|
63
69
|
const runtime = new RunWorkspaceRuntime({
|
|
64
70
|
clients,
|
|
71
|
+
contributions: contributions.map((contribution) => contribution.parts),
|
|
65
72
|
...(processSandbox ? { processSandbox } : {}),
|
|
66
73
|
...(bash === undefined ? {} : { bash }),
|
|
74
|
+
...(rg === undefined ? {} : { rg }),
|
|
75
|
+
...(bashTimeoutSeconds === undefined ? {} : { bashTimeoutSeconds }),
|
|
67
76
|
globalDirectory: host.storage.root(),
|
|
68
77
|
sessionDirectory: (runId, ...segments) => host.storage.session(runId, ...segments),
|
|
69
78
|
storageRootFor: (runId) => path.join(host.storage.sessionsRoot, runId),
|
|
@@ -92,9 +101,9 @@ const ragentsWorkspacePlugin = (skillPaths: () => Promise<readonly string[]>): R
|
|
|
92
101
|
// Die Regeln gelten für die Arbeitsbereiche des Hosts; eine beigesteuerte Art beschreibt ihre eigenen.
|
|
93
102
|
render: (context) => contribution()?.kind ? "" : rules.render(context),
|
|
94
103
|
}, ...agentWorkspaceToolNames),
|
|
95
|
-
shellPlatformPrompt("ragents.workspace.shell.prompt", 102, (runId) => {
|
|
104
|
+
shellPlatformPrompt("ragents.workspace.shell.prompt", 102, serverTools, (runId) => {
|
|
96
105
|
const state = runState(runId);
|
|
97
|
-
return executorShellChapter(clients, workspaceOwnerOf(state), bindingOf(state));
|
|
106
|
+
return executorShellChapter(clients, workspaceOwnerOf(state), bindingOf(state), serverTools);
|
|
98
107
|
}),
|
|
99
108
|
);
|
|
100
109
|
const browseOptions = {
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
type SandboxHomeEnvironment,
|
|
9
9
|
type WorkspaceExecuteOptions,
|
|
10
10
|
type WorkspaceExecutor,
|
|
11
|
+
type WorkspaceExecutorParts,
|
|
11
12
|
} from "@ragents/workspace-executor";
|
|
12
13
|
import type {
|
|
13
14
|
SessionWorkspace,
|
|
@@ -46,10 +47,16 @@ export interface RunWorkspaceRuntimeOptions {
|
|
|
46
47
|
runState: (runId: string) => RunState | null;
|
|
47
48
|
storeBinding: (runId: string, binding: WorkspaceBinding) => void;
|
|
48
49
|
clients: WorkspaceClientRegistry;
|
|
50
|
+
/** Was die Plugins des Profils zum Executor des Servers beitragen; die Arbeitsplätze laden dieselben Beiträge selbst. */
|
|
51
|
+
contributions: readonly WorkspaceExecutorParts[];
|
|
49
52
|
/** Die Prozess-Sandbox des Servers; ohne sie laufen die Prozesse des Servers ohne. */
|
|
50
53
|
processSandbox?: RunProcessSandboxes;
|
|
51
54
|
/** Die Bash des Servers aus RAGENTS_BASH; unter Windows Pflicht für das Werkzeug bash. */
|
|
52
55
|
bash?: string;
|
|
56
|
+
/** Das rg des Servers aus RAGENTS_RG; ohne Angabe gilt eines im PATH. */
|
|
57
|
+
rg?: string;
|
|
58
|
+
/** Die Zeitgrenze von bash aus RAGENTS_BASH_TIMEOUT_SECONDS; ohne Angabe die des Werkzeugs. */
|
|
59
|
+
bashTimeoutSeconds?: number;
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
const runNotStarted = (): DomainError => new DomainError(
|
|
@@ -141,6 +148,7 @@ export class RunWorkspaceRuntime implements WorkspaceRuntime {
|
|
|
141
148
|
this.#nugetCacheDirectory = path.join(options.globalDirectory, "nuget-cache");
|
|
142
149
|
this.sandbox = new WorkspaceSandboxHost({
|
|
143
150
|
contributorName: "ragents.workspace.sandbox",
|
|
151
|
+
contributions: options.contributions,
|
|
144
152
|
workspaceFor: options.sessionWorkspaceFor,
|
|
145
153
|
identFor: () => Promise.resolve(undefined),
|
|
146
154
|
skillPaths: options.skillPaths,
|
|
@@ -150,6 +158,8 @@ export class RunWorkspaceRuntime implements WorkspaceRuntime {
|
|
|
150
158
|
serverDirectoryFor: (runId) => this.#serverDirectoryFor(runId),
|
|
151
159
|
...(options.processSandbox ? { processSandbox: options.processSandbox } : {}),
|
|
152
160
|
...(options.bash === undefined ? {} : { bash: options.bash }),
|
|
161
|
+
...(options.rg === undefined ? {} : { rg: options.rg }),
|
|
162
|
+
...(options.bashTimeoutSeconds === undefined ? {} : { bashTimeoutSeconds: options.bashTimeoutSeconds }),
|
|
153
163
|
});
|
|
154
164
|
}
|
|
155
165
|
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { PromptContribution } from "@ragents/engine";
|
|
2
|
-
import { shellPlatformText } from "@ragents/workspace-executor";
|
|
2
|
+
import { shellPlatformText, type ShellTools } from "@ragents/workspace-executor";
|
|
3
3
|
import { boundToTools } from "@ragents/host/plugin-support/prompt.js";
|
|
4
4
|
|
|
5
|
-
export const shellPlatformChapter = (platform: NodeJS.Platform): string =>
|
|
6
|
-
`## Shell platform\n\n${shellPlatformText(platform)}`;
|
|
5
|
+
export const shellPlatformChapter = (platform: NodeJS.Platform, tools: ShellTools): string =>
|
|
6
|
+
`## Shell platform\n\n${shellPlatformText(platform, tools)}`;
|
|
7
7
|
|
|
8
|
-
/** Ohne Angabe
|
|
8
|
+
/** Ohne Angabe gelten Plattform und Werkzeuge des Servers; `chapterFor` nennt die des Executors, der den Run ausführt. */
|
|
9
9
|
export const shellPlatformPrompt = (
|
|
10
10
|
id: string,
|
|
11
11
|
order: number,
|
|
12
|
+
serverTools: ShellTools,
|
|
12
13
|
chapterFor?: (runId: string) => string,
|
|
13
14
|
): PromptContribution => boundToTools({
|
|
14
15
|
id,
|
|
15
16
|
order,
|
|
16
17
|
delivery: "initial",
|
|
17
|
-
render: () => shellPlatformChapter(process.platform),
|
|
18
|
+
render: () => shellPlatformChapter(process.platform, serverTools),
|
|
18
19
|
...(chapterFor ? { renderForRun: chapterFor } : {}),
|
|
19
20
|
}, "bash");
|
|
@@ -42,7 +42,7 @@ const isClientInfo = (value: unknown): value is WorkspaceClientInfo => {
|
|
|
42
42
|
&& typeof raw.id === "string" && typeof raw.label === "string"
|
|
43
43
|
&& typeof raw.hostname === "string" && typeof raw.platform === "string"
|
|
44
44
|
&& Array.isArray(raw.folders) && raw.folders.every((folder) => typeof folder === "string")
|
|
45
|
-
&& typeof raw.runsDirectory === "string";
|
|
45
|
+
&& typeof raw.runsDirectory === "string" && typeof raw.ripgrep === "boolean";
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const isFreshLabels = (value: unknown): value is FreshWorkspaceLabels => {
|
package/ragents.config.core.ts
CHANGED
|
@@ -6,7 +6,10 @@ export const config = {
|
|
|
6
6
|
PRODUCT_PROFILE: "core",
|
|
7
7
|
COMPACTION_MODEL: "google/gemma-4-26b-a4b-it",
|
|
8
8
|
// Aliasse für andere RAgents-Server, die ihre Modelle über ragents.model-relay von hier beziehen.
|
|
9
|
-
MODEL_ALIASES: [
|
|
9
|
+
MODEL_ALIASES: [
|
|
10
|
+
{ alias: "core-standard", model: "openrouter/z-ai/glm-5.3-flash", compaction: { threshold: 160_000, keepRecentTokens: 24_000, summaryTokens: 12_000 } },
|
|
11
|
+
{ alias: "core-coordinator", model: "openrouter/deepseek/deepseek-v4-flash-0731", compaction: { threshold: 300_000, keepRecentTokens: 40_000, summaryTokens: 16_000 } },
|
|
12
|
+
],
|
|
10
13
|
PRODUCT_ID: "ragents",
|
|
11
14
|
PRODUCT_TITLE: "RAgents",
|
|
12
15
|
PLUGINS: [
|
|
@@ -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: [
|
|
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: [
|
package/scripts/agent/journal.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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.
|
|
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
|
});
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
-
};
|