actoviq-agent-sdk 0.4.0 → 0.4.2
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/README-zh.md +15 -2
- package/README.md +20 -7
- package/dist/src/cli/actoviq-react.js +178 -3
- package/dist/src/cli/actoviq-react.js.map +1 -1
- package/dist/src/cli/actoviq-tui.js +2 -2
- package/dist/src/index.d.ts +17 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +17 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/router/modelRouter.d.ts +46 -0
- package/dist/src/router/modelRouter.d.ts.map +1 -0
- package/dist/src/router/modelRouter.js +227 -0
- package/dist/src/router/modelRouter.js.map +1 -0
- package/dist/src/runtime/actoviqSkills.d.ts +6 -0
- package/dist/src/runtime/actoviqSkills.d.ts.map +1 -1
- package/dist/src/runtime/actoviqSkills.js +69 -1
- package/dist/src/runtime/actoviqSkills.js.map +1 -1
- package/dist/src/runtime/agentClient.d.ts +16 -0
- package/dist/src/runtime/agentClient.d.ts.map +1 -1
- package/dist/src/runtime/agentClient.js +89 -9
- package/dist/src/runtime/agentClient.js.map +1 -1
- package/dist/src/runtime/conversationEngine.d.ts +2 -0
- package/dist/src/runtime/conversationEngine.d.ts.map +1 -1
- package/dist/src/runtime/conversationEngine.js +6 -5
- package/dist/src/runtime/conversationEngine.js.map +1 -1
- package/dist/src/storage/sessionStore.d.ts.map +1 -1
- package/dist/src/storage/sessionStore.js +25 -6
- package/dist/src/storage/sessionStore.js.map +1 -1
- package/dist/src/team/agentPool.d.ts +26 -0
- package/dist/src/team/agentPool.d.ts.map +1 -0
- package/dist/src/team/agentPool.js +97 -0
- package/dist/src/team/agentPool.js.map +1 -0
- package/dist/src/team/modelTeam.d.ts +56 -0
- package/dist/src/team/modelTeam.d.ts.map +1 -0
- package/dist/src/team/modelTeam.js +542 -0
- package/dist/src/team/modelTeam.js.map +1 -0
- package/dist/src/team/pricing.d.ts +15 -0
- package/dist/src/team/pricing.d.ts.map +1 -0
- package/dist/src/team/pricing.js +80 -0
- package/dist/src/team/pricing.js.map +1 -0
- package/dist/src/team/teamDefinitions.d.ts +28 -0
- package/dist/src/team/teamDefinitions.d.ts.map +1 -0
- package/dist/src/team/teamDefinitions.js +151 -0
- package/dist/src/team/teamDefinitions.js.map +1 -0
- package/dist/src/tools/actoviqCoreTools.d.ts.map +1 -1
- package/dist/src/tools/actoviqCoreTools.js +6 -1
- package/dist/src/tools/actoviqCoreTools.js.map +1 -1
- package/dist/src/tools/enterWorktree.d.ts +11 -0
- package/dist/src/tools/enterWorktree.d.ts.map +1 -0
- package/dist/src/tools/enterWorktree.js +79 -0
- package/dist/src/tools/enterWorktree.js.map +1 -0
- package/dist/src/tools/exitWorktree.d.ts +4 -0
- package/dist/src/tools/exitWorktree.d.ts.map +1 -0
- package/dist/src/tools/exitWorktree.js +48 -0
- package/dist/src/tools/exitWorktree.js.map +1 -0
- package/dist/src/tools/tavilySearch.d.ts +12 -0
- package/dist/src/tools/tavilySearch.d.ts.map +1 -0
- package/dist/src/tools/tavilySearch.js +139 -0
- package/dist/src/tools/tavilySearch.js.map +1 -0
- package/dist/src/tui/actoviqTui.d.ts +10 -0
- package/dist/src/tui/actoviqTui.d.ts.map +1 -1
- package/dist/src/tui/actoviqTui.js +606 -35
- package/dist/src/tui/actoviqTui.js.map +1 -1
- package/dist/src/tui/editor.d.ts +2 -0
- package/dist/src/tui/editor.d.ts.map +1 -1
- package/dist/src/tui/editor.js +5 -0
- package/dist/src/tui/editor.js.map +1 -1
- package/dist/src/types.d.ts +323 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/workflow/workflowPersistence.d.ts +34 -0
- package/dist/src/workflow/workflowPersistence.d.ts.map +1 -0
- package/dist/src/workflow/workflowPersistence.js +144 -0
- package/dist/src/workflow/workflowPersistence.js.map +1 -0
- package/dist/src/workflow/workflowScriptRuntime.d.ts +22 -0
- package/dist/src/workflow/workflowScriptRuntime.d.ts.map +1 -0
- package/dist/src/workflow/workflowScriptRuntime.js +655 -0
- package/dist/src/workflow/workflowScriptRuntime.js.map +1 -0
- package/dist/src/worktree/worktreeHooks.d.ts +38 -0
- package/dist/src/worktree/worktreeHooks.d.ts.map +1 -0
- package/dist/src/worktree/worktreeHooks.js +82 -0
- package/dist/src/worktree/worktreeHooks.js.map +1 -0
- package/dist/src/worktree/worktreeInclude.d.ts +11 -0
- package/dist/src/worktree/worktreeInclude.d.ts.map +1 -0
- package/dist/src/worktree/worktreeInclude.js +65 -0
- package/dist/src/worktree/worktreeInclude.js.map +1 -0
- package/dist/src/worktree/worktreeService.d.ts +43 -0
- package/dist/src/worktree/worktreeService.d.ts.map +1 -0
- package/dist/src/worktree/worktreeService.js +356 -0
- package/dist/src/worktree/worktreeService.js.map +1 -0
- package/package.json +2 -24
|
@@ -23,7 +23,7 @@ import { createGitWorktreeWorkspace, } from '../workspace/actoviqWorkspace.js';
|
|
|
23
23
|
import { ActoviqAgentsApi, createActoviqTaskTool, summarizeActoviqAgentDefinition, } from './actoviqAgents.js';
|
|
24
24
|
import { getDefaultActoviqAgents } from './defaultActoviqAgents.js';
|
|
25
25
|
import { loadActoviqAgentDefinitions } from './actoviqAgentDefinitions.js';
|
|
26
|
-
import { ActoviqSkillsApi, loadActoviqSkillDefinitions, resolveActoviqSkillPrompt, summarizeActoviqSkillDefinition, } from './actoviqSkills.js';
|
|
26
|
+
import { ActoviqSkillsApi, loadActoviqSkillDefinitions, resolveActoviqSkillPrompt, skillPathsMatch, summarizeActoviqSkillDefinition, } from './actoviqSkills.js';
|
|
27
27
|
import { ActoviqBackgroundTaskManager, ActoviqBackgroundTasksApi, } from './actoviqBackgroundTasks.js';
|
|
28
28
|
import { ActoviqContextApi, ActoviqSlashCommandsApi, } from './actoviqSlashCommands.js';
|
|
29
29
|
import { compactActoviqSession, getPersistedActoviqCompactHistory, getPersistedActoviqCompactState, isActoviqPromptTooLongError, recordActoviqLoopCompactionsOnSession, trackRecentFile, trackRecentSkill, } from './actoviqCompact.js';
|
|
@@ -371,6 +371,8 @@ export class ActoviqAgentClient {
|
|
|
371
371
|
sessionManager;
|
|
372
372
|
agentDefinitions;
|
|
373
373
|
skillDefinitions;
|
|
374
|
+
/** Names of `paths:`-conditional skills activated by touching matching files. */
|
|
375
|
+
activatedConditionalSkills = new Set();
|
|
374
376
|
pendingDelegations = new Map();
|
|
375
377
|
pendingRuntimeNotifications = new Map();
|
|
376
378
|
subagentInputQueues = new Map();
|
|
@@ -705,6 +707,17 @@ export class ActoviqAgentClient {
|
|
|
705
707
|
async maybeAutoDream(options = {}) {
|
|
706
708
|
return this.dream.maybeAutoDream(options);
|
|
707
709
|
}
|
|
710
|
+
// ── v0.5.0: Model Team ──────────────────────────────────────────
|
|
711
|
+
/**
|
|
712
|
+
* Create a multi-model team for collaborative deliberation.
|
|
713
|
+
* Supports panel-analysis and reviewer modes (`panel`/`analysis`/
|
|
714
|
+
* `executor-reviewer` are backward-compatible aliases). Model routing lives
|
|
715
|
+
* separately under the /model router layer.
|
|
716
|
+
*/
|
|
717
|
+
async createTeam(definition) {
|
|
718
|
+
const { createModelTeam } = await import('../team/modelTeam.js');
|
|
719
|
+
return createModelTeam(definition);
|
|
720
|
+
}
|
|
708
721
|
async close() {
|
|
709
722
|
const errors = [];
|
|
710
723
|
try {
|
|
@@ -763,6 +776,47 @@ export class ActoviqAgentClient {
|
|
|
763
776
|
listSkillDefinitions() {
|
|
764
777
|
return [...this.skillDefinitions.values()].map(summarizeActoviqSkillDefinition);
|
|
765
778
|
}
|
|
779
|
+
/**
|
|
780
|
+
* Activate `paths:`-conditional skills whose patterns match any of the given
|
|
781
|
+
* (cwd-relative or absolute) file paths. Activated skills become visible to
|
|
782
|
+
* the model on the next request — matching claude-code's conditional skills.
|
|
783
|
+
*/
|
|
784
|
+
activateConditionalSkillsForPaths(filePaths) {
|
|
785
|
+
if (filePaths.length === 0) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
for (const definition of this.skillDefinitions.values()) {
|
|
789
|
+
if (!definition.paths?.length || this.activatedConditionalSkills.has(definition.name)) {
|
|
790
|
+
continue;
|
|
791
|
+
}
|
|
792
|
+
for (const filePath of filePaths) {
|
|
793
|
+
const rel = path.isAbsolute(filePath)
|
|
794
|
+
? path.relative(this.config.workDir, filePath)
|
|
795
|
+
: filePath;
|
|
796
|
+
const normalized = rel.replace(/\\/gu, '/');
|
|
797
|
+
if (!normalized || normalized.startsWith('..')) {
|
|
798
|
+
continue;
|
|
799
|
+
}
|
|
800
|
+
if (skillPathsMatch(definition.paths, normalized)) {
|
|
801
|
+
this.activatedConditionalSkills.add(definition.name);
|
|
802
|
+
break;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
activateConditionalSkillsFromEvent(event) {
|
|
808
|
+
if (event.type !== 'tool.call') {
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
const input = event.call?.input;
|
|
812
|
+
if (!isRecord(input)) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
const candidates = [input.file_path, input.path, input.notebook_path].filter((value) => typeof value === 'string' && value.length > 0);
|
|
816
|
+
if (candidates.length > 0) {
|
|
817
|
+
this.activateConditionalSkillsForPaths(candidates);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
766
820
|
getSkillDefinition(skillName) {
|
|
767
821
|
const definition = this.skillDefinitions.get(skillName);
|
|
768
822
|
return definition ? cloneSkillDefinition(definition) : undefined;
|
|
@@ -868,15 +922,29 @@ export class ActoviqAgentClient {
|
|
|
868
922
|
isReadOnly: () => true,
|
|
869
923
|
prompt: () => {
|
|
870
924
|
const names = this.listSkillDefinitions()
|
|
871
|
-
.filter((definition) => definition.disableModelInvocation !== true
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
925
|
+
.filter((definition) => definition.disableModelInvocation !== true &&
|
|
926
|
+
// Conditional (paths-gated) skills stay hidden until a matching
|
|
927
|
+
// file is touched, then appear on the next request.
|
|
928
|
+
(!definition.paths?.length ||
|
|
929
|
+
this.activatedConditionalSkills.has(definition.name)))
|
|
930
|
+
.map((definition) => {
|
|
931
|
+
const parts = [`- ${definition.name}`];
|
|
932
|
+
if (definition.description)
|
|
933
|
+
parts.push(`: ${definition.description}`);
|
|
934
|
+
if (definition.whenToUse)
|
|
935
|
+
parts.push(` (use when: ${definition.whenToUse})`);
|
|
936
|
+
if (definition.argumentHint)
|
|
937
|
+
parts.push(` [args: ${definition.argumentHint}]`);
|
|
938
|
+
return parts.join('');
|
|
939
|
+
});
|
|
875
940
|
if (names.length === 0) {
|
|
876
941
|
return '';
|
|
877
942
|
}
|
|
878
943
|
return [
|
|
879
|
-
'
|
|
944
|
+
'You can autonomously load a registered skill with the Skill tool whenever the current task',
|
|
945
|
+
'matches its purpose — decide for yourself from each skill\'s description and "use when" guidance',
|
|
946
|
+
'below, then call Skill({ skill, args? }) without waiting to be asked. Prefer a matching skill over',
|
|
947
|
+
'improvising when one applies.',
|
|
880
948
|
'Available skills:',
|
|
881
949
|
...names,
|
|
882
950
|
].join('\n');
|
|
@@ -1349,7 +1417,12 @@ export class ActoviqAgentClient {
|
|
|
1349
1417
|
...(augmentations?.metadata ?? {}),
|
|
1350
1418
|
...(options.metadata ?? {}),
|
|
1351
1419
|
};
|
|
1352
|
-
|
|
1420
|
+
// Resolve working directory: sessionWorkDir (from worktree) takes priority
|
|
1421
|
+
// unless inheritWorktree is explicitly false.
|
|
1422
|
+
const inheritWorktree = options.inheritWorktree !== false;
|
|
1423
|
+
const workDir = inheritWorktree
|
|
1424
|
+
? (options.__actoviqWorkDir ?? options.sessionWorkDir ?? options.workDir ?? this.config.workDir)
|
|
1425
|
+
: (options.__actoviqWorkDir ?? options.workDir ?? this.config.workDir);
|
|
1353
1426
|
const mergedTools = filterAgentTools(mergeUniqueByName(options.__actoviqUseDefaultTools === false ? [] : this.defaultTools, options.tools ?? []), options.__actoviqAllowedTools, options.__actoviqDisallowedTools);
|
|
1354
1427
|
// Collect tool prompts for system prompt assembly
|
|
1355
1428
|
const toolPromptParts = await collectToolPrompts(mergedTools, {
|
|
@@ -1398,9 +1471,15 @@ export class ActoviqAgentClient {
|
|
|
1398
1471
|
hooks: augmentations?.hooks,
|
|
1399
1472
|
drainQueuedInputs,
|
|
1400
1473
|
streaming,
|
|
1401
|
-
|
|
1474
|
+
// Activate paths-conditional skills when the agent touches matching files.
|
|
1475
|
+
emit: (event) => {
|
|
1476
|
+
this.activateConditionalSkillsFromEvent(event);
|
|
1477
|
+
emit?.(event);
|
|
1478
|
+
},
|
|
1402
1479
|
skipRunStartedEvent,
|
|
1403
|
-
|
|
1480
|
+
// Per-run model client override (the /model router uses this to route a
|
|
1481
|
+
// turn to a different model/provider); falls back to the SDK default.
|
|
1482
|
+
modelApi: options.modelApi ?? this.modelApi,
|
|
1404
1483
|
config: runtimeConfig,
|
|
1405
1484
|
mcpManager: this.mcpManager,
|
|
1406
1485
|
}).then(result => ({
|
|
@@ -2589,6 +2668,7 @@ export class ActoviqAgentClient {
|
|
|
2589
2668
|
return {
|
|
2590
2669
|
...options,
|
|
2591
2670
|
model: options.model ?? definition.model,
|
|
2671
|
+
effort: options.effort ?? definition.effort,
|
|
2592
2672
|
metadata: {
|
|
2593
2673
|
...(definition.metadata ?? {}),
|
|
2594
2674
|
...(options.metadata ?? {}),
|