@opengeni/runtime 4.3.0 → 4.4.0-canary.36919050519001
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/dist/agent-instructions/base-behavior.d.ts +8 -0
- package/dist/agent-instructions/compose.d.ts +59 -0
- package/dist/agent-instructions/identity.d.ts +21 -0
- package/dist/agent-instructions/index.d.ts +6 -0
- package/dist/agent-instructions/modules/admin.d.ts +3 -0
- package/dist/agent-instructions/modules/artifacts.d.ts +7 -0
- package/dist/agent-instructions/modules/attachments.d.ts +3 -0
- package/dist/agent-instructions/modules/environment.d.ts +11 -0
- package/dist/agent-instructions/modules/goals.d.ts +3 -0
- package/dist/agent-instructions/modules/knowledge.d.ts +6 -0
- package/dist/agent-instructions/modules/machines.d.ts +3 -0
- package/dist/agent-instructions/modules/renderer-markdown.d.ts +6 -0
- package/dist/agent-instructions/modules/repositories.d.ts +7 -0
- package/dist/agent-instructions/modules/sandbox.d.ts +3 -0
- package/dist/agent-instructions/modules/skills.d.ts +3 -0
- package/dist/agent-instructions/modules/subagents.d.ts +3 -0
- package/dist/agent-instructions/runtime-mechanics.d.ts +7 -0
- package/dist/agent-instructions/types.d.ts +55 -0
- package/dist/assets/codemode-client.json +1 -1
- package/dist/{chunk-22M75RJF.js → chunk-NJQKRY6Z.js} +1633 -709
- package/dist/chunk-NJQKRY6Z.js.map +1 -0
- package/dist/{chunk-JUFVYQCY.js → chunk-QKROIZOB.js} +453 -165
- package/dist/chunk-QKROIZOB.js.map +1 -0
- package/dist/claude-subscription-usage.d.ts +3 -1
- package/dist/index.d.ts +35 -28
- package/dist/index.js +28 -2
- package/dist/input-wait-yield.d.ts +4 -0
- package/dist/lazy-tool-transport.d.ts +6 -2
- package/dist/mcp-run-credentials.d.ts +3 -2
- package/dist/mcp-transport-logger.d.ts +10 -0
- package/dist/model-context-inspector.d.ts +17 -1
- package/dist/model-preparation-diagnostics.d.ts +9 -0
- package/dist/model-provider-routing.d.ts +4 -0
- package/dist/model-provider.d.ts +1 -0
- package/dist/model-request-capture.d.ts +9 -0
- package/dist/replayable-json-body.d.ts +2 -1
- package/dist/responses-terminal-error.d.ts +17 -0
- package/dist/sandbox/index.d.ts +3 -3
- package/dist/sandbox/index.js +5 -1
- package/dist/sandbox/provider-command-session.d.ts +6 -0
- package/dist/sandbox/providers/modal-command-control.d.ts +7 -0
- package/dist/sandbox/providers/modal-command-router-wire.d.ts +8 -0
- package/dist/sandbox/providers/modal-command-session.d.ts +2 -1
- package/dist/sandbox/providers/modal-command-start-errors.d.ts +9 -0
- package/dist/sandbox/providers/modal.d.ts +3 -0
- package/dist/sandbox/routing/routing-session.d.ts +5 -4
- package/dist/workspace-tool-gateway.js +2 -2
- package/package.json +12 -12
- package/src/agent-instructions/PROMPT_CHANGELOG.md +149 -0
- package/src/agent-instructions/base-behavior.ts +120 -0
- package/src/agent-instructions/compose.ts +153 -0
- package/src/agent-instructions/identity.ts +42 -0
- package/src/agent-instructions/index.ts +24 -0
- package/src/agent-instructions/modules/admin.ts +25 -0
- package/src/agent-instructions/modules/artifacts.ts +39 -0
- package/src/agent-instructions/modules/attachments.ts +12 -0
- package/src/agent-instructions/modules/environment.ts +60 -0
- package/src/agent-instructions/modules/goals.ts +15 -0
- package/src/agent-instructions/modules/knowledge.ts +21 -0
- package/src/agent-instructions/modules/machines.ts +17 -0
- package/src/agent-instructions/modules/renderer-markdown.ts +17 -0
- package/src/agent-instructions/modules/repositories.ts +28 -0
- package/src/agent-instructions/modules/sandbox.ts +63 -0
- package/src/agent-instructions/modules/skills.ts +19 -0
- package/src/agent-instructions/modules/subagents.ts +42 -0
- package/src/agent-instructions/runtime-mechanics.ts +55 -0
- package/src/agent-instructions/types.ts +83 -0
- package/src/bundled_default_skills/opengeni-client/SKILL.md +110 -37
- package/src/bundled_default_skills/opengeni-client/references/agent-recipes.md +18 -8
- package/src/bundled_default_skills/opengeni-client/references/api-workflows.md +24 -4
- package/src/bundled_default_skills/opengeni-client/references/chat-facade-fallback.md +13 -4
- package/src/bundled_default_skills/opengeni-client/references/compatibility-and-troubleshooting.md +1 -1
- package/src/bundled_default_skills/opengeni-client/references/configure-the-agent.md +223 -0
- package/src/bundled_default_skills/opengeni-client/references/customer-skill-template.md +2 -1
- package/src/bundled_default_skills/opengeni-client/references/data-tools-and-credentials.md +8 -4
- package/src/bundled_default_skills/opengeni-client/references/discovery-and-autonomy.md +2 -2
- package/src/bundled_default_skills/opengeni-client/references/isolation-and-authorization.md +5 -3
- package/src/bundled_default_skills/opengeni-client/references/product-integration-shapes.md +6 -5
- package/src/bundled_default_skills/opengeni-client/references/product-shapes-and-ui.md +36 -3
- package/src/bundled_default_skills/opengeni-client/references/proxy-from-any-backend.md +170 -0
- package/src/bundled_default_skills/opengeni-client/references/session-history-import.md +147 -0
- package/src/bundled_default_skills/opengeni-client/references/usage-allowances.md +189 -0
- package/src/bundled_default_skills/opengeni-help/SKILL.md +1 -1
- package/src/claude-subscription-usage.ts +23 -4
- package/src/index.ts +255 -146
- package/src/input-wait-yield.ts +7 -0
- package/src/interaction-tools.ts +12 -2
- package/src/lazy-tool-transport.ts +46 -16
- package/src/mcp-run-credentials.ts +18 -3
- package/src/mcp-transport-logger.ts +46 -0
- package/src/model-context-inspector.ts +37 -3
- package/src/model-preparation-diagnostics.ts +48 -1
- package/src/model-provider-client.ts +5 -1
- package/src/model-provider-routing.ts +95 -1
- package/src/model-provider.ts +1 -0
- package/src/model-request-capture.ts +28 -1
- package/src/provider-history-adapter.ts +24 -3
- package/src/replayable-json-body.ts +19 -2
- package/src/responses-terminal-error.ts +136 -0
- package/src/sandbox/codemode-client.ts +18 -16
- package/src/sandbox/index.ts +45 -9
- package/src/sandbox/provider-command-session.ts +12 -0
- package/src/sandbox/providers/modal-command-control.ts +115 -12
- package/src/sandbox/providers/modal-command-router-wire.ts +40 -4
- package/src/sandbox/providers/modal-command-session.ts +36 -1
- package/src/sandbox/providers/modal-command-start-errors.ts +27 -0
- package/src/sandbox/providers/modal-legacy-command-control.ts +60 -30
- package/src/sandbox/providers/modal.ts +43 -2
- package/src/sandbox/routing/routing-session.ts +61 -6
- package/src/sandbox/turn-tool-cancellation.ts +8 -1
- package/dist/chunk-22M75RJF.js.map +0 -1
- package/dist/chunk-JUFVYQCY.js.map +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AgentPromptContext } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The one rule the legacy contract lacked: embedder text wins over OpenGeni's
|
|
4
|
+
* behavior defaults, never over the runtime or safety rules.
|
|
5
|
+
*/
|
|
6
|
+
export declare const INSTRUCTION_PRECEDENCE = "Product, workspace, and session instructions take precedence over the default behavior described here, such as tone, length, and format. They never override the runtime mechanics or the rules on authorization and destructive actions.";
|
|
7
|
+
/** Always on: how to communicate, how much to do, when to ask, truthfulness, and safety. */
|
|
8
|
+
export declare function renderBaseBehavior(context: AgentPromptContext): string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ModelContextInstructionLayerId, ModelContextInstructionModule, ResolvedAgentCapabilities, AgentRenderer } from "@opengeni/contracts";
|
|
2
|
+
import type { AgentPromptContext, AgentPromptModule, AgentPromptResources } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Conditional modules in composition order. Session-stable modules first;
|
|
5
|
+
* `attachments` (per turn) last so a file attachment changes as little of the
|
|
6
|
+
* cached prefix as possible.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AGENT_PROMPT_MODULES: readonly AgentPromptModule[];
|
|
9
|
+
export type ModularInstructionLayer = {
|
|
10
|
+
id: ModelContextInstructionLayerId;
|
|
11
|
+
title: string;
|
|
12
|
+
content: string;
|
|
13
|
+
modules?: readonly ModelContextInstructionModule[];
|
|
14
|
+
/** Separator placed before this layer when layers are joined. */
|
|
15
|
+
joinBefore: string;
|
|
16
|
+
};
|
|
17
|
+
export type ComposeModularAgentInstructionsInput = {
|
|
18
|
+
capabilities: ResolvedAgentCapabilities;
|
|
19
|
+
renderer: AgentRenderer;
|
|
20
|
+
/** The resolved identity (see `resolveAgentIdentity`). */
|
|
21
|
+
identity: string;
|
|
22
|
+
resources: AgentPromptResources;
|
|
23
|
+
/** Per-attempt runtime directives, each already gated by its caller. */
|
|
24
|
+
codemode?: string | undefined;
|
|
25
|
+
codeSearch?: string | undefined;
|
|
26
|
+
gitBindings?: string | undefined;
|
|
27
|
+
/** Rendered Skill index, only when it is not delivered in conversation history. */
|
|
28
|
+
skillCatalog?: string | undefined;
|
|
29
|
+
workspaceGovernance?: string | undefined;
|
|
30
|
+
workspaceMemory?: string | undefined;
|
|
31
|
+
sessionInstructions?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
export declare const MODULAR_LAYER_SEPARATOR = "\n\n";
|
|
34
|
+
/**
|
|
35
|
+
* Heads the session instructions so the precedence rule has a concrete target
|
|
36
|
+
* right where the instructions are, at the end of the prompt.
|
|
37
|
+
*/
|
|
38
|
+
export declare const SESSION_INSTRUCTIONS_PREAMBLE = "# Session instructions\n\nThese instructions were set for this session. Follow them over the default behavior above, such as tone, length, and format.\n\n";
|
|
39
|
+
/**
|
|
40
|
+
* The operational contract for a session with an agent configuration: base
|
|
41
|
+
* behavior and runtime mechanics (always), then every module whose capability
|
|
42
|
+
* or resource is present. Pure and deterministic: the same configuration and
|
|
43
|
+
* resources always produce the same bytes.
|
|
44
|
+
*/
|
|
45
|
+
export declare function composeOperationalContract(context: AgentPromptContext): {
|
|
46
|
+
content: string;
|
|
47
|
+
modules: ModelContextInstructionModule[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Layer order: identity → operational contract (base, mechanics, modules) →
|
|
51
|
+
* attempt directives → Skill index → workspace governance → historical memory →
|
|
52
|
+
* session instructions. Everything up to the directives is the stable,
|
|
53
|
+
* cache-friendly prefix; governance and session text follow it, and session
|
|
54
|
+
* instructions come last so they refine everything above.
|
|
55
|
+
*/
|
|
56
|
+
export declare function composeModularAgentInstructions(input: ComposeModularAgentInstructionsInput): {
|
|
57
|
+
layers: ModularInstructionLayer[];
|
|
58
|
+
composed: string;
|
|
59
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenGeni's default identity: who the agent is and its voice. It is the only
|
|
3
|
+
* part of the system text an embedder replaces (`agent.identity`, the
|
|
4
|
+
* workspace default identity, or a legacy white-label persona). Behavior lives
|
|
5
|
+
* in base behavior so a replaced identity keeps it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_AGENT_IDENTITY: string;
|
|
8
|
+
/** A legacy persona template read as identity: the CORE marker is ignored. */
|
|
9
|
+
export declare function identityFromLegacyTemplate(template: string | null | undefined): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Identity tiers, each replacing the next: session identity (frozen in the
|
|
12
|
+
* agent configuration) → workspace identity (explicit default, else the legacy
|
|
13
|
+
* `agentInstructions` persona) → a deployment persona template that differs
|
|
14
|
+
* from OpenGeni's default → OpenGeni's default identity. Workspace governance
|
|
15
|
+
* never drops a tier.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveAgentIdentity(input: {
|
|
18
|
+
sessionIdentity?: string | null | undefined;
|
|
19
|
+
workspaceIdentity?: string | null | undefined;
|
|
20
|
+
deploymentTemplate?: string | null | undefined;
|
|
21
|
+
}): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AGENT_PROMPT_MODULES, MODULAR_LAYER_SEPARATOR, SESSION_INSTRUCTIONS_PREAMBLE, composeModularAgentInstructions, composeOperationalContract, type ComposeModularAgentInstructionsInput, type ModularInstructionLayer, } from "./compose.js";
|
|
2
|
+
export { INSTRUCTION_PRECEDENCE, renderBaseBehavior } from "./base-behavior.js";
|
|
3
|
+
export { renderRuntimeMechanics } from "./runtime-mechanics.js";
|
|
4
|
+
export { DEFAULT_AGENT_IDENTITY, identityFromLegacyTemplate, resolveAgentIdentity, } from "./identity.js";
|
|
5
|
+
export { rigInstructions, workspaceEnvironmentInstructions } from "./modules/environment.js";
|
|
6
|
+
export type { AgentPromptContext, AgentPromptModule, AgentPromptResources, RigInstructionsContext, WorkspaceEnvironmentContext, } from "./types.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AgentPromptModule } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Documents, published files, Sites, and inline visuals. With the markdown
|
|
4
|
+
* renderer only the delivery rules remain: `artifact:` links, inline HTML, and
|
|
5
|
+
* image embedding need OpenGeni's timeline.
|
|
6
|
+
*/
|
|
7
|
+
export declare const artifactsModule: AgentPromptModule;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RigInstructionsContext, WorkspaceEnvironmentContext } from "../types.js";
|
|
2
|
+
import { type AgentPromptModule } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Rig doctrine lines. Shared with the legacy CORE, whose bytes they keep.
|
|
5
|
+
*/
|
|
6
|
+
export declare function rigInstructions(rig: RigInstructionsContext): string[];
|
|
7
|
+
/** Workspace environment lines (metadata only). Shared with the legacy CORE. */
|
|
8
|
+
export declare function workspaceEnvironmentInstructions(environment: WorkspaceEnvironmentContext): string[];
|
|
9
|
+
export declare const workspaceEnvironmentModule: AgentPromptModule;
|
|
10
|
+
/** The rig lines naming rig tools appear only when workspace admin tools are available. */
|
|
11
|
+
export declare const rigModule: AgentPromptModule;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type AgentPromptModule } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Durable storage choice, workspace-instruction editing, and Knowledge
|
|
4
|
+
* retrieval/retention doctrine (the legacy CORE text, split into paragraphs).
|
|
5
|
+
*/
|
|
6
|
+
export declare const knowledgeModule: AgentPromptModule;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type AgentPromptModule } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The client renders plain Markdown (Slack, the chat facade, a product's own
|
|
4
|
+
* UI). Replaces the `sandbox:`/`artifact:` link and inline-visual rules.
|
|
5
|
+
*/
|
|
6
|
+
export declare const rendererMarkdownModule: AgentPromptModule;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AgentPromptModule } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Repository resources, Git provider credentials, or a Connected Machine (which
|
|
4
|
+
* owns its own checkouts): mount paths, provider CLIs, branch/pull-request
|
|
5
|
+
* policy, and Git safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const repositoriesModule: AgentPromptModule;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AgentPromptContext } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Always on: how the durable runtime behaves for every agent — messages that
|
|
4
|
+
* arrive mid-turn, `wait_for_input`, compaction, and background commands.
|
|
5
|
+
* Embedder instructions do not override these.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderRuntimeMechanics(context: AgentPromptContext): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { AgentPromptModuleId, AgentRenderer, ResolvedAgentCapabilities } from "@opengeni/contracts";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata about the workspace environment attached to a run. Surfaced
|
|
4
|
+
* verbatim in the agent instructions: the description is where operators
|
|
5
|
+
* document how the exported credentials are meant to be used. Only metadata
|
|
6
|
+
* belongs here — never variable values.
|
|
7
|
+
*/
|
|
8
|
+
export type WorkspaceEnvironmentContext = {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string | null;
|
|
11
|
+
variableNames?: string[];
|
|
12
|
+
};
|
|
13
|
+
/** The rig (versioned sandbox environment) a session rides. */
|
|
14
|
+
export type RigInstructionsContext = {
|
|
15
|
+
name: string;
|
|
16
|
+
version: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* What the session is attached to, as far as its instructions care. Every flag
|
|
20
|
+
* must be derived from session-level facts (or the exact turn's resources for
|
|
21
|
+
* attachments) so the composed prefix only changes when they change.
|
|
22
|
+
*/
|
|
23
|
+
export type AgentPromptResources = {
|
|
24
|
+
/** A managed (provisioned) sandbox is the active compute. */
|
|
25
|
+
managedSandbox: boolean;
|
|
26
|
+
/** A Connected Machine is the active compute. */
|
|
27
|
+
connectedMachine: boolean;
|
|
28
|
+
/** Repository resources are mounted in the workspace. */
|
|
29
|
+
repositories: boolean;
|
|
30
|
+
/** Git provider credentials were delivered to the sandbox. */
|
|
31
|
+
gitCredentials: boolean;
|
|
32
|
+
/** Files are attached (mounted) for this turn. */
|
|
33
|
+
attachments: boolean;
|
|
34
|
+
workspaceEnvironment?: WorkspaceEnvironmentContext | undefined;
|
|
35
|
+
rig?: RigInstructionsContext | undefined;
|
|
36
|
+
};
|
|
37
|
+
/** Everything a prompt module may read. Pure data; no settings, no clock. */
|
|
38
|
+
export type AgentPromptContext = {
|
|
39
|
+
capabilities: ResolvedAgentCapabilities;
|
|
40
|
+
renderer: AgentRenderer;
|
|
41
|
+
resources: AgentPromptResources;
|
|
42
|
+
};
|
|
43
|
+
/** One conditional section of the operational contract. */
|
|
44
|
+
export type AgentPromptModule = {
|
|
45
|
+
id: AgentPromptModuleId;
|
|
46
|
+
applies: (context: AgentPromptContext) => boolean;
|
|
47
|
+
render: (context: AgentPromptContext) => string;
|
|
48
|
+
};
|
|
49
|
+
export declare function hasSandbox(context: AgentPromptContext): boolean;
|
|
50
|
+
/** Joins non-empty blocks with blank lines. */
|
|
51
|
+
export declare function blocks(...parts: ReadonlyArray<string | false | null | undefined>): string;
|
|
52
|
+
/** Joins non-empty sentences with single spaces. */
|
|
53
|
+
export declare function sentences(...parts: ReadonlyArray<string | false | null | undefined>): string;
|
|
54
|
+
/** Renders a Markdown bullet list from non-empty items. */
|
|
55
|
+
export declare function bullets(...items: ReadonlyArray<string | false | null | undefined>): string;
|