@schlenkr/ragents 0.1.6 → 0.1.7
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/chat-handler.ts +2 -0
- package/apps/server/src/config.ts +6 -0
- package/apps/server/src/host-api.json +1 -0
- package/apps/server/src/layout.ts +0 -15
- package/apps/server/src/plugin-support/agent-tool.ts +2 -3
- package/apps/server/src/provider.ts +34 -11
- package/apps/server/src/ragents/actor-chat-history.ts +1 -0
- package/apps/server/src/ragents/engine.ts +5 -13
- package/apps/server/src/ragents/journal-chat-events.ts +2 -0
- package/apps/server/src/ragents/run-owner.ts +3 -2
- package/apps/server/src/ragents/session.ts +3 -3
- package/apps/server/src/run-preparation.ts +14 -18
- package/apps/server/src/run-transfer.ts +65 -4
- package/apps/server/src/settings.ts +2 -4
- package/apps/web/dist/assets/{highlighted-body-KPVGNVTW-B9qYBARS.js → highlighted-body-KPVGNVTW-CFhTJEmH.js} +1 -1
- package/apps/web/dist/assets/{main-BCjvD2Hh.js → main-DlzW4t4c.js} +1 -1
- package/apps/web/dist/assets/{mermaid-HWGCJPDP-CvYYFK_n.js → mermaid-HWGCJPDP-kxkB991i.js} +69 -69
- package/apps/web/dist/assets/{runPanel-CG7kRMJh.js → runPanel-BJEFQ__w.js} +1 -1
- package/apps/web/dist/help/guide-clients.html +13 -4
- package/apps/web/dist/help/guide-clients.md +14 -4
- package/apps/web/dist/help/guide-distributed.html +8 -3
- package/apps/web/dist/help/guide-distributed.md +8 -3
- package/apps/web/dist/help/guide-runtime.html +18 -12
- package/apps/web/dist/help/guide-runtime.md +19 -12
- package/apps/web/dist/help/mini-app.css +23 -3
- package/apps/web/dist/host-web.json +3 -3
- package/apps/web/dist/index.html +2 -2
- package/apps/web/dist/run-panel.html +2 -2
- package/apps/web/src/SessionList.tsx +16 -8
- package/apps/web/src/api.ts +2 -0
- package/apps/web/src/panel/PanelPage.tsx +1 -1
- package/apps/web/src/panel/RunLine.tsx +4 -2
- package/apps/web/src/panel/contract.ts +2 -0
- package/bundles/ragents.activity/ragents-bundle.json +1 -1
- package/bundles/ragents.actor-programs/ragents-bundle.json +1 -1
- package/bundles/ragents.ask/ragents-bundle.json +1 -1
- package/bundles/ragents.browser/ragents-bundle.json +1 -1
- package/bundles/ragents.documents/ragents-bundle.json +1 -1
- package/bundles/ragents.lsp-fsharp/ragents-bundle.json +1 -1
- package/bundles/ragents.lsp-roslyn/ragents-bundle.json +1 -1
- package/bundles/ragents.lsp-typescript/ragents-bundle.json +1 -1
- package/bundles/ragents.model-relay/ragents-bundle.json +1 -1
- package/bundles/ragents.orchestration/ragents-bundle.json +1 -1
- package/bundles/ragents.overseer/ragents-bundle.json +1 -1
- package/bundles/ragents.processes/ragents-bundle.json +1 -1
- package/bundles/ragents.product/ragents-bundle.json +1 -1
- package/bundles/ragents.profile-distribution/ragents-bundle.json +1 -1
- package/bundles/ragents.reference/ragents-bundle.json +2 -2
- package/bundles/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +1 -1
- package/bundles/ragents.reference/run-scripts/word-game/tests/program.test.ts +3 -3
- package/bundles/ragents.todo/ragents-bundle.json +1 -1
- package/bundles/ragents.transcript/ragents-bundle.json +1 -1
- package/bundles/ragents.watch/ragents-bundle.json +1 -1
- package/bundles/ragents.workspace/ragents-bundle.json +1 -1
- package/package.json +2 -2
- package/packages/agent/dist/core/agent-settings.d.ts +2 -2
- package/packages/agent/dist/core/compaction/compaction.d.ts +16 -50
- package/packages/agent/dist/core/context-log.d.ts +25 -0
- package/packages/agent/dist/core/messages.d.ts +3 -10
- package/packages/agent/dist/core/tool-definition.d.ts +17 -0
- package/packages/agent/dist/core/tools/bash.d.ts +2 -7
- package/packages/agent/dist/core/tools/edit.d.ts +1 -1
- package/packages/agent/dist/core/tools/read.d.ts +1 -1
- package/packages/agent/dist/core/tools/write.d.ts +1 -1
- package/packages/agent/dist/index.d.ts +7 -8
- package/packages/agent/dist/loop/agent.d.ts +2 -6
- package/packages/agent/package.json +1 -1
- package/packages/agent/src/core/agent-settings.ts +2 -2
- package/packages/agent/src/core/compaction/compaction.ts +49 -175
- package/packages/agent/src/core/context-log.ts +49 -0
- package/packages/agent/src/core/messages.ts +5 -11
- package/packages/agent/src/core/tool-definition.ts +29 -0
- package/packages/agent/src/core/tools/bash.ts +2 -9
- package/packages/agent/src/core/tools/edit.ts +2 -11
- package/packages/agent/src/core/tools/read.ts +3 -18
- package/packages/agent/src/core/tools/write.ts +1 -5
- package/packages/agent/src/index.ts +28 -14
- package/packages/agent/src/loop/agent-loop.ts +1 -2
- package/packages/agent/src/loop/agent.ts +8 -2
- package/packages/ai/dist/api/ai-sdk.d.ts +2 -0
- package/packages/ai/dist/types.d.ts +2 -0
- package/packages/ai/src/api/ai-sdk-messages.ts +15 -10
- package/packages/ai/src/api/ai-sdk.ts +11 -0
- package/packages/ai/src/api/transform-messages.ts +1 -1
- package/packages/ai/src/types.ts +2 -0
- package/packages/ai/src/utils/retry.ts +14 -0
- package/packages/ragents/src/agents/actor-input.ts +15 -0
- package/packages/ragents/src/agents/model-context.ts +360 -0
- package/packages/ragents/src/agents/scheduler.ts +3 -7
- package/packages/ragents/src/agents/tools.ts +2 -2
- package/packages/ragents/src/agents/toolset.ts +47 -20
- package/packages/ragents/src/agents/workspaces.ts +0 -6
- package/packages/ragents/src/domain/event-semantics.ts +51 -0
- package/packages/ragents/src/domain/event-validation.ts +166 -0
- package/packages/ragents/src/domain/events.ts +72 -0
- package/packages/ragents/src/domain/model.ts +4 -2
- package/packages/ragents/src/domain/projection.ts +9 -0
- package/packages/ragents/src/domain/tool-result-text.ts +9 -0
- package/packages/ragents/src/drivers/agent-hooks.ts +25 -38
- package/packages/ragents/src/drivers/agent-runtime.ts +118 -933
- package/packages/ragents/src/drivers/agent-turn.ts +735 -0
- package/packages/ragents/src/drivers/agent.ts +9 -7
- package/packages/ragents/src/drivers/skill-preload.ts +53 -63
- package/packages/ragents/src/drivers/types.ts +21 -5
- package/packages/ragents/src/index.ts +7 -6
- package/packages/ragents/src/plugin-host.ts +3 -4
- package/packages/ragents/src/runtime/decisions/actors.ts +10 -0
- package/packages/ragents/src/runtime/decisions/turns.ts +66 -7
- package/packages/ragents/src/runtime/journal-storage.ts +7 -4
- package/packages/ragents/src/runtime/journal.ts +35 -0
- package/packages/ragents/src/runtime/orchestration.ts +140 -9
- package/packages/workspace-executor/src/sandbox-tools.ts +10 -11
- package/plugins/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +1 -1
- package/plugins/ragents.reference/run-scripts/word-game/tests/program.test.ts +3 -3
- package/scripts/agent/journal.ts +5 -3
- package/packages/agent/dist/core/agent-session-runtime.d.ts +0 -33
- package/packages/agent/dist/core/agent-session-services.d.ts +0 -35
- package/packages/agent/dist/core/agent-session.d.ts +0 -234
- package/packages/agent/dist/core/auth-guidance.d.ts +0 -4
- package/packages/agent/dist/core/defaults.d.ts +0 -3
- package/packages/agent/dist/core/extensions/index.d.ts +0 -11
- package/packages/agent/dist/core/extensions/loader.d.ts +0 -12
- package/packages/agent/dist/core/extensions/runner.d.ts +0 -39
- package/packages/agent/dist/core/extensions/types.d.ts +0 -156
- package/packages/agent/dist/core/extensions/wrapper.d.ts +0 -12
- package/packages/agent/dist/core/resource-loader.d.ts +0 -39
- package/packages/agent/dist/core/sdk.d.ts +0 -38
- package/packages/agent/dist/core/session-manager.d.ts +0 -189
- package/packages/agent/dist/core/source-info.d.ts +0 -16
- package/packages/agent/dist/core/system-prompt.d.ts +0 -21
- package/packages/agent/src/core/agent-session-runtime.ts +0 -94
- package/packages/agent/src/core/agent-session-services.ts +0 -74
- package/packages/agent/src/core/agent-session.ts +0 -1108
- package/packages/agent/src/core/auth-guidance.ts +0 -14
- package/packages/agent/src/core/defaults.ts +0 -3
- package/packages/agent/src/core/extensions/index.ts +0 -38
- package/packages/agent/src/core/extensions/loader.ts +0 -125
- package/packages/agent/src/core/extensions/runner.ts +0 -211
- package/packages/agent/src/core/extensions/types.ts +0 -197
- package/packages/agent/src/core/extensions/wrapper.ts +0 -24
- package/packages/agent/src/core/resource-loader.ts +0 -142
- package/packages/agent/src/core/sdk.ts +0 -123
- package/packages/agent/src/core/session-manager.ts +0 -743
- package/packages/agent/src/core/source-info.ts +0 -28
- package/packages/agent/src/core/system-prompt.ts +0 -108
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type SourceScope = "user" | "project" | "temporary";
|
|
2
|
-
export type SourceOrigin = "package" | "top-level";
|
|
3
|
-
|
|
4
|
-
export interface SourceInfo {
|
|
5
|
-
path: string;
|
|
6
|
-
source: string;
|
|
7
|
-
scope: SourceScope;
|
|
8
|
-
origin: SourceOrigin;
|
|
9
|
-
baseDir?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function createSyntheticSourceInfo(
|
|
13
|
-
path: string,
|
|
14
|
-
options: {
|
|
15
|
-
source: string;
|
|
16
|
-
scope?: SourceScope;
|
|
17
|
-
origin?: SourceOrigin;
|
|
18
|
-
baseDir?: string;
|
|
19
|
-
},
|
|
20
|
-
): SourceInfo {
|
|
21
|
-
return {
|
|
22
|
-
path,
|
|
23
|
-
source: options.source,
|
|
24
|
-
scope: options.scope ?? "temporary",
|
|
25
|
-
origin: options.origin ?? "top-level",
|
|
26
|
-
baseDir: options.baseDir,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* System prompt construction and project context loading
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { formatSkillsForPrompt, type Skill } from "./skills.ts";
|
|
6
|
-
|
|
7
|
-
export interface BuildSystemPromptOptions {
|
|
8
|
-
/** Custom system prompt (replaces default). */
|
|
9
|
-
customPrompt?: string;
|
|
10
|
-
/** Tools to include in prompt. Default: [read, bash, edit, write] */
|
|
11
|
-
selectedTools?: string[];
|
|
12
|
-
/** Optional one-line tool snippets keyed by tool name. */
|
|
13
|
-
toolSnippets?: Record<string, string>;
|
|
14
|
-
/** Additional guideline bullets appended to the default system prompt guidelines. */
|
|
15
|
-
promptGuidelines?: string[];
|
|
16
|
-
/** Working directory; only the default prompt names it, a custom prompt stays as the caller wrote it. */
|
|
17
|
-
cwd: string;
|
|
18
|
-
/** Pre-loaded skills. */
|
|
19
|
-
skills?: readonly Skill[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** Build the system prompt with tools, guidelines, and context */
|
|
23
|
-
export function buildSystemPrompt(options: BuildSystemPromptOptions): string {
|
|
24
|
-
const {
|
|
25
|
-
customPrompt,
|
|
26
|
-
selectedTools,
|
|
27
|
-
toolSnippets,
|
|
28
|
-
promptGuidelines,
|
|
29
|
-
cwd,
|
|
30
|
-
skills: providedSkills,
|
|
31
|
-
} = options;
|
|
32
|
-
const promptCwd = cwd.replace(/\\/g, "/");
|
|
33
|
-
|
|
34
|
-
const skills = providedSkills ?? [];
|
|
35
|
-
|
|
36
|
-
if (customPrompt) {
|
|
37
|
-
let prompt = customPrompt;
|
|
38
|
-
|
|
39
|
-
// Append skills section (only if read tool is available)
|
|
40
|
-
const customPromptHasRead = !selectedTools || selectedTools.includes("read");
|
|
41
|
-
if (customPromptHasRead && skills.length > 0) {
|
|
42
|
-
prompt += formatSkillsForPrompt(skills);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return prompt;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Get absolute paths to documentation and examples
|
|
49
|
-
|
|
50
|
-
// Build tools list based on selected tools.
|
|
51
|
-
// A tool appears in Available tools only when the caller provides a one-line snippet.
|
|
52
|
-
const tools = selectedTools || ["read", "bash", "edit", "write"];
|
|
53
|
-
const visibleTools = tools.filter((name) => !!toolSnippets?.[name]);
|
|
54
|
-
const toolsList =
|
|
55
|
-
visibleTools.length > 0 ? visibleTools.map((name) => `- ${name}: ${toolSnippets![name]}`).join("\n") : "(none)";
|
|
56
|
-
|
|
57
|
-
// Build guidelines based on which tools are actually available
|
|
58
|
-
const guidelinesList: string[] = [];
|
|
59
|
-
const guidelinesSet = new Set<string>();
|
|
60
|
-
const addGuideline = (guideline: string): void => {
|
|
61
|
-
if (guidelinesSet.has(guideline)) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
guidelinesSet.add(guideline);
|
|
65
|
-
guidelinesList.push(guideline);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const hasBash = tools.includes("bash");
|
|
69
|
-
const hasRead = tools.includes("read");
|
|
70
|
-
|
|
71
|
-
// File exploration guidelines
|
|
72
|
-
if (hasBash) {
|
|
73
|
-
addGuideline("Use bash for file operations like ls, rg, find");
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
for (const guideline of promptGuidelines ?? []) {
|
|
77
|
-
const normalized = guideline.trim();
|
|
78
|
-
if (normalized.length > 0) {
|
|
79
|
-
addGuideline(normalized);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Always include these
|
|
84
|
-
addGuideline("Be concise in your responses");
|
|
85
|
-
addGuideline("Show file paths clearly when working with files");
|
|
86
|
-
|
|
87
|
-
const guidelines = guidelinesList.map((g) => `- ${g}`).join("\n");
|
|
88
|
-
|
|
89
|
-
let prompt = `You are an expert coding assistant operating inside a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.
|
|
90
|
-
|
|
91
|
-
Available tools:
|
|
92
|
-
${toolsList}
|
|
93
|
-
|
|
94
|
-
In addition to the tools above, you may have access to other custom tools depending on the project.
|
|
95
|
-
|
|
96
|
-
Guidelines:
|
|
97
|
-
${guidelines}
|
|
98
|
-
`;
|
|
99
|
-
|
|
100
|
-
// Append skills section (only if read tool is available)
|
|
101
|
-
if (hasRead && skills.length > 0) {
|
|
102
|
-
prompt += formatSkillsForPrompt(skills);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
prompt += `\nCurrent working directory: ${promptCwd}`;
|
|
106
|
-
|
|
107
|
-
return prompt;
|
|
108
|
-
}
|