@j0hanz/cortex-mcp 1.3.0 → 1.4.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/engine/config.d.ts +1 -1
- package/dist/engine/config.js +8 -1
- package/dist/engine/context.d.ts +0 -1
- package/dist/engine/context.js +0 -1
- package/dist/engine/events.d.ts +0 -1
- package/dist/engine/events.js +0 -1
- package/dist/engine/reasoner.d.ts +7 -2
- package/dist/engine/reasoner.js +21 -7
- package/dist/engine/session-store.d.ts +2 -2
- package/dist/engine/session-store.js +25 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/lib/errors.d.ts +0 -1
- package/dist/lib/errors.js +0 -1
- package/dist/lib/formatting.d.ts +0 -1
- package/dist/lib/formatting.js +0 -1
- package/dist/lib/prompt-contracts.d.ts +14 -0
- package/dist/lib/prompt-contracts.js +124 -0
- package/dist/lib/text.d.ts +0 -1
- package/dist/lib/text.js +0 -1
- package/dist/lib/tool-contracts.d.ts +15 -0
- package/dist/lib/tool-contracts.js +92 -0
- package/dist/lib/tool-response.d.ts +0 -1
- package/dist/lib/tool-response.js +0 -1
- package/dist/lib/types.d.ts +1 -1
- package/dist/lib/types.js +0 -1
- package/dist/lib/validators.d.ts +0 -1
- package/dist/lib/validators.js +0 -1
- package/dist/prompts/index.d.ts +0 -1
- package/dist/prompts/index.js +60 -48
- package/dist/resources/index.d.ts +0 -1
- package/dist/resources/index.js +26 -3
- package/dist/resources/instructions.d.ts +1 -0
- package/dist/resources/instructions.js +95 -0
- package/dist/resources/tool-catalog.d.ts +1 -0
- package/dist/resources/tool-catalog.js +20 -0
- package/dist/resources/tool-info.d.ts +2 -0
- package/dist/resources/tool-info.js +35 -0
- package/dist/resources/workflows.d.ts +1 -0
- package/dist/resources/workflows.js +60 -0
- package/dist/schemas/inputs.d.ts +7 -2
- package/dist/schemas/inputs.js +37 -2
- package/dist/schemas/outputs.d.ts +3 -1
- package/dist/schemas/outputs.js +4 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.js +2 -3
- package/dist/tools/index.d.ts +0 -1
- package/dist/tools/index.js +0 -1
- package/dist/tools/reasoning-think.d.ts +0 -1
- package/dist/tools/reasoning-think.js +169 -33
- package/package.json +9 -10
- package/dist/engine/config.d.ts.map +0 -1
- package/dist/engine/config.js.map +0 -1
- package/dist/engine/context.d.ts.map +0 -1
- package/dist/engine/context.js.map +0 -1
- package/dist/engine/events.d.ts.map +0 -1
- package/dist/engine/events.js.map +0 -1
- package/dist/engine/reasoner.d.ts.map +0 -1
- package/dist/engine/reasoner.js.map +0 -1
- package/dist/engine/session-store.d.ts.map +0 -1
- package/dist/engine/session-store.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/instructions.md +0 -148
- package/dist/lib/errors.d.ts.map +0 -1
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/formatting.d.ts.map +0 -1
- package/dist/lib/formatting.js.map +0 -1
- package/dist/lib/instructions.d.ts +0 -5
- package/dist/lib/instructions.d.ts.map +0 -1
- package/dist/lib/instructions.js +0 -30
- package/dist/lib/instructions.js.map +0 -1
- package/dist/lib/text.d.ts.map +0 -1
- package/dist/lib/text.js.map +0 -1
- package/dist/lib/tool-response.d.ts.map +0 -1
- package/dist/lib/tool-response.js.map +0 -1
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/validators.d.ts.map +0 -1
- package/dist/lib/validators.js.map +0 -1
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/index.js.map +0 -1
- package/dist/resources/index.d.ts.map +0 -1
- package/dist/resources/index.js.map +0 -1
- package/dist/schemas/inputs.d.ts.map +0 -1
- package/dist/schemas/inputs.js.map +0 -1
- package/dist/schemas/outputs.d.ts.map +0 -1
- package/dist/schemas/outputs.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/reasoning-think.d.ts.map +0 -1
- package/dist/tools/reasoning-think.js.map +0 -1
package/dist/engine/config.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ export declare const LEVEL_CONFIGS: {
|
|
|
18
18
|
};
|
|
19
19
|
export declare function getLevelConfig(level: ReasoningLevel): LevelConfig;
|
|
20
20
|
export declare function assertTargetThoughtsInRange(level: ReasoningLevel, targetThoughts: number): void;
|
|
21
|
-
|
|
21
|
+
export declare function getLevelDescriptionString(): string;
|
package/dist/engine/config.js
CHANGED
|
@@ -14,4 +14,11 @@ export function assertTargetThoughtsInRange(level, targetThoughts) {
|
|
|
14
14
|
}
|
|
15
15
|
throw new Error(errorMessage);
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
export function getLevelDescriptionString() {
|
|
18
|
+
return Object.entries(LEVEL_CONFIGS)
|
|
19
|
+
.map(([level, config]) => {
|
|
20
|
+
const budgetK = Math.round(config.tokenBudget / 1024);
|
|
21
|
+
return `${level} (${config.minThoughts}–${config.maxThoughts} steps, ${budgetK}K budget)`;
|
|
22
|
+
})
|
|
23
|
+
.join(', ');
|
|
24
|
+
}
|
package/dist/engine/context.d.ts
CHANGED
package/dist/engine/context.js
CHANGED
package/dist/engine/events.d.ts
CHANGED
package/dist/engine/events.js
CHANGED
|
@@ -5,9 +5,14 @@ export { sessionStore };
|
|
|
5
5
|
interface ReasonOptions {
|
|
6
6
|
sessionId?: string;
|
|
7
7
|
targetThoughts?: number;
|
|
8
|
-
thought
|
|
8
|
+
thought?: string;
|
|
9
|
+
observation?: string;
|
|
10
|
+
hypothesis?: string;
|
|
11
|
+
evaluation?: string;
|
|
12
|
+
stepSummary?: string;
|
|
13
|
+
isConclusion?: boolean;
|
|
14
|
+
rollbackToStep?: number;
|
|
9
15
|
abortSignal?: AbortSignal;
|
|
10
16
|
onProgress?: (progress: number, total: number) => void | Promise<void>;
|
|
11
17
|
}
|
|
12
18
|
export declare function reason(query: string, level: ReasoningLevel | undefined, options?: ReasonOptions): Promise<Readonly<Session>>;
|
|
13
|
-
//# sourceMappingURL=reasoner.d.ts.map
|
package/dist/engine/reasoner.js
CHANGED
|
@@ -25,16 +25,31 @@ const sentenceSegmenter = createSegmenter('sentence');
|
|
|
25
25
|
const sessionLocks = new Map();
|
|
26
26
|
export { sessionStore };
|
|
27
27
|
export async function reason(query, level, options) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const { sessionId, targetThoughts, thought, observation, hypothesis, evaluation, stepSummary, isConclusion, rollbackToStep, abortSignal, onProgress, } = options ?? {};
|
|
29
|
+
const hasContent = thought !== undefined ||
|
|
30
|
+
(observation !== undefined &&
|
|
31
|
+
hypothesis !== undefined &&
|
|
32
|
+
evaluation !== undefined);
|
|
33
|
+
if (!hasContent && rollbackToStep === undefined) {
|
|
34
|
+
throw new Error('Either thought (or observation/hypothesis/evaluation) or rollback_to_step is required');
|
|
30
35
|
}
|
|
31
|
-
const { sessionId, targetThoughts, thought, abortSignal, onProgress } = options;
|
|
32
36
|
const session = resolveSession(level, sessionId, query, targetThoughts);
|
|
33
37
|
const config = getLevelConfig(session.level);
|
|
34
38
|
const { totalThoughts } = session;
|
|
35
39
|
return runWithContext({ sessionId: session.id, ...(abortSignal ? { abortSignal } : {}) }, () => withSessionLock(session.id, async () => {
|
|
36
40
|
throwIfReasoningAborted(abortSignal);
|
|
41
|
+
if (rollbackToStep !== undefined) {
|
|
42
|
+
sessionStore.rollback(session.id, rollbackToStep);
|
|
43
|
+
}
|
|
37
44
|
const current = getSessionOrThrow(session.id);
|
|
45
|
+
let content = thought;
|
|
46
|
+
if (!content && observation) {
|
|
47
|
+
content = `**Observation:** ${observation}\n\n**Hypothesis:** ${hypothesis ?? ''}\n\n**Evaluation:** ${evaluation ?? ''}`;
|
|
48
|
+
}
|
|
49
|
+
if (!content) {
|
|
50
|
+
// Only rollback occurred
|
|
51
|
+
return current;
|
|
52
|
+
}
|
|
38
53
|
if (emitBudgetExhaustedIfNeeded({
|
|
39
54
|
session: current,
|
|
40
55
|
tokenBudget: config.tokenBudget,
|
|
@@ -44,10 +59,10 @@ export async function reason(query, level, options) {
|
|
|
44
59
|
return current;
|
|
45
60
|
}
|
|
46
61
|
const nextIndex = current.thoughts.length;
|
|
47
|
-
if (nextIndex >= totalThoughts) {
|
|
62
|
+
if (nextIndex >= totalThoughts && !isConclusion) {
|
|
48
63
|
return current;
|
|
49
64
|
}
|
|
50
|
-
const addedThought = sessionStore.addThought(session.id,
|
|
65
|
+
const addedThought = sessionStore.addThought(session.id, content, stepSummary);
|
|
51
66
|
engineEvents.emit('thought:added', {
|
|
52
67
|
sessionId: session.id,
|
|
53
68
|
index: addedThought.index,
|
|
@@ -60,7 +75,7 @@ export async function reason(query, level, options) {
|
|
|
60
75
|
generatedThoughts: addedThought.index + 1,
|
|
61
76
|
requestedThoughts: totalThoughts,
|
|
62
77
|
});
|
|
63
|
-
if (updated.thoughts.length >= totalThoughts) {
|
|
78
|
+
if (isConclusion || updated.thoughts.length >= totalThoughts) {
|
|
64
79
|
sessionStore.markCompleted(session.id);
|
|
65
80
|
}
|
|
66
81
|
if (onProgress) {
|
|
@@ -208,4 +223,3 @@ function throwIfReasoningAborted(signal) {
|
|
|
208
223
|
throw new Error('Reasoning aborted');
|
|
209
224
|
}
|
|
210
225
|
}
|
|
211
|
-
//# sourceMappingURL=reasoner.js.map
|
|
@@ -21,7 +21,8 @@ export declare class SessionStore {
|
|
|
21
21
|
getExpiresAt(sessionId: string): number | undefined;
|
|
22
22
|
getTotalTokensUsed(): number;
|
|
23
23
|
delete(id: string): boolean;
|
|
24
|
-
addThought(sessionId: string, content: string): Thought;
|
|
24
|
+
addThought(sessionId: string, content: string, stepSummary?: string): Thought;
|
|
25
|
+
rollback(sessionId: string, toIndex: number): void;
|
|
25
26
|
reviseThought(sessionId: string, thoughtIndex: number, content: string): Thought;
|
|
26
27
|
markCompleted(sessionId: string): void;
|
|
27
28
|
markCancelled(sessionId: string): void;
|
|
@@ -48,4 +49,3 @@ export declare class SessionStore {
|
|
|
48
49
|
private emitSessionEvicted;
|
|
49
50
|
private emitSessionResourcesUpdated;
|
|
50
51
|
}
|
|
51
|
-
//# sourceMappingURL=session-store.d.ts.map
|
|
@@ -112,7 +112,7 @@ export class SessionStore {
|
|
|
112
112
|
this.emitSessionsCollectionUpdated();
|
|
113
113
|
return true;
|
|
114
114
|
}
|
|
115
|
-
addThought(sessionId, content) {
|
|
115
|
+
addThought(sessionId, content, stepSummary) {
|
|
116
116
|
const session = this.sessions.get(sessionId);
|
|
117
117
|
if (!session) {
|
|
118
118
|
throw new Error(`Session not found: ${sessionId}`);
|
|
@@ -123,6 +123,7 @@ export class SessionStore {
|
|
|
123
123
|
index: session.thoughts.length,
|
|
124
124
|
content,
|
|
125
125
|
revision: 0,
|
|
126
|
+
...(stepSummary !== undefined ? { stepSummary } : {}),
|
|
126
127
|
};
|
|
127
128
|
session.thoughts.push(thought);
|
|
128
129
|
session.tokensUsed += tokens;
|
|
@@ -130,6 +131,26 @@ export class SessionStore {
|
|
|
130
131
|
this.markSessionTouched(session);
|
|
131
132
|
return this.snapshotThought(thought);
|
|
132
133
|
}
|
|
134
|
+
rollback(sessionId, toIndex) {
|
|
135
|
+
const session = this.sessions.get(sessionId);
|
|
136
|
+
if (!session) {
|
|
137
|
+
throw new Error(`Session not found: ${sessionId}`);
|
|
138
|
+
}
|
|
139
|
+
// If toIndex is out of bounds or implies no change, return.
|
|
140
|
+
// We keep thoughts up to and including toIndex.
|
|
141
|
+
if (toIndex < 0 || toIndex >= session.thoughts.length - 1) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const removedThoughts = session.thoughts.slice(toIndex + 1);
|
|
145
|
+
session.thoughts = session.thoughts.slice(0, toIndex + 1);
|
|
146
|
+
let removedTokens = 0;
|
|
147
|
+
for (const t of removedThoughts) {
|
|
148
|
+
removedTokens += estimateTokens(t.content);
|
|
149
|
+
}
|
|
150
|
+
session.tokensUsed -= removedTokens;
|
|
151
|
+
this.totalTokens -= removedTokens;
|
|
152
|
+
this.markSessionTouched(session);
|
|
153
|
+
}
|
|
133
154
|
reviseThought(sessionId, thoughtIndex, content) {
|
|
134
155
|
const session = this.sessions.get(sessionId);
|
|
135
156
|
if (!session) {
|
|
@@ -336,6 +357,9 @@ export class SessionStore {
|
|
|
336
357
|
index: thought.index,
|
|
337
358
|
content: thought.content,
|
|
338
359
|
revision: thought.revision,
|
|
360
|
+
...(thought.stepSummary !== undefined
|
|
361
|
+
? { stepSummary: thought.stepSummary }
|
|
362
|
+
: {}),
|
|
339
363
|
};
|
|
340
364
|
}
|
|
341
365
|
snapshotSession(session) {
|
|
@@ -389,4 +413,3 @@ export class SessionStore {
|
|
|
389
413
|
this.emitSessionsResourceUpdated();
|
|
390
414
|
}
|
|
391
415
|
}
|
|
392
|
-
//# sourceMappingURL=session-store.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/lib/errors.d.ts
CHANGED
package/dist/lib/errors.js
CHANGED
package/dist/lib/formatting.d.ts
CHANGED
package/dist/lib/formatting.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface PromptArg {
|
|
3
|
+
name: string;
|
|
4
|
+
type: z.ZodType;
|
|
5
|
+
description: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PromptContract {
|
|
9
|
+
name: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
args: PromptArg[];
|
|
13
|
+
}
|
|
14
|
+
export declare function getPromptContracts(): PromptContract[];
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function getPromptContracts() {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
name: 'get-help',
|
|
6
|
+
title: 'Get Help',
|
|
7
|
+
description: 'Return the server usage instructions.',
|
|
8
|
+
args: [],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'reasoning.basic',
|
|
12
|
+
title: 'Reasoning Basic',
|
|
13
|
+
description: 'Prepare a basic-depth reasoning request (3–5 thoughts).',
|
|
14
|
+
args: [
|
|
15
|
+
{
|
|
16
|
+
name: 'query',
|
|
17
|
+
type: z.string().min(1).max(10000),
|
|
18
|
+
description: 'The question or problem to reason about',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'targetThoughts',
|
|
23
|
+
type: z.number().int().min(1).max(25),
|
|
24
|
+
description: 'Optional exact step count within the selected level range (max 25)',
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'reasoning.normal',
|
|
31
|
+
title: 'Reasoning Normal',
|
|
32
|
+
description: 'Prepare a normal-depth reasoning request (6–10 thoughts).',
|
|
33
|
+
args: [
|
|
34
|
+
{
|
|
35
|
+
name: 'query',
|
|
36
|
+
type: z.string().min(1).max(10000),
|
|
37
|
+
description: 'The question or problem to reason about',
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'targetThoughts',
|
|
42
|
+
type: z.number().int().min(1).max(25),
|
|
43
|
+
description: 'Optional exact step count within the selected level range (max 25)',
|
|
44
|
+
required: false,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'reasoning.high',
|
|
50
|
+
title: 'Reasoning High',
|
|
51
|
+
description: 'Prepare a high-depth reasoning request (15–25 thoughts).',
|
|
52
|
+
args: [
|
|
53
|
+
{
|
|
54
|
+
name: 'query',
|
|
55
|
+
type: z.string().min(1).max(10000),
|
|
56
|
+
description: 'The question or problem to reason about',
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'targetThoughts',
|
|
61
|
+
type: z.number().int().min(1).max(25),
|
|
62
|
+
description: 'Optional exact step count within the selected level range (max 25)',
|
|
63
|
+
required: false,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'reasoning.continue',
|
|
69
|
+
title: 'Continue Reasoning',
|
|
70
|
+
description: 'Continue an existing reasoning session (follow-up query optional).',
|
|
71
|
+
args: [
|
|
72
|
+
{
|
|
73
|
+
name: 'sessionId',
|
|
74
|
+
type: z.string().min(1).max(128),
|
|
75
|
+
description: 'Existing session ID to continue',
|
|
76
|
+
required: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'query',
|
|
80
|
+
type: z.string().min(1).max(10000),
|
|
81
|
+
description: 'Follow-up query for the existing session',
|
|
82
|
+
required: false,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'level',
|
|
86
|
+
type: z.enum(['basic', 'normal', 'high']),
|
|
87
|
+
description: 'Optional in the tool; session level is used if provided',
|
|
88
|
+
required: false,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'targetThoughts',
|
|
92
|
+
type: z.number().int().min(1).max(25),
|
|
93
|
+
description: 'Optional exact step count within the selected level range (max 25)',
|
|
94
|
+
required: false,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'reasoning.retry',
|
|
100
|
+
title: 'Retry Reasoning',
|
|
101
|
+
description: 'Retry a failed reasoning task with modified parameters.',
|
|
102
|
+
args: [
|
|
103
|
+
{
|
|
104
|
+
name: 'query',
|
|
105
|
+
type: z.string().min(1).max(10000),
|
|
106
|
+
description: 'The original or modified query',
|
|
107
|
+
required: true,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'level',
|
|
111
|
+
type: z.enum(['basic', 'normal', 'high']),
|
|
112
|
+
description: 'The reasoning level to use',
|
|
113
|
+
required: true,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'targetThoughts',
|
|
117
|
+
type: z.number().int().min(1).max(25),
|
|
118
|
+
description: 'Optional exact step count',
|
|
119
|
+
required: false,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
}
|
package/dist/lib/text.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ export declare function truncate(str: string, maxLength: number, segmenter?: Int
|
|
|
12
12
|
* Drops incomplete characters at the end rather than using replacement characters.
|
|
13
13
|
*/
|
|
14
14
|
export declare function truncateByUtf8Boundary(str: string, maxBytes: number): string;
|
|
15
|
-
//# sourceMappingURL=text.d.ts.map
|
package/dist/lib/text.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ToolContract {
|
|
2
|
+
name: string;
|
|
3
|
+
purpose: string;
|
|
4
|
+
model: string;
|
|
5
|
+
timeoutMs: number;
|
|
6
|
+
maxOutputTokens: number;
|
|
7
|
+
params: {
|
|
8
|
+
name: string;
|
|
9
|
+
type: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
constraints: string;
|
|
12
|
+
}[];
|
|
13
|
+
outputShape: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function getToolContracts(): ToolContract[];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export function getToolContracts() {
|
|
2
|
+
return [
|
|
3
|
+
{
|
|
4
|
+
name: 'reasoning_think',
|
|
5
|
+
purpose: 'Structured multi-step reasoning tool. Decomposes analysis into sequential thought steps stored in a persistent session trace.',
|
|
6
|
+
model: 'none (engine)',
|
|
7
|
+
timeoutMs: 0,
|
|
8
|
+
maxOutputTokens: 0,
|
|
9
|
+
params: [
|
|
10
|
+
{
|
|
11
|
+
name: 'query',
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: false,
|
|
14
|
+
constraints: '1-10,000 chars',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'level',
|
|
18
|
+
type: 'string',
|
|
19
|
+
required: false,
|
|
20
|
+
constraints: 'basic | normal | high',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'runMode',
|
|
24
|
+
type: 'string',
|
|
25
|
+
required: false,
|
|
26
|
+
constraints: 'step | run_to_completion',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'thought',
|
|
30
|
+
type: 'string | string[]',
|
|
31
|
+
required: false,
|
|
32
|
+
constraints: '1-100,000 chars',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'thoughts',
|
|
36
|
+
type: 'string[]',
|
|
37
|
+
required: false,
|
|
38
|
+
constraints: 'optional',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'targetThoughts',
|
|
42
|
+
type: 'number',
|
|
43
|
+
required: false,
|
|
44
|
+
constraints: '1-25',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'sessionId',
|
|
48
|
+
type: 'string',
|
|
49
|
+
required: false,
|
|
50
|
+
constraints: '1-128 chars',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'observation',
|
|
54
|
+
type: 'string',
|
|
55
|
+
required: false,
|
|
56
|
+
constraints: 'optional',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'hypothesis',
|
|
60
|
+
type: 'string',
|
|
61
|
+
required: false,
|
|
62
|
+
constraints: 'optional',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'evaluation',
|
|
66
|
+
type: 'string',
|
|
67
|
+
required: false,
|
|
68
|
+
constraints: 'optional',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'step_summary',
|
|
72
|
+
type: 'string',
|
|
73
|
+
required: false,
|
|
74
|
+
constraints: 'optional',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'is_conclusion',
|
|
78
|
+
type: 'boolean',
|
|
79
|
+
required: false,
|
|
80
|
+
constraints: 'optional',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'rollback_to_step',
|
|
84
|
+
type: 'number',
|
|
85
|
+
required: false,
|
|
86
|
+
constraints: 'optional',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
outputShape: '{ok, result: {sessionId, level, status, thoughts[], generatedThoughts, requestedThoughts, totalThoughts, remainingThoughts, tokenBudget, tokensUsed, ttlMs, expiresAt, createdAt, updatedAt, summary}}',
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface Thought {
|
|
|
19
19
|
readonly index: number;
|
|
20
20
|
readonly content: string;
|
|
21
21
|
readonly revision: number;
|
|
22
|
+
readonly stepSummary?: string;
|
|
22
23
|
}
|
|
23
24
|
export interface Session extends SessionBase {
|
|
24
25
|
readonly thoughts: readonly Thought[];
|
|
@@ -37,4 +38,3 @@ export interface IconMeta {
|
|
|
37
38
|
sizes?: string[];
|
|
38
39
|
}
|
|
39
40
|
export {};
|
|
40
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/lib/types.js
CHANGED
package/dist/lib/validators.d.ts
CHANGED
package/dist/lib/validators.js
CHANGED
package/dist/prompts/index.d.ts
CHANGED