@clearideas/agent-runtime-server 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/host.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type AgentRuntimeConfig, type ConfiguredMcpToolAdapterOptions, type ModelAuthorizationPolicy, type WorkspaceCompositionOptions } from "@clearideas/agent-runtime-config";
2
2
  import type { AgentManifest, ExecutionPolicies, RunEvent, RunLimits } from "@clearideas/agent-runtime-contracts";
3
- import type { AgentManifestSource, AgentRuntimeDependencies, AgentRuntimeMessagesOptions, ApprovalAdapter, ArtifactStore, ConnectionCredentialProvider, ContextSummarizerAdapter, EventSink, ModelAdapter, RunSandboxProvider, RunStore, SandboxAdapter, StepExecutor, SubRunAdapter, ToolAdapter, WorkspaceProvider } from "@clearideas/agent-runtime-core";
3
+ import type { AgentManifestSource, AgentRuntimeDependencies, AgentRuntimeMessagesOptions, ApprovalAdapter, ArtifactStore, ConnectionCredentialProvider, ContextSummarizerAdapter, EventSink, DecisionAdapter, ModelAdapter, RunSandboxProvider, RunStore, SandboxAdapter, StepExecutor, SubRunAdapter, ToolAdapter, WorkspaceProvider } from "@clearideas/agent-runtime-core";
4
4
  import type { SandboxProvider } from "@clearideas/agent-runtime-sandbox";
5
5
  /** Adapters a trusted runtime module may contribute to a host. */
6
6
  export interface HostRuntime {
@@ -8,6 +8,7 @@ export interface HostRuntime {
8
8
  shutdown?: () => void | Promise<void>;
9
9
  runStore?: RunStore;
10
10
  artifactStore?: ArtifactStore;
11
+ decisions?: DecisionAdapter;
11
12
  model?: ModelAdapter;
12
13
  tools?: ToolAdapter;
13
14
  connectionCredentials?: ConnectionCredentialProvider;
package/dist/host.js CHANGED
@@ -16,7 +16,7 @@ import { composeRuntime, emptyAgentRuntimeConfig, loadAgentRuntimeConfig, } from
16
16
  import { executionPoliciesSchema, runLimitsSchema, } from "@clearideas/agent-runtime-contracts";
17
17
  import { LoopStepExecutor } from "@clearideas/agent-runtime-step-loop";
18
18
  import { PromptMessageHistoryCompactor, PromptStepExecutor, } from "@clearideas/agent-runtime-step-prompt";
19
- import { ApprovalStepExecutor, CodeStepExecutor, SubRunStepExecutor, WebhookStepExecutor, } from "@clearideas/agent-runtime-step-standard";
19
+ import { ApprovalStepExecutor, DecisionStepExecutor, CodeStepExecutor, SubRunStepExecutor, WebhookStepExecutor, } from "@clearideas/agent-runtime-step-standard";
20
20
  const adapterMethod = (value, name) => value != null &&
21
21
  typeof value === "object" &&
22
22
  typeof value[name] === "function";
@@ -35,6 +35,10 @@ export const validateHostRuntime = (runtime) => {
35
35
  !adapterMethod(runtime.artifactStore, "get"))) {
36
36
  throw new Error("Runtime artifactStore must implement ArtifactStore.put() and get().");
37
37
  }
38
+ if (runtime.decisions &&
39
+ (!adapterMethod(runtime.decisions, "has") ||
40
+ !adapterMethod(runtime.decisions, "decide")))
41
+ throw new Error("Runtime decisions must implement DecisionAdapter.has() and decide().");
38
42
  if (runtime.model && !adapterMethod(runtime.model, "generate"))
39
43
  throw new Error("Runtime model must implement ModelAdapter.generate().");
40
44
  if (runtime.tools &&
@@ -97,6 +101,7 @@ const normalizeRuntime = (runtime) => ({
97
101
  ...((runtime.model ?? runtime.modelAdapter)
98
102
  ? { model: runtime.model ?? runtime.modelAdapter }
99
103
  : {}),
104
+ ...(runtime.decisions ? { decisions: runtime.decisions } : {}),
100
105
  ...((runtime.tools ?? runtime.toolAdapter)
101
106
  ? { tools: runtime.tools ?? runtime.toolAdapter }
102
107
  : {}),
@@ -151,6 +156,7 @@ const normalizeRuntime = (runtime) => ({
151
156
  : {}),
152
157
  });
153
158
  const defaultStepExecutors = (trust) => [
159
+ new DecisionStepExecutor(),
154
160
  new PromptStepExecutor(),
155
161
  new LoopStepExecutor(),
156
162
  // Only a local operator's own manifests may reach arbitrary webhook
@@ -335,6 +341,7 @@ export const hostRuntimeDependencies = (runtime, options) => ({
335
341
  conditionEvaluator: new JexlConditionEvaluator(),
336
342
  eventSinks: [...(options.eventSinks ?? []), ...(runtime.eventSinks ?? [])],
337
343
  ...(runtime.model ? { model: runtime.model } : {}),
344
+ ...(runtime.decisions ? { decisions: runtime.decisions } : {}),
338
345
  ...(runtime.tools ? { tools: runtime.tools } : {}),
339
346
  ...(runtime.approvals ? { approvals: runtime.approvals } : {}),
340
347
  ...(runtime.sandbox ? { sandbox: runtime.sandbox } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clearideas/agent-runtime-server",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "OpenAI-compatible HTTP server for Agent Runtime manifests, and the host composition shared by Agent Runtime hosts.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Clear Ideas Incorporated",
@@ -36,16 +36,16 @@
36
36
  "postpack": "node ../../scripts/cleanup-package-license.mjs"
37
37
  },
38
38
  "dependencies": {
39
- "@clearideas/agent-runtime-condition-jexl": "1.0.1",
40
- "@clearideas/agent-runtime-config": "1.0.1",
41
- "@clearideas/agent-runtime-contracts": "1.0.1",
42
- "@clearideas/agent-runtime-core": "1.0.1",
43
- "@clearideas/agent-runtime-sandbox": "1.0.1",
44
- "@clearideas/agent-runtime-step-loop": "1.0.1",
45
- "@clearideas/agent-runtime-step-prompt": "1.0.1",
46
- "@clearideas/agent-runtime-step-standard": "1.0.1",
47
- "@clearideas/agent-runtime-store-local": "1.0.1",
48
- "@clearideas/agent-runtime-store-sqlite": "1.0.1",
39
+ "@clearideas/agent-runtime-condition-jexl": "1.1.0",
40
+ "@clearideas/agent-runtime-config": "1.1.0",
41
+ "@clearideas/agent-runtime-contracts": "1.1.0",
42
+ "@clearideas/agent-runtime-core": "1.1.0",
43
+ "@clearideas/agent-runtime-sandbox": "1.1.0",
44
+ "@clearideas/agent-runtime-step-loop": "1.1.0",
45
+ "@clearideas/agent-runtime-step-prompt": "1.1.0",
46
+ "@clearideas/agent-runtime-step-standard": "1.1.0",
47
+ "@clearideas/agent-runtime-store-local": "1.1.0",
48
+ "@clearideas/agent-runtime-store-sqlite": "1.1.0",
49
49
  "yaml": "^2.9.1",
50
50
  "zod": "^4.6.6"
51
51
  },