@lota-sdk/core 0.1.45 → 0.1.47
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/infrastructure/schema/00_workstream.surql +0 -1
- package/package.json +2 -2
- package/src/runtime/agent-runtime-policy.ts +0 -2
- package/src/runtime/context-compaction-runtime.ts +2 -3
- package/src/runtime/context-compaction.ts +48 -590
- package/src/runtime/execution-plan.ts +7 -1
- package/src/runtime/index.ts +0 -12
- package/src/runtime/post-turn-side-effects.ts +0 -3
- package/src/runtime/runtime-extensions.ts +0 -1
- package/src/runtime/workstream-chat-helpers.ts +1 -8
- package/src/services/context-compaction.service.ts +5 -21
- package/src/services/workstream-turn-preparation.service.ts +46 -53
- package/src/system-agents/context-compaction.agent.ts +4 -10
- package/src/runtime/workstream-state.ts +0 -274
|
@@ -18,7 +18,6 @@ DEFINE FIELD IF NOT EXISTS compactionSummary ON TABLE workstream TYPE option<str
|
|
|
18
18
|
DEFINE FIELD IF NOT EXISTS lastCompactedMessageId ON TABLE workstream TYPE option<string>;
|
|
19
19
|
DEFINE FIELD IF NOT EXISTS nameGenerated ON TABLE workstream TYPE bool DEFAULT false;
|
|
20
20
|
DEFINE FIELD IF NOT EXISTS isCompacting ON TABLE workstream TYPE bool DEFAULT false;
|
|
21
|
-
DEFINE FIELD IF NOT EXISTS state ON TABLE workstream TYPE option<object> FLEXIBLE;
|
|
22
21
|
DEFINE FIELD IF NOT EXISTS members ON TABLE workstream TYPE option<array<string>> DEFAULT [];
|
|
23
22
|
DEFINE FIELD IF NOT EXISTS turnCount ON TABLE workstream TYPE int DEFAULT 0;
|
|
24
23
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lota-sdk/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@chat-adapter/slack": "^4.23.0",
|
|
33
33
|
"@chat-adapter/state-ioredis": "^4.23.0",
|
|
34
34
|
"@logtape/logtape": "^2.0.5",
|
|
35
|
-
"@lota-sdk/shared": "0.1.
|
|
35
|
+
"@lota-sdk/shared": "0.1.47",
|
|
36
36
|
"@mendable/firecrawl-js": "^4.18.0",
|
|
37
37
|
"@surrealdb/node": "^3.0.3",
|
|
38
38
|
"ai": "^6.0.141",
|
|
@@ -116,7 +116,6 @@ export function buildAgentRuntimeConfig<TAgent extends string, TSkill extends Pr
|
|
|
116
116
|
preSeededMemoriesSection?: string
|
|
117
117
|
retrievedKnowledgeSection?: string
|
|
118
118
|
workstreamMemoryBlock?: string
|
|
119
|
-
workstreamStateSection?: string
|
|
120
119
|
responseGuardSection?: string
|
|
121
120
|
learnedSkillsSection?: string
|
|
122
121
|
additionalInstructionSections?: string[]
|
|
@@ -140,7 +139,6 @@ export function buildAgentRuntimeConfig<TAgent extends string, TSkill extends Pr
|
|
|
140
139
|
params.preSeededMemoriesSection?.trim(),
|
|
141
140
|
params.retrievedKnowledgeSection?.trim(),
|
|
142
141
|
toMemoryBlockSection(params.workstreamMemoryBlock),
|
|
143
|
-
params.workstreamStateSection?.trim(),
|
|
144
142
|
...(params.additionalInstructionSections?.map((section) => section.trim()) ?? []),
|
|
145
143
|
params.responseGuardSection?.trim(),
|
|
146
144
|
params.onboardingActive ? 'Onboarding is active. Keep responses onboarding-focused and concise.' : undefined,
|
|
@@ -2,6 +2,7 @@ import { createContextCompactionAgent } from '../system-agents/context-compactio
|
|
|
2
2
|
import {
|
|
3
3
|
buildContextCompactionPrompt,
|
|
4
4
|
buildMemoryBlockCompactionPrompt,
|
|
5
|
+
ContextCompactionOutputSchema,
|
|
5
6
|
createContextCompactionRuntime,
|
|
6
7
|
parseCompactionOutput,
|
|
7
8
|
} from './context-compaction'
|
|
@@ -16,7 +17,6 @@ import {
|
|
|
16
17
|
SUMMARY_ROLLUP_MAX_TOKENS,
|
|
17
18
|
} from './context-compaction-constants'
|
|
18
19
|
import type { GenerateHelperStructuredParams, GenerateHelperTextParams } from './helper-model'
|
|
19
|
-
import { StructuredCompactionOutputSchema } from './workstream-state'
|
|
20
20
|
|
|
21
21
|
const CONTEXT_COMPACTION_MAX_OUTPUT_TOKENS = 512
|
|
22
22
|
|
|
@@ -40,12 +40,11 @@ async function runContextCompacter(helperModelRuntime: HelperModelRuntime, param
|
|
|
40
40
|
role: 'user',
|
|
41
41
|
content: buildContextCompactionPrompt({
|
|
42
42
|
previousSummary: params.previousSummary,
|
|
43
|
-
existingState: params.existingState,
|
|
44
43
|
transcript: params.transcript,
|
|
45
44
|
}),
|
|
46
45
|
},
|
|
47
46
|
],
|
|
48
|
-
schema:
|
|
47
|
+
schema: ContextCompactionOutputSchema,
|
|
49
48
|
maxOutputTokens: 8_000,
|
|
50
49
|
})
|
|
51
50
|
|