deepclause-sdk 0.0.77 → 0.0.79
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.md +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +4 -1
- package/dist/agent.js.map +1 -1
- package/dist/cli/config.d.ts +108 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +30 -2
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/index.js +149 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/run.d.ts +9 -0
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +9 -1
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/tui.d.ts.map +1 -1
- package/dist/cli/tui.js +21 -4
- package/dist/cli/tui.js.map +1 -1
- package/dist/compaction.d.ts +6 -1
- package/dist/compaction.d.ts.map +1 -1
- package/dist/compaction.js +16 -5
- package/dist/compaction.js.map +1 -1
- package/dist/compiler.d.ts +3 -1
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +34 -8
- package/dist/compiler.js.map +1 -1
- package/dist/prolog/bridge.d.ts +9 -3
- package/dist/prolog/bridge.d.ts.map +1 -1
- package/dist/prolog/bridge.js +15 -5
- package/dist/prolog/bridge.js.map +1 -1
- package/dist/prolog-src/deepclause_mi.pl +92 -6
- package/dist/runner.d.ts +4 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +89 -13
- package/dist/runner.js.map +1 -1
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +3 -0
- package/dist/sdk.js.map +1 -1
- package/dist/system/assets/compactors/default-loop-compactor.dml +17 -4
- package/dist/system/assets/model-database.json +64 -0
- package/dist/system/assets/skills/plan.dml +178 -18
- package/dist/system/config/model-database.d.ts +37 -0
- package/dist/system/config/model-database.d.ts.map +1 -0
- package/dist/system/config/model-database.js +69 -0
- package/dist/system/config/model-database.js.map +1 -0
- package/dist/system/config/model-slots.d.ts +16 -0
- package/dist/system/config/model-slots.d.ts.map +1 -1
- package/dist/system/config/model-slots.js +15 -0
- package/dist/system/config/model-slots.js.map +1 -1
- package/dist/system/runtime/conductor.d.ts.map +1 -1
- package/dist/system/runtime/conductor.js +19 -1
- package/dist/system/runtime/conductor.js.map +1 -1
- package/dist/system/runtime/dml-executor.d.ts +2 -0
- package/dist/system/runtime/dml-executor.d.ts.map +1 -1
- package/dist/system/runtime/dml-executor.js +20 -2
- package/dist/system/runtime/dml-executor.js.map +1 -1
- package/dist/system/runtime/skill-creator.js +1 -1
- package/dist/system/runtime/skill-creator.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/prolog-src/deepclause_mi.pl +92 -6
|
@@ -558,11 +558,14 @@ process_engine_result(output(Text), output, Text, none) :- !.
|
|
|
558
558
|
process_engine_result(log(Text), log, Text, none) :- !.
|
|
559
559
|
process_engine_result(answer(Text), answer, Text, none) :- !.
|
|
560
560
|
%% Note: Memory and tool scope are now passed in the payload for the agent loop
|
|
561
|
+
process_engine_result(request_agent_loop(Desc, Vars, Tools, Memory, ToolScope, ReasoningEffort, RecipeContext), request_agent_loop, '',
|
|
562
|
+
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: ToolScope, reasoningEffort: ReasoningEffort, recipeContext: RecipeContext}) :- !.
|
|
563
|
+
%% Legacy 5-arg format (no reasoning/recipe)
|
|
561
564
|
process_engine_result(request_agent_loop(Desc, Vars, Tools, Memory, ToolScope), request_agent_loop, '',
|
|
562
|
-
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: ToolScope}) :- !.
|
|
565
|
+
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: ToolScope, reasoningEffort: none, recipeContext: ""}) :- !.
|
|
563
566
|
%% Legacy 4-arg format (no tool scope)
|
|
564
567
|
process_engine_result(request_agent_loop(Desc, Vars, Tools, Memory), request_agent_loop, '',
|
|
565
|
-
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: none}) :- !.
|
|
568
|
+
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: none, reasoningEffort: none, recipeContext: ""}) :- !.
|
|
566
569
|
process_engine_result(request_exec(Tool, Args), request_exec, '',
|
|
567
570
|
payload{toolName: Tool, args: Args}) :- !.
|
|
568
571
|
process_engine_result(request_sample_token(Prompt, Allowed), request_sample_token, '',
|
|
@@ -746,6 +749,60 @@ clear_tool_scope(StateIn, StateOut) :-
|
|
|
746
749
|
; StateOut = StateIn
|
|
747
750
|
).
|
|
748
751
|
|
|
752
|
+
%% ============================================================
|
|
753
|
+
%% Reasoning Effort Helpers
|
|
754
|
+
%% ============================================================
|
|
755
|
+
|
|
756
|
+
%% set_reasoning_effort_state(+StateIn, +Effort, -StateOut)
|
|
757
|
+
set_reasoning_effort_state(StateIn, Effort, StateOut) :-
|
|
758
|
+
StateOut = StateIn.put(reasoning_effort, Effort).
|
|
759
|
+
|
|
760
|
+
%% clear_reasoning_effort_state(+StateIn, -StateOut)
|
|
761
|
+
clear_reasoning_effort_state(StateIn, StateOut) :-
|
|
762
|
+
( get_dict(reasoning_effort, StateIn, _)
|
|
763
|
+
-> del_dict(reasoning_effort, StateIn, _, StateOut)
|
|
764
|
+
; StateOut = StateIn
|
|
765
|
+
).
|
|
766
|
+
|
|
767
|
+
%% get_reasoning_effort(+State, -Effort)
|
|
768
|
+
get_reasoning_effort(State, Effort) :-
|
|
769
|
+
( get_dict(reasoning_effort, State, Effort)
|
|
770
|
+
-> true
|
|
771
|
+
; Effort = none
|
|
772
|
+
).
|
|
773
|
+
|
|
774
|
+
%% ============================================================
|
|
775
|
+
%% Recipe Context Helpers
|
|
776
|
+
%% ============================================================
|
|
777
|
+
|
|
778
|
+
%% load_recipe_content(+Query, -Content)
|
|
779
|
+
load_recipe_content(Query, RecipeContent) :-
|
|
780
|
+
exec(consult_recipes(query: Query, max_results: 1), Result),
|
|
781
|
+
get_dict(matches, Result, Matches),
|
|
782
|
+
( Matches = [Match|_]
|
|
783
|
+
-> get_dict(content, Match, RecipeContent)
|
|
784
|
+
; RecipeContent = ""
|
|
785
|
+
).
|
|
786
|
+
|
|
787
|
+
%% set_recipe_context(+StateIn, +Content, -StateOut)
|
|
788
|
+
set_recipe_context(StateIn, "", StateIn) :- !.
|
|
789
|
+
set_recipe_context(StateIn, Content, StateOut) :-
|
|
790
|
+
StateOut = StateIn.put(recipe_context, Content).
|
|
791
|
+
|
|
792
|
+
%% clear_recipe_context(+StateIn, -StateOut)
|
|
793
|
+
clear_recipe_context(StateIn, StateOut) :-
|
|
794
|
+
( get_dict(recipe_context, StateIn, _)
|
|
795
|
+
-> del_dict(recipe_context, StateIn, _, StateOut)
|
|
796
|
+
; StateOut = StateIn
|
|
797
|
+
).
|
|
798
|
+
|
|
799
|
+
%% get_recipe_context(+State, -Context)
|
|
800
|
+
get_recipe_context(State, Context) :-
|
|
801
|
+
( get_dict(recipe_context, State, Context)
|
|
802
|
+
-> true
|
|
803
|
+
; Context = ""
|
|
804
|
+
).
|
|
805
|
+
|
|
749
806
|
%% ============================================================
|
|
750
807
|
%% Trace Helpers
|
|
751
808
|
%% ============================================================
|
|
@@ -981,11 +1038,14 @@ process_tool_engine_result(request_sample_token(Prompt, Allowed), request_sample
|
|
|
981
1038
|
payload{prompt: Prompt, allowedTokens: Allowed}) :- !.
|
|
982
1039
|
process_tool_engine_result(request_llm(Messages), request_llm, '',
|
|
983
1040
|
payload{messages: Messages}) :- !.
|
|
1041
|
+
process_tool_engine_result(request_agent_loop(Desc, Vars, Tools, Memory, ToolScope, ReasoningEffort, RecipeContext), request_agent_loop, '',
|
|
1042
|
+
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: ToolScope, reasoningEffort: ReasoningEffort, recipeContext: RecipeContext}) :- !.
|
|
1043
|
+
%% Legacy 5-arg format (no reasoning/recipe)
|
|
984
1044
|
process_tool_engine_result(request_agent_loop(Desc, Vars, Tools, Memory, ToolScope), request_agent_loop, '',
|
|
985
|
-
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: ToolScope}) :- !.
|
|
1045
|
+
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: ToolScope, reasoningEffort: none, recipeContext: ""}) :- !.
|
|
986
1046
|
%% Legacy 4-arg format (no tool scope)
|
|
987
1047
|
process_tool_engine_result(request_agent_loop(Desc, Vars, Tools, Memory), request_agent_loop, '',
|
|
988
|
-
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: none}) :- !.
|
|
1048
|
+
payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: none, reasoningEffort: none, recipeContext: ""}) :- !.
|
|
989
1049
|
process_tool_engine_result(output(Text), output, Text, none) :- !.
|
|
990
1050
|
process_tool_engine_result(log(Text), log, Text, none) :- !.
|
|
991
1051
|
process_tool_engine_result(Other, error, Msg, none) :-
|
|
@@ -1084,8 +1144,10 @@ mi_call(task(Desc), StateIn, StateOut) :-
|
|
|
1084
1144
|
collect_user_tools(SessionId, UserTools),
|
|
1085
1145
|
get_memory(StateIn, Memory),
|
|
1086
1146
|
get_tool_scope(StateIn, ToolScope),
|
|
1147
|
+
get_reasoning_effort(StateIn, ReasoningEffort),
|
|
1148
|
+
get_recipe_context(StateIn, RecipeContext),
|
|
1087
1149
|
% Yield request with current memory and tool scope
|
|
1088
|
-
engine_yield(request_agent_loop(InterpDesc, [], UserTools, Memory, ToolScope)),
|
|
1150
|
+
engine_yield(request_agent_loop(InterpDesc, [], UserTools, Memory, ToolScope, ReasoningEffort, RecipeContext)),
|
|
1089
1151
|
% Handle signals (tool calls) until agent_done
|
|
1090
1152
|
handle_agent_signals(SessionId, StateIn, StateAfterAgent),
|
|
1091
1153
|
session_agent_result(SessionId, Result),
|
|
@@ -1297,7 +1359,9 @@ mi_call_task_n(Desc, Vars, VarNames, StateIn, StateOut) :-
|
|
|
1297
1359
|
collect_user_tools(SessionId, UserTools),
|
|
1298
1360
|
get_memory(StateIn, Memory),
|
|
1299
1361
|
get_tool_scope(StateIn, ToolScope),
|
|
1300
|
-
|
|
1362
|
+
get_reasoning_effort(StateIn, ReasoningEffort),
|
|
1363
|
+
get_recipe_context(StateIn, RecipeContext),
|
|
1364
|
+
engine_yield(request_agent_loop(InterpDesc, VarNames, UserTools, Memory, ToolScope, ReasoningEffort, RecipeContext)),
|
|
1301
1365
|
% Handle signals (tool calls) until agent_done
|
|
1302
1366
|
handle_agent_signals(SessionId, StateIn, StateAfterAgent),
|
|
1303
1367
|
session_agent_result(SessionId, Result),
|
|
@@ -1403,6 +1467,24 @@ mi_call(without_tools(ToolList, Goal), StateIn, StateOut) :-
|
|
|
1403
1467
|
mi_call(Goal, ScopedState, StateWithScope),
|
|
1404
1468
|
clear_tool_scope(StateWithScope, StateOut).
|
|
1405
1469
|
|
|
1470
|
+
%% mi_call(with_reasoning(Goal, Effort), +StateIn, -StateOut)
|
|
1471
|
+
%% Run Goal with a specific reasoning effort level (none/low/medium/high).
|
|
1472
|
+
%% The effort is passed to the TypeScript runner via request_agent_loop.
|
|
1473
|
+
mi_call(with_reasoning(Goal, Effort), StateIn, StateOut) :-
|
|
1474
|
+
!,
|
|
1475
|
+
set_reasoning_effort_state(StateIn, Effort, ScopedState),
|
|
1476
|
+
mi_call(Goal, ScopedState, StateWithScope),
|
|
1477
|
+
clear_reasoning_effort_state(StateWithScope, StateOut).
|
|
1478
|
+
|
|
1479
|
+
%% mi_call(with_recipe(Goal, Query), +StateIn, -StateOut)
|
|
1480
|
+
%% Run Goal with a recipe loaded as transient context (not persisted to memory).
|
|
1481
|
+
mi_call(with_recipe(Goal, Query), StateIn, StateOut) :-
|
|
1482
|
+
!,
|
|
1483
|
+
load_recipe_content(Query, RecipeContent),
|
|
1484
|
+
set_recipe_context(StateIn, RecipeContent, ScopedState),
|
|
1485
|
+
mi_call(Goal, ScopedState, StateWithRecipe),
|
|
1486
|
+
clear_recipe_context(StateWithRecipe, StateOut).
|
|
1487
|
+
|
|
1406
1488
|
%% ============================================================
|
|
1407
1489
|
%% Memory Predicates - NOW BACKTRACKABLE VIA STATE!
|
|
1408
1490
|
%% ============================================================
|
|
@@ -2093,6 +2175,10 @@ is_mi_special_predicate(llm(_,_)).
|
|
|
2093
2175
|
%% Tool scoping predicates
|
|
2094
2176
|
is_mi_special_predicate(with_tools(_,_)).
|
|
2095
2177
|
is_mi_special_predicate(without_tools(_,_)).
|
|
2178
|
+
%% Reasoning effort scoping
|
|
2179
|
+
is_mi_special_predicate(with_reasoning(_,_)).
|
|
2180
|
+
%% Recipe context scoping
|
|
2181
|
+
is_mi_special_predicate(with_recipe(_,_)).
|
|
2096
2182
|
%% Context stack management
|
|
2097
2183
|
is_mi_special_predicate(get_memory(_)).
|
|
2098
2184
|
is_mi_special_predicate(push_context).
|