@niscorp/cortex 0.1.6 → 0.2.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/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { z, ZodType } from 'zod';
2
2
  import * as _niscorp_signal from '@niscorp/signal';
3
- import { StepRequest, StepResult, StreamOptions, StepStreamEvent, CountInput, SignalDescription, Message, StepToolDescriptor } from '@niscorp/signal';
3
+ import { StepRequest, StreamOptions, StepResult, StepStreamEvent, CountInput, SignalDescription, Message, StepToolDescriptor } from '@niscorp/signal';
4
4
  export { Message } from '@niscorp/signal';
5
5
 
6
6
  type SignalClient = {
7
- step: (request: StepRequest) => Promise<StepResult>;
7
+ step: (request: StepRequest, options?: StreamOptions) => Promise<StepResult>;
8
8
  stepStream: (request: StepRequest, options?: StreamOptions) => AsyncIterable<StepStreamEvent>;
9
9
  count: (input: CountInput) => Promise<number>;
10
10
  describe: () => SignalDescription;
@@ -151,12 +151,20 @@ type CortexEventBody = {
151
151
  };
152
152
  type CortexEvent = CortexEventBase & CortexEventBody;
153
153
 
154
+ type ApprovalAnswers = {
155
+ approve: (approvalId: string, options?: {
156
+ args?: unknown;
157
+ }) => void;
158
+ deny: (approvalId: string, reason?: string) => void;
159
+ };
160
+
154
161
  type ToolContext = {
155
162
  runId: string;
156
163
  agentId: string;
157
164
  agentPath: ReadonlyArray<string>;
158
165
  signal: AbortSignal;
159
166
  forward: (event: CortexEvent) => void;
167
+ forwardApprovals?: (run: ApprovalAnswers) => () => void;
160
168
  };
161
169
  type ToolConfig<TInput = unknown, TOutput = unknown> = ToolConfigInput & {
162
170
  input: ZodType<TInput>;
@@ -339,6 +347,7 @@ type OutputConfig<TData> = {
339
347
  forceTool?: boolean;
340
348
  doc?: 'auto' | 'off' | string;
341
349
  validate?: OutputValidator<TData>;
350
+ refuseCutOff?: boolean;
342
351
  };
343
352
  type AgentConfig<TData, TDeps> = {
344
353
  id: string;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { z, ZodType } from 'zod';
2
2
  import * as _niscorp_signal from '@niscorp/signal';
3
- import { StepRequest, StepResult, StreamOptions, StepStreamEvent, CountInput, SignalDescription, Message, StepToolDescriptor } from '@niscorp/signal';
3
+ import { StepRequest, StreamOptions, StepResult, StepStreamEvent, CountInput, SignalDescription, Message, StepToolDescriptor } from '@niscorp/signal';
4
4
  export { Message } from '@niscorp/signal';
5
5
 
6
6
  type SignalClient = {
7
- step: (request: StepRequest) => Promise<StepResult>;
7
+ step: (request: StepRequest, options?: StreamOptions) => Promise<StepResult>;
8
8
  stepStream: (request: StepRequest, options?: StreamOptions) => AsyncIterable<StepStreamEvent>;
9
9
  count: (input: CountInput) => Promise<number>;
10
10
  describe: () => SignalDescription;
@@ -151,12 +151,20 @@ type CortexEventBody = {
151
151
  };
152
152
  type CortexEvent = CortexEventBase & CortexEventBody;
153
153
 
154
+ type ApprovalAnswers = {
155
+ approve: (approvalId: string, options?: {
156
+ args?: unknown;
157
+ }) => void;
158
+ deny: (approvalId: string, reason?: string) => void;
159
+ };
160
+
154
161
  type ToolContext = {
155
162
  runId: string;
156
163
  agentId: string;
157
164
  agentPath: ReadonlyArray<string>;
158
165
  signal: AbortSignal;
159
166
  forward: (event: CortexEvent) => void;
167
+ forwardApprovals?: (run: ApprovalAnswers) => () => void;
160
168
  };
161
169
  type ToolConfig<TInput = unknown, TOutput = unknown> = ToolConfigInput & {
162
170
  input: ZodType<TInput>;
@@ -339,6 +347,7 @@ type OutputConfig<TData> = {
339
347
  forceTool?: boolean;
340
348
  doc?: 'auto' | 'off' | string;
341
349
  validate?: OutputValidator<TData>;
350
+ refuseCutOff?: boolean;
342
351
  };
343
352
  type AgentConfig<TData, TDeps> = {
344
353
  id: string;