@almadar/std 3.14.0 → 4.0.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/behaviors/exports/atoms/std-agent-activity-log.orb +11 -3
- package/behaviors/exports/atoms/std-agent-step-progress.orb +162 -23
- package/behaviors/exports/atoms/std-agent-tool-call.orb +0 -499
- package/behaviors/exports/molecules/std-agent-fix-loop.orb +166 -22
- package/behaviors/exports/molecules/std-agent-learner.orb +10 -549
- package/behaviors/exports/molecules/std-agent-planner.orb +5 -529
- package/behaviors/exports/molecules/std-agent-tool-loop.orb +162 -571
- package/behaviors/exports/organisms/std-agent-builder.orb +892 -1453
- package/behaviors/exports/organisms/std-agent-pipeline.orb +798 -1503
- package/behaviors/exports/validation-report.json +0 -1304
- package/dist/behaviors/behaviors-registry.json +26 -1
- package/dist/behaviors/exports/atoms/std-agent-activity-log.orb +11 -3
- package/dist/behaviors/exports/atoms/std-agent-step-progress.orb +162 -23
- package/dist/behaviors/exports/atoms/std-agent-tool-call.orb +0 -499
- package/dist/behaviors/exports/molecules/std-agent-fix-loop.orb +166 -22
- package/dist/behaviors/exports/molecules/std-agent-learner.orb +10 -549
- package/dist/behaviors/exports/molecules/std-agent-planner.orb +5 -529
- package/dist/behaviors/exports/molecules/std-agent-tool-loop.orb +162 -571
- package/dist/behaviors/exports/organisms/std-agent-builder.orb +892 -1453
- package/dist/behaviors/exports/organisms/std-agent-pipeline.orb +798 -1503
- package/dist/behaviors/exports/validation-report.json +0 -1304
- package/dist/behaviors/exports-reader.js +257 -302
- package/dist/behaviors/exports-reader.js.map +1 -1
- package/dist/behaviors/functions/index.js +257 -302
- package/dist/behaviors/functions/index.js.map +1 -1
- package/dist/behaviors/index.js +257 -302
- package/dist/behaviors/index.js.map +1 -1
- package/dist/behaviors/query.js +257 -302
- package/dist/behaviors/query.js.map +1 -1
- package/dist/behaviors-registry.json +26 -1
- package/dist/exports/atoms/std-agent-activity-log.orb +11 -3
- package/dist/exports/atoms/std-agent-step-progress.orb +162 -23
- package/dist/exports/atoms/std-agent-tool-call.orb +0 -499
- package/dist/exports/molecules/std-agent-fix-loop.orb +166 -22
- package/dist/exports/molecules/std-agent-learner.orb +10 -549
- package/dist/exports/molecules/std-agent-planner.orb +5 -529
- package/dist/exports/molecules/std-agent-tool-loop.orb +162 -571
- package/dist/exports/organisms/std-agent-builder.orb +892 -1453
- package/dist/exports/organisms/std-agent-pipeline.orb +798 -1503
- package/dist/exports/validation-report.json +0 -1304
- package/dist/index.d.ts +2 -2
- package/dist/index.js +362 -305
- package/dist/index.js.map +1 -1
- package/dist/modules/agent.d.ts +1 -1
- package/dist/modules/array.d.ts +1 -1
- package/dist/modules/async.d.ts +1 -1
- package/dist/modules/composition.d.ts +27 -0
- package/dist/modules/composition.js +98 -0
- package/dist/modules/composition.js.map +1 -0
- package/dist/modules/contract.d.ts +1 -1
- package/dist/modules/data.d.ts +1 -1
- package/dist/modules/format.d.ts +1 -1
- package/dist/modules/graph.d.ts +1 -1
- package/dist/modules/index.d.ts +2 -1
- package/dist/modules/index.js +96 -1
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/math.d.ts +1 -1
- package/dist/modules/nn.d.ts +1 -1
- package/dist/modules/object.d.ts +1 -1
- package/dist/modules/os.d.ts +1 -1
- package/dist/modules/prob.d.ts +1 -1
- package/dist/modules/str.d.ts +1 -1
- package/dist/modules/tensor.d.ts +1 -1
- package/dist/modules/time.d.ts +1 -1
- package/dist/modules/train.d.ts +1 -1
- package/dist/modules/validate.d.ts +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.js +98 -3
- package/dist/registry.js.map +1 -1
- package/dist/{types-BjP5nVQd.d.ts → types-BGtQuBge.d.ts} +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,7 +25,8 @@ var STD_MODULES = [
|
|
|
25
25
|
"agent",
|
|
26
26
|
"graph",
|
|
27
27
|
"contract",
|
|
28
|
-
"data"
|
|
28
|
+
"data",
|
|
29
|
+
"composition"
|
|
29
30
|
];
|
|
30
31
|
var STD_OPERATOR_CATEGORIES = [
|
|
31
32
|
"std-math",
|
|
@@ -42,6 +43,7 @@ var STD_OPERATOR_CATEGORIES = [
|
|
|
42
43
|
"std-prob",
|
|
43
44
|
"std-os",
|
|
44
45
|
"std-agent",
|
|
46
|
+
"std-composition",
|
|
45
47
|
"ml-arch",
|
|
46
48
|
"ml-effect",
|
|
47
49
|
"ml-tensor",
|
|
@@ -3841,6 +3843,98 @@ var AGENT_OPERATORS = {
|
|
|
3841
3843
|
}
|
|
3842
3844
|
};
|
|
3843
3845
|
|
|
3846
|
+
// modules/composition.ts
|
|
3847
|
+
var COMPOSITION_OPERATORS = {
|
|
3848
|
+
"behavior/compose": {
|
|
3849
|
+
module: "composition",
|
|
3850
|
+
category: "std-composition",
|
|
3851
|
+
minArity: 1,
|
|
3852
|
+
maxArity: 1,
|
|
3853
|
+
description: "Compose N orbitals into one application schema. Wires events, picks layout, generates pages.",
|
|
3854
|
+
hasSideEffects: false,
|
|
3855
|
+
compileTime: true,
|
|
3856
|
+
returnType: "object",
|
|
3857
|
+
params: [
|
|
3858
|
+
{
|
|
3859
|
+
name: "config",
|
|
3860
|
+
type: "object",
|
|
3861
|
+
description: "ComposeBehaviorsInput: { appName, orbitals[], layoutStrategy?, eventWiring?, entityMappings? }"
|
|
3862
|
+
}
|
|
3863
|
+
],
|
|
3864
|
+
example: '(behavior/compose { appName: "ShoppingApp" orbitals: [...] })'
|
|
3865
|
+
},
|
|
3866
|
+
"behavior/wire": {
|
|
3867
|
+
module: "composition",
|
|
3868
|
+
category: "std-composition",
|
|
3869
|
+
minArity: 2,
|
|
3870
|
+
maxArity: 2,
|
|
3871
|
+
description: "Apply cross-orbital event wiring. Adds external emits/listens to inline traits.",
|
|
3872
|
+
hasSideEffects: false,
|
|
3873
|
+
compileTime: true,
|
|
3874
|
+
returnType: "array",
|
|
3875
|
+
params: [
|
|
3876
|
+
{
|
|
3877
|
+
name: "orbitals",
|
|
3878
|
+
type: "array",
|
|
3879
|
+
description: "Array of OrbitalDefinition to wire"
|
|
3880
|
+
},
|
|
3881
|
+
{
|
|
3882
|
+
name: "wiring",
|
|
3883
|
+
type: "array",
|
|
3884
|
+
description: "Array of EventWiringEntry { from, event, to, triggers }"
|
|
3885
|
+
}
|
|
3886
|
+
],
|
|
3887
|
+
example: "(behavior/wire orbitals wiring)"
|
|
3888
|
+
},
|
|
3889
|
+
"behavior/detect-layout": {
|
|
3890
|
+
module: "composition",
|
|
3891
|
+
category: "std-composition",
|
|
3892
|
+
minArity: 1,
|
|
3893
|
+
maxArity: 2,
|
|
3894
|
+
description: "Auto-detect layout from orbital count and wiring topology. Returns single, tabs, sidebar, dashboard, or wizard-flow.",
|
|
3895
|
+
hasSideEffects: false,
|
|
3896
|
+
compileTime: true,
|
|
3897
|
+
returnType: "string",
|
|
3898
|
+
params: [
|
|
3899
|
+
{
|
|
3900
|
+
name: "orbitals",
|
|
3901
|
+
type: "array",
|
|
3902
|
+
description: "Array of OrbitalDefinition"
|
|
3903
|
+
},
|
|
3904
|
+
{
|
|
3905
|
+
name: "wiring",
|
|
3906
|
+
type: "array",
|
|
3907
|
+
description: "Optional EventWiringEntry array",
|
|
3908
|
+
optional: true
|
|
3909
|
+
}
|
|
3910
|
+
],
|
|
3911
|
+
example: "(behavior/detect-layout orbitals)"
|
|
3912
|
+
},
|
|
3913
|
+
"behavior/pipe": {
|
|
3914
|
+
module: "composition",
|
|
3915
|
+
category: "std-composition",
|
|
3916
|
+
minArity: 2,
|
|
3917
|
+
maxArity: null,
|
|
3918
|
+
description: "Left-to-right composition. Each step receives the previous result as its first arg.",
|
|
3919
|
+
hasSideEffects: false,
|
|
3920
|
+
compileTime: true,
|
|
3921
|
+
returnType: "any",
|
|
3922
|
+
params: [
|
|
3923
|
+
{
|
|
3924
|
+
name: "seed",
|
|
3925
|
+
type: "any",
|
|
3926
|
+
description: "Initial value to pipe through steps"
|
|
3927
|
+
},
|
|
3928
|
+
{
|
|
3929
|
+
name: "...steps",
|
|
3930
|
+
type: "function[]",
|
|
3931
|
+
description: "Functions, each receiving the previous result as first argument"
|
|
3932
|
+
}
|
|
3933
|
+
],
|
|
3934
|
+
example: '(behavior/pipe orbitals (behavior/wire wiring) (behavior/compose { appName: "X" }))'
|
|
3935
|
+
}
|
|
3936
|
+
};
|
|
3937
|
+
|
|
3844
3938
|
// registry.ts
|
|
3845
3939
|
var STD_OPERATORS = {
|
|
3846
3940
|
...MATH_OPERATORS,
|
|
@@ -3856,7 +3950,8 @@ var STD_OPERATORS = {
|
|
|
3856
3950
|
...TRAIN_OPERATORS,
|
|
3857
3951
|
...PROB_OPERATORS,
|
|
3858
3952
|
...OS_OPERATORS,
|
|
3859
|
-
...AGENT_OPERATORS
|
|
3953
|
+
...AGENT_OPERATORS,
|
|
3954
|
+
...COMPOSITION_OPERATORS
|
|
3860
3955
|
};
|
|
3861
3956
|
var STD_OPERATORS_BY_MODULE = {
|
|
3862
3957
|
math: MATH_OPERATORS,
|
|
@@ -3872,7 +3967,8 @@ var STD_OPERATORS_BY_MODULE = {
|
|
|
3872
3967
|
train: TRAIN_OPERATORS,
|
|
3873
3968
|
prob: PROB_OPERATORS,
|
|
3874
3969
|
os: OS_OPERATORS,
|
|
3875
|
-
agent: AGENT_OPERATORS
|
|
3970
|
+
agent: AGENT_OPERATORS,
|
|
3971
|
+
composition: COMPOSITION_OPERATORS
|
|
3876
3972
|
};
|
|
3877
3973
|
function getStdOperatorMeta(operator) {
|
|
3878
3974
|
return STD_OPERATORS[operator];
|
|
@@ -24876,187 +24972,9 @@ function stdAgentCompletion(params = {}) {
|
|
|
24876
24972
|
};
|
|
24877
24973
|
return makeOrbital(`${c.entityName}Orbital`, entity, [modalTrait, notifTrait, agentTrait], [page]);
|
|
24878
24974
|
}
|
|
24879
|
-
function resolve92(params) {
|
|
24880
|
-
const entityName = params.entityName ?? "ActivityEntry";
|
|
24881
|
-
const p = plural(entityName);
|
|
24882
|
-
const requiredFields = [
|
|
24883
|
-
{ name: "action", type: "string", default: "" },
|
|
24884
|
-
{ name: "detail", type: "string", default: "" },
|
|
24885
|
-
{ name: "status", type: "string", default: "pending" },
|
|
24886
|
-
{ name: "timestamp", type: "string", default: "" },
|
|
24887
|
-
{ name: "duration", type: "number", default: 0 }
|
|
24888
|
-
];
|
|
24889
|
-
const baseFields = params.fields ?? [];
|
|
24890
|
-
const existingNames = new Set(baseFields.map((f) => f.name));
|
|
24891
|
-
const mergedFields = [
|
|
24892
|
-
...baseFields,
|
|
24893
|
-
...requiredFields.filter((f) => !existingNames.has(f.name))
|
|
24894
|
-
];
|
|
24895
|
-
const fields = ensureIdField(mergedFields);
|
|
24896
|
-
return {
|
|
24897
|
-
entityName,
|
|
24898
|
-
fields,
|
|
24899
|
-
persistence: params.persistence ?? "persistent",
|
|
24900
|
-
traitName: `${entityName}Log`,
|
|
24901
|
-
pluralName: p,
|
|
24902
|
-
pageName: params.pageName ?? `${entityName}Page`,
|
|
24903
|
-
pagePath: params.pagePath ?? `/${p.toLowerCase()}`,
|
|
24904
|
-
isInitial: params.isInitial ?? false
|
|
24905
|
-
};
|
|
24906
|
-
}
|
|
24907
|
-
function buildEntity78(c) {
|
|
24908
|
-
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
24909
|
-
}
|
|
24910
|
-
function buildTrait71(c) {
|
|
24911
|
-
const { entityName } = c;
|
|
24912
|
-
const loggingUI = {
|
|
24913
|
-
type: "stack",
|
|
24914
|
-
direction: "vertical",
|
|
24915
|
-
gap: "lg",
|
|
24916
|
-
children: [
|
|
24917
|
-
{
|
|
24918
|
-
type: "stack",
|
|
24919
|
-
direction: "horizontal",
|
|
24920
|
-
gap: "sm",
|
|
24921
|
-
justify: "space-between",
|
|
24922
|
-
align: "center",
|
|
24923
|
-
children: [
|
|
24924
|
-
{
|
|
24925
|
-
type: "stack",
|
|
24926
|
-
direction: "horizontal",
|
|
24927
|
-
gap: "sm",
|
|
24928
|
-
align: "center",
|
|
24929
|
-
children: [
|
|
24930
|
-
{ type: "icon", name: "activity", size: "lg" },
|
|
24931
|
-
{ type: "typography", content: "Activity Log", variant: "h2" }
|
|
24932
|
-
]
|
|
24933
|
-
},
|
|
24934
|
-
{ type: "button", label: "Clear", event: "CLEAR", variant: "ghost", icon: "trash" }
|
|
24935
|
-
]
|
|
24936
|
-
},
|
|
24937
|
-
{ type: "divider" },
|
|
24938
|
-
{
|
|
24939
|
-
type: "timeline",
|
|
24940
|
-
entity: entityName,
|
|
24941
|
-
emptyIcon: "activity",
|
|
24942
|
-
emptyTitle: "No activity yet",
|
|
24943
|
-
emptyDescription: "Agent actions will appear here as they occur.",
|
|
24944
|
-
renderItem: ["fn", "item", {
|
|
24945
|
-
type: "stack",
|
|
24946
|
-
direction: "vertical",
|
|
24947
|
-
gap: "xs",
|
|
24948
|
-
children: [
|
|
24949
|
-
{
|
|
24950
|
-
type: "stack",
|
|
24951
|
-
direction: "horizontal",
|
|
24952
|
-
gap: "sm",
|
|
24953
|
-
align: "center",
|
|
24954
|
-
children: [
|
|
24955
|
-
{ type: "badge", label: "@item.status" },
|
|
24956
|
-
{ type: "typography", variant: "h4", content: "@item.action" }
|
|
24957
|
-
]
|
|
24958
|
-
},
|
|
24959
|
-
{ type: "typography", variant: "body", color: "muted", content: "@item.detail" },
|
|
24960
|
-
{
|
|
24961
|
-
type: "stack",
|
|
24962
|
-
direction: "horizontal",
|
|
24963
|
-
gap: "sm",
|
|
24964
|
-
align: "center",
|
|
24965
|
-
children: [
|
|
24966
|
-
{ type: "typography", variant: "caption", color: "muted", content: "@item.timestamp" },
|
|
24967
|
-
{ type: "badge", label: "@item.duration", variant: "outline" }
|
|
24968
|
-
]
|
|
24969
|
-
}
|
|
24970
|
-
]
|
|
24971
|
-
}]
|
|
24972
|
-
}
|
|
24973
|
-
]
|
|
24974
|
-
};
|
|
24975
|
-
return {
|
|
24976
|
-
name: c.traitName,
|
|
24977
|
-
linkedEntity: entityName,
|
|
24978
|
-
category: "interaction",
|
|
24979
|
-
emits: [
|
|
24980
|
-
{ event: "LOG_ENTRY", scope: "external", payload: [
|
|
24981
|
-
{ name: "action", type: "string" },
|
|
24982
|
-
{ name: "detail", type: "string" },
|
|
24983
|
-
{ name: "status", type: "string" }
|
|
24984
|
-
] }
|
|
24985
|
-
],
|
|
24986
|
-
listens: [
|
|
24987
|
-
{ event: "LOG_ENTRY", triggers: "LOG_ENTRY", scope: "external" }
|
|
24988
|
-
],
|
|
24989
|
-
stateMachine: {
|
|
24990
|
-
states: [
|
|
24991
|
-
{ name: "logging", isInitial: true }
|
|
24992
|
-
],
|
|
24993
|
-
events: [
|
|
24994
|
-
{ key: "INIT", name: "Initialize" },
|
|
24995
|
-
{ key: "LOG_ENTRY", name: "Log Entry", payload: [
|
|
24996
|
-
{ name: "action", type: "string", required: true },
|
|
24997
|
-
{ name: "detail", type: "string", required: true },
|
|
24998
|
-
{ name: "status", type: "string", required: true }
|
|
24999
|
-
] },
|
|
25000
|
-
{ key: "CLEAR", name: "Clear Log" }
|
|
25001
|
-
],
|
|
25002
|
-
transitions: [
|
|
25003
|
-
{
|
|
25004
|
-
from: "logging",
|
|
25005
|
-
to: "logging",
|
|
25006
|
-
event: "INIT",
|
|
25007
|
-
effects: [
|
|
25008
|
-
["fetch", entityName],
|
|
25009
|
-
["render-ui", "main", loggingUI]
|
|
25010
|
-
]
|
|
25011
|
-
},
|
|
25012
|
-
{
|
|
25013
|
-
from: "logging",
|
|
25014
|
-
to: "logging",
|
|
25015
|
-
event: "LOG_ENTRY",
|
|
25016
|
-
effects: [
|
|
25017
|
-
["persist", "create", entityName, {
|
|
25018
|
-
action: "@payload.action",
|
|
25019
|
-
detail: "@payload.detail",
|
|
25020
|
-
status: "@payload.status",
|
|
25021
|
-
timestamp: "@now"
|
|
25022
|
-
}],
|
|
25023
|
-
["fetch", entityName],
|
|
25024
|
-
["render-ui", "main", loggingUI]
|
|
25025
|
-
]
|
|
25026
|
-
},
|
|
25027
|
-
{
|
|
25028
|
-
from: "logging",
|
|
25029
|
-
to: "logging",
|
|
25030
|
-
event: "CLEAR",
|
|
25031
|
-
effects: [
|
|
25032
|
-
["persist", "delete", entityName],
|
|
25033
|
-
["fetch", entityName],
|
|
25034
|
-
["render-ui", "main", loggingUI]
|
|
25035
|
-
]
|
|
25036
|
-
}
|
|
25037
|
-
]
|
|
25038
|
-
}
|
|
25039
|
-
};
|
|
25040
|
-
}
|
|
25041
|
-
function buildPage72(c) {
|
|
25042
|
-
return makePage({ name: c.pageName, path: c.pagePath, traitName: c.traitName, isInitial: c.isInitial });
|
|
25043
|
-
}
|
|
25044
|
-
function stdAgentActivityLogEntity(params = {}) {
|
|
25045
|
-
return buildEntity78(resolve92(params));
|
|
25046
|
-
}
|
|
25047
|
-
function stdAgentActivityLogTrait(params = {}) {
|
|
25048
|
-
return buildTrait71(resolve92(params));
|
|
25049
|
-
}
|
|
25050
|
-
function stdAgentActivityLogPage(params = {}) {
|
|
25051
|
-
return buildPage72(resolve92(params));
|
|
25052
|
-
}
|
|
25053
|
-
function stdAgentActivityLog(params = {}) {
|
|
25054
|
-
const c = resolve92(params);
|
|
25055
|
-
return makeOrbital(`${c.entityName}Orbital`, buildEntity78(c), [buildTrait71(c)], [buildPage72(c)]);
|
|
25056
|
-
}
|
|
25057
24975
|
|
|
25058
24976
|
// behaviors/functions/molecules/std-agent-planner.ts
|
|
25059
|
-
function
|
|
24977
|
+
function resolve92(params) {
|
|
25060
24978
|
const entityName = params.entityName ?? "Plan";
|
|
25061
24979
|
const p = plural(entityName);
|
|
25062
24980
|
const requiredFields = [
|
|
@@ -25081,7 +24999,8 @@ function resolve93(params) {
|
|
|
25081
24999
|
{ name: "action", type: "string", default: "" },
|
|
25082
25000
|
{ name: "detail", type: "string", default: "" },
|
|
25083
25001
|
{ name: "timestamp", type: "string", default: "" },
|
|
25084
|
-
{ name: "duration", type: "number", default: 0 }
|
|
25002
|
+
{ name: "duration", type: "number", default: 0 },
|
|
25003
|
+
{ name: "icon", type: "string", default: "circle" }
|
|
25085
25004
|
];
|
|
25086
25005
|
const baseFields = ensureIdField(params.fields ?? []);
|
|
25087
25006
|
const userFieldNames = new Set(baseFields.map((f) => f.name));
|
|
@@ -25266,7 +25185,7 @@ function errorView2(_entityName) {
|
|
|
25266
25185
|
]
|
|
25267
25186
|
};
|
|
25268
25187
|
}
|
|
25269
|
-
function
|
|
25188
|
+
function buildTrait71(c) {
|
|
25270
25189
|
const { entityName, categories, memoryLimit } = c;
|
|
25271
25190
|
const categoryList = categories.join(", ");
|
|
25272
25191
|
return {
|
|
@@ -25449,17 +25368,17 @@ function buildTrait72(c) {
|
|
|
25449
25368
|
}
|
|
25450
25369
|
};
|
|
25451
25370
|
}
|
|
25452
|
-
function
|
|
25371
|
+
function buildEntity78(c) {
|
|
25453
25372
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
25454
25373
|
}
|
|
25455
25374
|
function stdAgentPlannerEntity(params) {
|
|
25456
|
-
return
|
|
25375
|
+
return buildEntity78(resolve92(params));
|
|
25457
25376
|
}
|
|
25458
25377
|
function stdAgentPlannerTrait(params) {
|
|
25459
|
-
return
|
|
25378
|
+
return buildTrait71(resolve92(params));
|
|
25460
25379
|
}
|
|
25461
25380
|
function stdAgentPlannerPage(params) {
|
|
25462
|
-
const c =
|
|
25381
|
+
const c = resolve92(params);
|
|
25463
25382
|
return {
|
|
25464
25383
|
name: c.pageName,
|
|
25465
25384
|
path: c.pagePath,
|
|
@@ -25467,7 +25386,6 @@ function stdAgentPlannerPage(params) {
|
|
|
25467
25386
|
traits: [
|
|
25468
25387
|
{ ref: c.traitName },
|
|
25469
25388
|
{ ref: "PlannerTaskInput" },
|
|
25470
|
-
{ ref: "PlannerActivityLog" },
|
|
25471
25389
|
{ ref: "PlannerClassifierFlow" },
|
|
25472
25390
|
{ ref: "PlannerCompletionFlow" },
|
|
25473
25391
|
{ ref: "PlannerMemoryLifecycle" }
|
|
@@ -25475,9 +25393,9 @@ function stdAgentPlannerPage(params) {
|
|
|
25475
25393
|
};
|
|
25476
25394
|
}
|
|
25477
25395
|
function stdAgentPlanner(params) {
|
|
25478
|
-
const c =
|
|
25396
|
+
const c = resolve92(params);
|
|
25479
25397
|
const { entityName, fields } = c;
|
|
25480
|
-
const plannerTrait =
|
|
25398
|
+
const plannerTrait = buildTrait71(c);
|
|
25481
25399
|
const classifierTrait = extractTrait(stdAgentClassifier({
|
|
25482
25400
|
entityName,
|
|
25483
25401
|
fields,
|
|
@@ -25538,18 +25456,6 @@ function stdAgentPlanner(params) {
|
|
|
25538
25456
|
saveEvent: "PLAN"
|
|
25539
25457
|
}));
|
|
25540
25458
|
modalTrait.name = "PlannerTaskInput";
|
|
25541
|
-
const activityLogTrait = extractTrait(stdAgentActivityLog({
|
|
25542
|
-
entityName,
|
|
25543
|
-
fields,
|
|
25544
|
-
persistence: "runtime"
|
|
25545
|
-
}));
|
|
25546
|
-
activityLogTrait.name = "PlannerActivityLog";
|
|
25547
|
-
activityLogTrait.listens = [];
|
|
25548
|
-
if (activityLogTrait.emits) {
|
|
25549
|
-
for (const e of activityLogTrait.emits) {
|
|
25550
|
-
e.scope = "internal";
|
|
25551
|
-
}
|
|
25552
|
-
}
|
|
25553
25459
|
const entity = makeEntity({ name: entityName, fields, persistence: c.persistence });
|
|
25554
25460
|
const page = {
|
|
25555
25461
|
name: c.pageName,
|
|
@@ -25558,7 +25464,6 @@ function stdAgentPlanner(params) {
|
|
|
25558
25464
|
traits: [
|
|
25559
25465
|
{ ref: plannerTrait.name },
|
|
25560
25466
|
{ ref: modalTrait.name },
|
|
25561
|
-
{ ref: activityLogTrait.name },
|
|
25562
25467
|
{ ref: classifierTrait.name },
|
|
25563
25468
|
{ ref: completionTrait.name },
|
|
25564
25469
|
{ ref: memoryTrait.name }
|
|
@@ -25567,11 +25472,11 @@ function stdAgentPlanner(params) {
|
|
|
25567
25472
|
return makeOrbital(
|
|
25568
25473
|
`${entityName}Orbital`,
|
|
25569
25474
|
entity,
|
|
25570
|
-
[plannerTrait, modalTrait,
|
|
25475
|
+
[plannerTrait, modalTrait, classifierTrait, completionTrait, memoryTrait],
|
|
25571
25476
|
[page]
|
|
25572
25477
|
);
|
|
25573
25478
|
}
|
|
25574
|
-
function
|
|
25479
|
+
function resolve93(params) {
|
|
25575
25480
|
const entityName = params.entityName ?? "ToolCall";
|
|
25576
25481
|
const p = plural(entityName);
|
|
25577
25482
|
const requiredFields = [
|
|
@@ -25602,7 +25507,7 @@ function resolve94(params) {
|
|
|
25602
25507
|
isInitial: params.isInitial ?? false
|
|
25603
25508
|
};
|
|
25604
25509
|
}
|
|
25605
|
-
function
|
|
25510
|
+
function buildEntity79(c) {
|
|
25606
25511
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
25607
25512
|
}
|
|
25608
25513
|
function buildAgentTrait7(c) {
|
|
@@ -25743,26 +25648,25 @@ function buildAgentTrait7(c) {
|
|
|
25743
25648
|
};
|
|
25744
25649
|
}
|
|
25745
25650
|
function stdAgentToolCallEntity(params = {}) {
|
|
25746
|
-
return
|
|
25651
|
+
return buildEntity79(resolve93(params));
|
|
25747
25652
|
}
|
|
25748
25653
|
function stdAgentToolCallTrait(params = {}) {
|
|
25749
|
-
return buildAgentTrait7(
|
|
25654
|
+
return buildAgentTrait7(resolve93(params));
|
|
25750
25655
|
}
|
|
25751
25656
|
function stdAgentToolCallPage(params = {}) {
|
|
25752
|
-
const c =
|
|
25657
|
+
const c = resolve93(params);
|
|
25753
25658
|
return {
|
|
25754
25659
|
name: c.pageName,
|
|
25755
25660
|
path: c.pagePath,
|
|
25756
25661
|
...c.isInitial ? { isInitial: true } : {},
|
|
25757
25662
|
traits: [
|
|
25758
25663
|
{ ref: `${c.entityName}Modal` },
|
|
25759
|
-
{ ref: `${c.entityName}Log` },
|
|
25760
25664
|
{ ref: `${c.entityName}Agent` }
|
|
25761
25665
|
]
|
|
25762
25666
|
};
|
|
25763
25667
|
}
|
|
25764
25668
|
function stdAgentToolCall(params = {}) {
|
|
25765
|
-
const c =
|
|
25669
|
+
const c = resolve93(params);
|
|
25766
25670
|
const { entityName, fields } = c;
|
|
25767
25671
|
const invokeContent = {
|
|
25768
25672
|
type: "stack",
|
|
@@ -25790,30 +25694,24 @@ function stdAgentToolCall(params = {}) {
|
|
|
25790
25694
|
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
25791
25695
|
emitOnSave: "INVOKED"
|
|
25792
25696
|
}));
|
|
25793
|
-
const activityLogTrait = extractTrait(stdAgentActivityLog({
|
|
25794
|
-
entityName,
|
|
25795
|
-
fields
|
|
25796
|
-
}));
|
|
25797
25697
|
const agentTrait = buildAgentTrait7(c);
|
|
25798
|
-
const entity =
|
|
25698
|
+
const entity = buildEntity79(c);
|
|
25799
25699
|
const page = {
|
|
25800
25700
|
name: c.pageName,
|
|
25801
25701
|
path: c.pagePath,
|
|
25802
25702
|
...c.isInitial ? { isInitial: true } : {},
|
|
25803
25703
|
traits: [
|
|
25804
25704
|
{ ref: modalTrait.name },
|
|
25805
|
-
{ ref: activityLogTrait.name },
|
|
25806
25705
|
{ ref: agentTrait.name }
|
|
25807
25706
|
]
|
|
25808
25707
|
};
|
|
25809
|
-
return makeOrbital(`${c.entityName}Orbital`, entity, [modalTrait,
|
|
25708
|
+
return makeOrbital(`${c.entityName}Orbital`, entity, [modalTrait, agentTrait], [page]);
|
|
25810
25709
|
}
|
|
25811
|
-
function
|
|
25710
|
+
function resolve94(params) {
|
|
25812
25711
|
const entityName = params.entityName ?? "StepTracker";
|
|
25813
25712
|
const p = plural(entityName);
|
|
25814
25713
|
const stepLabels = params.stepLabels ?? ["Initialize", "Process", "Validate", "Complete"];
|
|
25815
25714
|
const requiredFields = [
|
|
25816
|
-
{ name: "steps", type: "string", default: stepLabels.join(",") },
|
|
25817
25715
|
{ name: "currentStep", type: "number", default: 0 },
|
|
25818
25716
|
{ name: "totalSteps", type: "number", default: stepLabels.length },
|
|
25819
25717
|
{ name: "status", type: "string", default: "idle" }
|
|
@@ -25837,11 +25735,12 @@ function resolve95(params) {
|
|
|
25837
25735
|
isInitial: params.isInitial ?? false
|
|
25838
25736
|
};
|
|
25839
25737
|
}
|
|
25840
|
-
function
|
|
25738
|
+
function buildEntity80(c) {
|
|
25841
25739
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
25842
25740
|
}
|
|
25843
|
-
function
|
|
25741
|
+
function buildTrait72(c) {
|
|
25844
25742
|
const { entityName } = c;
|
|
25743
|
+
const stepsLiteral = c.stepLabels.map((label, i) => ({ id: String(i), title: label }));
|
|
25845
25744
|
const idleUI = {
|
|
25846
25745
|
type: "stack",
|
|
25847
25746
|
direction: "vertical",
|
|
@@ -25859,7 +25758,7 @@ function buildTrait73(c) {
|
|
|
25859
25758
|
]
|
|
25860
25759
|
},
|
|
25861
25760
|
{ type: "divider" },
|
|
25862
|
-
{ type: "wizard-progress", currentStep: "@entity.currentStep",
|
|
25761
|
+
{ type: "wizard-progress", currentStep: "@entity.currentStep", steps: stepsLiteral },
|
|
25863
25762
|
{ type: "button", label: "Start", event: "START", variant: "primary", icon: "play" }
|
|
25864
25763
|
]
|
|
25865
25764
|
};
|
|
@@ -25880,7 +25779,7 @@ function buildTrait73(c) {
|
|
|
25880
25779
|
]
|
|
25881
25780
|
},
|
|
25882
25781
|
{ type: "divider" },
|
|
25883
|
-
{ type: "wizard-progress", currentStep: "@entity.currentStep",
|
|
25782
|
+
{ type: "wizard-progress", currentStep: "@entity.currentStep", steps: stepsLiteral },
|
|
25884
25783
|
{
|
|
25885
25784
|
type: "stack",
|
|
25886
25785
|
direction: "horizontal",
|
|
@@ -25919,7 +25818,7 @@ function buildTrait73(c) {
|
|
|
25919
25818
|
]
|
|
25920
25819
|
},
|
|
25921
25820
|
{ type: "divider" },
|
|
25922
|
-
{ type: "wizard-progress", currentStep: "@entity.totalSteps",
|
|
25821
|
+
{ type: "wizard-progress", currentStep: "@entity.totalSteps", steps: stepsLiteral },
|
|
25923
25822
|
{ type: "alert", variant: "success", message: "All steps completed successfully." },
|
|
25924
25823
|
{ type: "button", label: "Reset", event: "RESET", variant: "ghost", icon: "rotate-ccw" }
|
|
25925
25824
|
]
|
|
@@ -25941,7 +25840,7 @@ function buildTrait73(c) {
|
|
|
25941
25840
|
]
|
|
25942
25841
|
},
|
|
25943
25842
|
{ type: "divider" },
|
|
25944
|
-
{ type: "wizard-progress", currentStep: "@entity.currentStep",
|
|
25843
|
+
{ type: "wizard-progress", currentStep: "@entity.currentStep", steps: stepsLiteral },
|
|
25945
25844
|
{ type: "alert", variant: "error", message: "Pipeline failed at the current step." },
|
|
25946
25845
|
{
|
|
25947
25846
|
type: "stack",
|
|
@@ -26076,25 +25975,25 @@ function buildTrait73(c) {
|
|
|
26076
25975
|
}
|
|
26077
25976
|
};
|
|
26078
25977
|
}
|
|
26079
|
-
function
|
|
25978
|
+
function buildPage72(c) {
|
|
26080
25979
|
return makePage({ name: c.pageName, path: c.pagePath, traitName: c.traitName, isInitial: c.isInitial });
|
|
26081
25980
|
}
|
|
26082
25981
|
function stdAgentStepProgressEntity(params = {}) {
|
|
26083
|
-
return
|
|
25982
|
+
return buildEntity80(resolve94(params));
|
|
26084
25983
|
}
|
|
26085
25984
|
function stdAgentStepProgressTrait(params = {}) {
|
|
26086
|
-
return
|
|
25985
|
+
return buildTrait72(resolve94(params));
|
|
26087
25986
|
}
|
|
26088
25987
|
function stdAgentStepProgressPage(params = {}) {
|
|
26089
|
-
return
|
|
25988
|
+
return buildPage72(resolve94(params));
|
|
26090
25989
|
}
|
|
26091
25990
|
function stdAgentStepProgress(params = {}) {
|
|
26092
|
-
const c =
|
|
26093
|
-
return makeOrbital(`${c.entityName}Orbital`,
|
|
25991
|
+
const c = resolve94(params);
|
|
25992
|
+
return makeOrbital(`${c.entityName}Orbital`, buildEntity80(c), [buildTrait72(c)], [buildPage72(c)]);
|
|
26094
25993
|
}
|
|
26095
25994
|
|
|
26096
25995
|
// behaviors/functions/molecules/std-agent-tool-loop.ts
|
|
26097
|
-
function
|
|
25996
|
+
function resolve95(params) {
|
|
26098
25997
|
const entityName = params.entityName ?? "ToolLoop";
|
|
26099
25998
|
const p = plural(entityName);
|
|
26100
25999
|
const requiredFields = [
|
|
@@ -26292,7 +26191,7 @@ function completedView(_entityName) {
|
|
|
26292
26191
|
{ type: "divider" },
|
|
26293
26192
|
{
|
|
26294
26193
|
type: "simple-grid",
|
|
26295
|
-
|
|
26194
|
+
cols: 2,
|
|
26296
26195
|
children: [
|
|
26297
26196
|
{ type: "stat-display", label: "Iterations", value: `@entity.iterations`, icon: "repeat" },
|
|
26298
26197
|
{ type: "stat-display", label: "Status", value: `@entity.status`, icon: "check" }
|
|
@@ -26329,7 +26228,7 @@ function failedView(_entityName) {
|
|
|
26329
26228
|
{ type: "alert", variant: "error", message: `@entity.error` },
|
|
26330
26229
|
{
|
|
26331
26230
|
type: "simple-grid",
|
|
26332
|
-
|
|
26231
|
+
cols: 2,
|
|
26333
26232
|
children: [
|
|
26334
26233
|
{ type: "stat-display", label: "Iterations Used", value: `@entity.iterations`, icon: "repeat" },
|
|
26335
26234
|
{ type: "stat-display", label: "Max Allowed", value: `@entity.maxIterations`, icon: "shield" }
|
|
@@ -26339,7 +26238,7 @@ function failedView(_entityName) {
|
|
|
26339
26238
|
]
|
|
26340
26239
|
};
|
|
26341
26240
|
}
|
|
26342
|
-
function
|
|
26241
|
+
function buildTrait73(c) {
|
|
26343
26242
|
const { entityName, maxIterations, compactThreshold } = c;
|
|
26344
26243
|
return {
|
|
26345
26244
|
name: c.traitName,
|
|
@@ -26550,17 +26449,17 @@ function buildTrait74(c) {
|
|
|
26550
26449
|
}
|
|
26551
26450
|
};
|
|
26552
26451
|
}
|
|
26553
|
-
function
|
|
26452
|
+
function buildEntity81(c) {
|
|
26554
26453
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
26555
26454
|
}
|
|
26556
26455
|
function stdAgentToolLoopEntity(params) {
|
|
26557
|
-
return
|
|
26456
|
+
return buildEntity81(resolve95(params));
|
|
26558
26457
|
}
|
|
26559
26458
|
function stdAgentToolLoopTrait(params) {
|
|
26560
|
-
return
|
|
26459
|
+
return buildTrait73(resolve95(params));
|
|
26561
26460
|
}
|
|
26562
26461
|
function stdAgentToolLoopPage(params) {
|
|
26563
|
-
const c =
|
|
26462
|
+
const c = resolve95(params);
|
|
26564
26463
|
return {
|
|
26565
26464
|
name: c.pageName,
|
|
26566
26465
|
path: c.pagePath,
|
|
@@ -26568,7 +26467,6 @@ function stdAgentToolLoopPage(params) {
|
|
|
26568
26467
|
traits: [
|
|
26569
26468
|
{ ref: c.traitName },
|
|
26570
26469
|
{ ref: "ToolLoopStepProgress" },
|
|
26571
|
-
{ ref: "ToolLoopActivityLog" },
|
|
26572
26470
|
{ ref: "ToolLoopCompletionFlow" },
|
|
26573
26471
|
{ ref: "ToolLoopToolCallFlow" },
|
|
26574
26472
|
{ ref: "ToolLoopContextMonitor" }
|
|
@@ -26576,9 +26474,9 @@ function stdAgentToolLoopPage(params) {
|
|
|
26576
26474
|
};
|
|
26577
26475
|
}
|
|
26578
26476
|
function stdAgentToolLoop(params) {
|
|
26579
|
-
const c =
|
|
26477
|
+
const c = resolve95(params);
|
|
26580
26478
|
const { entityName, fields } = c;
|
|
26581
|
-
const loopTrait =
|
|
26479
|
+
const loopTrait = buildTrait73(c);
|
|
26582
26480
|
const completionTrait = extractTrait(stdAgentCompletion({
|
|
26583
26481
|
entityName,
|
|
26584
26482
|
fields,
|
|
@@ -26628,18 +26526,6 @@ function stdAgentToolLoop(params) {
|
|
|
26628
26526
|
e.scope = "internal";
|
|
26629
26527
|
}
|
|
26630
26528
|
}
|
|
26631
|
-
const activityLogTrait = extractTrait(stdAgentActivityLog({
|
|
26632
|
-
entityName,
|
|
26633
|
-
fields,
|
|
26634
|
-
persistence: "runtime"
|
|
26635
|
-
}));
|
|
26636
|
-
activityLogTrait.name = "ToolLoopActivityLog";
|
|
26637
|
-
activityLogTrait.listens = [];
|
|
26638
|
-
if (activityLogTrait.emits) {
|
|
26639
|
-
for (const e of activityLogTrait.emits) {
|
|
26640
|
-
e.scope = "internal";
|
|
26641
|
-
}
|
|
26642
|
-
}
|
|
26643
26529
|
const entity = makeEntity({ name: entityName, fields, persistence: c.persistence });
|
|
26644
26530
|
const page = {
|
|
26645
26531
|
name: c.pageName,
|
|
@@ -26648,7 +26534,6 @@ function stdAgentToolLoop(params) {
|
|
|
26648
26534
|
traits: [
|
|
26649
26535
|
{ ref: loopTrait.name },
|
|
26650
26536
|
{ ref: stepProgressTrait.name },
|
|
26651
|
-
{ ref: activityLogTrait.name },
|
|
26652
26537
|
{ ref: completionTrait.name },
|
|
26653
26538
|
{ ref: toolCallTrait.name },
|
|
26654
26539
|
{ ref: contextTrait.name }
|
|
@@ -26657,11 +26542,11 @@ function stdAgentToolLoop(params) {
|
|
|
26657
26542
|
return makeOrbital(
|
|
26658
26543
|
`${entityName}Orbital`,
|
|
26659
26544
|
entity,
|
|
26660
|
-
[loopTrait, stepProgressTrait,
|
|
26545
|
+
[loopTrait, stepProgressTrait, completionTrait, toolCallTrait, contextTrait],
|
|
26661
26546
|
[page]
|
|
26662
26547
|
);
|
|
26663
26548
|
}
|
|
26664
|
-
function
|
|
26549
|
+
function resolve96(params) {
|
|
26665
26550
|
const entityName = params.entityName ?? "FixLoop";
|
|
26666
26551
|
const p = plural(entityName);
|
|
26667
26552
|
const requiredFields = [
|
|
@@ -26857,7 +26742,7 @@ function succeededView() {
|
|
|
26857
26742
|
{ type: "divider" },
|
|
26858
26743
|
{
|
|
26859
26744
|
type: "simple-grid",
|
|
26860
|
-
|
|
26745
|
+
cols: 2,
|
|
26861
26746
|
children: [
|
|
26862
26747
|
{ type: "stat-display", label: "Fix Attempts", value: `@entity.fixAttempts`, icon: "wrench" },
|
|
26863
26748
|
{ type: "stat-display", label: "Status", value: "Passed", icon: "check" }
|
|
@@ -26890,7 +26775,7 @@ function failedView2() {
|
|
|
26890
26775
|
{ type: "alert", variant: "error", message: `@entity.error` },
|
|
26891
26776
|
{
|
|
26892
26777
|
type: "simple-grid",
|
|
26893
|
-
|
|
26778
|
+
cols: 2,
|
|
26894
26779
|
children: [
|
|
26895
26780
|
{ type: "stat-display", label: "Attempts Used", value: `@entity.fixAttempts`, icon: "wrench" },
|
|
26896
26781
|
{ type: "stat-display", label: "Remaining Errors", value: `@entity.errorCount`, icon: "alert-triangle" }
|
|
@@ -26912,7 +26797,7 @@ function failedView2() {
|
|
|
26912
26797
|
]
|
|
26913
26798
|
};
|
|
26914
26799
|
}
|
|
26915
|
-
function
|
|
26800
|
+
function buildTrait74(c) {
|
|
26916
26801
|
const { entityName, maxAttempts, validateTool, fixTool } = c;
|
|
26917
26802
|
return {
|
|
26918
26803
|
name: c.traitName,
|
|
@@ -27106,17 +26991,17 @@ function buildTrait75(c) {
|
|
|
27106
26991
|
}
|
|
27107
26992
|
};
|
|
27108
26993
|
}
|
|
27109
|
-
function
|
|
26994
|
+
function buildEntity82(c) {
|
|
27110
26995
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
27111
26996
|
}
|
|
27112
26997
|
function stdAgentFixLoopEntity(params) {
|
|
27113
|
-
return
|
|
26998
|
+
return buildEntity82(resolve96(params));
|
|
27114
26999
|
}
|
|
27115
27000
|
function stdAgentFixLoopTrait(params) {
|
|
27116
|
-
return
|
|
27001
|
+
return buildTrait74(resolve96(params));
|
|
27117
27002
|
}
|
|
27118
27003
|
function stdAgentFixLoopPage(params) {
|
|
27119
|
-
const c =
|
|
27004
|
+
const c = resolve96(params);
|
|
27120
27005
|
return {
|
|
27121
27006
|
name: c.pageName,
|
|
27122
27007
|
path: c.pagePath,
|
|
@@ -27132,9 +27017,9 @@ function stdAgentFixLoopPage(params) {
|
|
|
27132
27017
|
};
|
|
27133
27018
|
}
|
|
27134
27019
|
function stdAgentFixLoop(params) {
|
|
27135
|
-
const c =
|
|
27020
|
+
const c = resolve96(params);
|
|
27136
27021
|
const { entityName, fields } = c;
|
|
27137
|
-
const fixTrait =
|
|
27022
|
+
const fixTrait = buildTrait74(c);
|
|
27138
27023
|
const validateCallTrait = extractTrait(stdAgentToolCall({
|
|
27139
27024
|
entityName,
|
|
27140
27025
|
fields,
|
|
@@ -27217,7 +27102,7 @@ function stdAgentFixLoop(params) {
|
|
|
27217
27102
|
[page]
|
|
27218
27103
|
);
|
|
27219
27104
|
}
|
|
27220
|
-
function
|
|
27105
|
+
function resolve97(params) {
|
|
27221
27106
|
const entityName = params.entityName ?? "Session";
|
|
27222
27107
|
const p = plural(entityName);
|
|
27223
27108
|
const requiredFields = [
|
|
@@ -27244,7 +27129,7 @@ function resolve98(params) {
|
|
|
27244
27129
|
isInitial: params.isInitial ?? false
|
|
27245
27130
|
};
|
|
27246
27131
|
}
|
|
27247
|
-
function
|
|
27132
|
+
function buildEntity83(c) {
|
|
27248
27133
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
27249
27134
|
}
|
|
27250
27135
|
function buildAgentTrait8(c) {
|
|
@@ -27397,13 +27282,13 @@ function buildAgentTrait8(c) {
|
|
|
27397
27282
|
};
|
|
27398
27283
|
}
|
|
27399
27284
|
function stdAgentSessionEntity(params = {}) {
|
|
27400
|
-
return
|
|
27285
|
+
return buildEntity83(resolve97(params));
|
|
27401
27286
|
}
|
|
27402
27287
|
function stdAgentSessionTrait(params = {}) {
|
|
27403
|
-
return buildAgentTrait8(
|
|
27288
|
+
return buildAgentTrait8(resolve97(params));
|
|
27404
27289
|
}
|
|
27405
27290
|
function stdAgentSessionPage(params = {}) {
|
|
27406
|
-
const c =
|
|
27291
|
+
const c = resolve97(params);
|
|
27407
27292
|
return {
|
|
27408
27293
|
name: c.pageName,
|
|
27409
27294
|
path: c.pagePath,
|
|
@@ -27416,7 +27301,7 @@ function stdAgentSessionPage(params = {}) {
|
|
|
27416
27301
|
};
|
|
27417
27302
|
}
|
|
27418
27303
|
function stdAgentSession(params = {}) {
|
|
27419
|
-
const c =
|
|
27304
|
+
const c = resolve97(params);
|
|
27420
27305
|
const { entityName, fields } = c;
|
|
27421
27306
|
const browseTrait = extractTrait(stdBrowse({
|
|
27422
27307
|
entityName,
|
|
@@ -27475,7 +27360,7 @@ function stdAgentSession(params = {}) {
|
|
|
27475
27360
|
emitOnSave: "LABELED"
|
|
27476
27361
|
}));
|
|
27477
27362
|
const agentTrait = buildAgentTrait8(c);
|
|
27478
|
-
const entity =
|
|
27363
|
+
const entity = buildEntity83(c);
|
|
27479
27364
|
const page = {
|
|
27480
27365
|
name: c.pageName,
|
|
27481
27366
|
path: c.pagePath,
|
|
@@ -27614,7 +27499,7 @@ function stdAgentBuilder(params = {}) {
|
|
|
27614
27499
|
fix: "wrench"
|
|
27615
27500
|
}));
|
|
27616
27501
|
}
|
|
27617
|
-
function
|
|
27502
|
+
function resolve98(params) {
|
|
27618
27503
|
const entityName = params.entityName ?? "SearchResult";
|
|
27619
27504
|
const p = plural(entityName);
|
|
27620
27505
|
const requiredFields = [
|
|
@@ -27640,7 +27525,7 @@ function resolve99(params) {
|
|
|
27640
27525
|
isInitial: params.isInitial ?? false
|
|
27641
27526
|
};
|
|
27642
27527
|
}
|
|
27643
|
-
function
|
|
27528
|
+
function buildEntity84(c) {
|
|
27644
27529
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
27645
27530
|
}
|
|
27646
27531
|
function buildAgentTrait9(c) {
|
|
@@ -27728,13 +27613,13 @@ function buildAgentTrait9(c) {
|
|
|
27728
27613
|
};
|
|
27729
27614
|
}
|
|
27730
27615
|
function stdAgentSearchEntity(params = {}) {
|
|
27731
|
-
return
|
|
27616
|
+
return buildEntity84(resolve98(params));
|
|
27732
27617
|
}
|
|
27733
27618
|
function stdAgentSearchTrait(params = {}) {
|
|
27734
|
-
return buildAgentTrait9(
|
|
27619
|
+
return buildAgentTrait9(resolve98(params));
|
|
27735
27620
|
}
|
|
27736
27621
|
function stdAgentSearchPage(params = {}) {
|
|
27737
|
-
const c =
|
|
27622
|
+
const c = resolve98(params);
|
|
27738
27623
|
return {
|
|
27739
27624
|
name: c.pageName,
|
|
27740
27625
|
path: c.pagePath,
|
|
@@ -27746,7 +27631,7 @@ function stdAgentSearchPage(params = {}) {
|
|
|
27746
27631
|
};
|
|
27747
27632
|
}
|
|
27748
27633
|
function stdAgentSearch(params = {}) {
|
|
27749
|
-
const c =
|
|
27634
|
+
const c = resolve98(params);
|
|
27750
27635
|
const { entityName, fields } = c;
|
|
27751
27636
|
const browseTrait = extractTrait(stdBrowse({
|
|
27752
27637
|
entityName,
|
|
@@ -27767,7 +27652,7 @@ function stdAgentSearch(params = {}) {
|
|
|
27767
27652
|
refreshEvents: ["SEARCHED"]
|
|
27768
27653
|
}));
|
|
27769
27654
|
const agentTrait = buildAgentTrait9(c);
|
|
27770
|
-
const entity =
|
|
27655
|
+
const entity = buildEntity84(c);
|
|
27771
27656
|
const page = {
|
|
27772
27657
|
name: c.pageName,
|
|
27773
27658
|
path: c.pagePath,
|
|
@@ -27781,7 +27666,7 @@ function stdAgentSearch(params = {}) {
|
|
|
27781
27666
|
}
|
|
27782
27667
|
|
|
27783
27668
|
// behaviors/functions/molecules/std-agent-rag.ts
|
|
27784
|
-
function
|
|
27669
|
+
function resolve99(params) {
|
|
27785
27670
|
const entityName = params.entityName ?? "RagRequest";
|
|
27786
27671
|
const p = plural(entityName);
|
|
27787
27672
|
const requiredFields = [
|
|
@@ -28108,17 +27993,17 @@ function buildRagTrait(c) {
|
|
|
28108
27993
|
}
|
|
28109
27994
|
};
|
|
28110
27995
|
}
|
|
28111
|
-
function
|
|
27996
|
+
function buildEntity85(c) {
|
|
28112
27997
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
28113
27998
|
}
|
|
28114
27999
|
function stdAgentRagEntity(params) {
|
|
28115
|
-
return
|
|
28000
|
+
return buildEntity85(resolve99(params));
|
|
28116
28001
|
}
|
|
28117
28002
|
function stdAgentRagTrait(params) {
|
|
28118
|
-
return buildRagTrait(
|
|
28003
|
+
return buildRagTrait(resolve99(params));
|
|
28119
28004
|
}
|
|
28120
28005
|
function stdAgentRagPage(params) {
|
|
28121
|
-
const c =
|
|
28006
|
+
const c = resolve99(params);
|
|
28122
28007
|
return {
|
|
28123
28008
|
name: c.pageName,
|
|
28124
28009
|
path: c.pagePath,
|
|
@@ -28133,7 +28018,7 @@ function stdAgentRagPage(params) {
|
|
|
28133
28018
|
};
|
|
28134
28019
|
}
|
|
28135
28020
|
function stdAgentRag(params) {
|
|
28136
|
-
const c =
|
|
28021
|
+
const c = resolve99(params);
|
|
28137
28022
|
const { entityName, fields } = c;
|
|
28138
28023
|
const ragTrait = buildRagTrait(c);
|
|
28139
28024
|
const memoryTrait = extractTrait(stdAgentMemory({
|
|
@@ -29189,6 +29074,185 @@ function stdAgentTutor(params = {}) {
|
|
|
29189
29074
|
concepts: "brain"
|
|
29190
29075
|
}));
|
|
29191
29076
|
}
|
|
29077
|
+
function resolve100(params) {
|
|
29078
|
+
const entityName = params.entityName ?? "ActivityEntry";
|
|
29079
|
+
const p = plural(entityName);
|
|
29080
|
+
const requiredFields = [
|
|
29081
|
+
{ name: "action", type: "string", default: "" },
|
|
29082
|
+
{ name: "detail", type: "string", default: "" },
|
|
29083
|
+
{ name: "status", type: "string", default: "pending" },
|
|
29084
|
+
{ name: "timestamp", type: "string", default: "" },
|
|
29085
|
+
{ name: "duration", type: "number", default: 0 },
|
|
29086
|
+
{ name: "icon", type: "string", default: "circle" }
|
|
29087
|
+
];
|
|
29088
|
+
const baseFields = params.fields ?? [];
|
|
29089
|
+
const existingNames = new Set(baseFields.map((f) => f.name));
|
|
29090
|
+
const mergedFields = [
|
|
29091
|
+
...baseFields,
|
|
29092
|
+
...requiredFields.filter((f) => !existingNames.has(f.name))
|
|
29093
|
+
];
|
|
29094
|
+
const fields = ensureIdField(mergedFields);
|
|
29095
|
+
return {
|
|
29096
|
+
entityName,
|
|
29097
|
+
fields,
|
|
29098
|
+
persistence: params.persistence ?? "persistent",
|
|
29099
|
+
traitName: `${entityName}Log`,
|
|
29100
|
+
pluralName: p,
|
|
29101
|
+
pageName: params.pageName ?? `${entityName}Page`,
|
|
29102
|
+
pagePath: params.pagePath ?? `/${p.toLowerCase()}`,
|
|
29103
|
+
isInitial: params.isInitial ?? false
|
|
29104
|
+
};
|
|
29105
|
+
}
|
|
29106
|
+
function buildEntity86(c) {
|
|
29107
|
+
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
29108
|
+
}
|
|
29109
|
+
function buildTrait75(c) {
|
|
29110
|
+
const { entityName } = c;
|
|
29111
|
+
const loggingUI = {
|
|
29112
|
+
type: "stack",
|
|
29113
|
+
direction: "vertical",
|
|
29114
|
+
gap: "lg",
|
|
29115
|
+
children: [
|
|
29116
|
+
{
|
|
29117
|
+
type: "stack",
|
|
29118
|
+
direction: "horizontal",
|
|
29119
|
+
gap: "sm",
|
|
29120
|
+
justify: "space-between",
|
|
29121
|
+
align: "center",
|
|
29122
|
+
children: [
|
|
29123
|
+
{
|
|
29124
|
+
type: "stack",
|
|
29125
|
+
direction: "horizontal",
|
|
29126
|
+
gap: "sm",
|
|
29127
|
+
align: "center",
|
|
29128
|
+
children: [
|
|
29129
|
+
{ type: "icon", name: "activity", size: "lg" },
|
|
29130
|
+
{ type: "typography", content: "Activity Log", variant: "h2" }
|
|
29131
|
+
]
|
|
29132
|
+
},
|
|
29133
|
+
{ type: "button", label: "Clear", event: "CLEAR", variant: "ghost", icon: "trash" }
|
|
29134
|
+
]
|
|
29135
|
+
},
|
|
29136
|
+
{ type: "divider" },
|
|
29137
|
+
{
|
|
29138
|
+
type: "timeline",
|
|
29139
|
+
entity: entityName,
|
|
29140
|
+
emptyIcon: "activity",
|
|
29141
|
+
emptyTitle: "No activity yet",
|
|
29142
|
+
emptyDescription: "Agent actions will appear here as they occur.",
|
|
29143
|
+
renderItem: ["fn", "item", {
|
|
29144
|
+
type: "stack",
|
|
29145
|
+
direction: "vertical",
|
|
29146
|
+
gap: "xs",
|
|
29147
|
+
children: [
|
|
29148
|
+
{
|
|
29149
|
+
type: "stack",
|
|
29150
|
+
direction: "horizontal",
|
|
29151
|
+
gap: "sm",
|
|
29152
|
+
align: "center",
|
|
29153
|
+
children: [
|
|
29154
|
+
{ type: "badge", label: "@item.status" },
|
|
29155
|
+
{ type: "typography", variant: "h4", content: "@item.action" }
|
|
29156
|
+
]
|
|
29157
|
+
},
|
|
29158
|
+
{ type: "typography", variant: "body", color: "muted", content: "@item.detail" },
|
|
29159
|
+
{
|
|
29160
|
+
type: "stack",
|
|
29161
|
+
direction: "horizontal",
|
|
29162
|
+
gap: "sm",
|
|
29163
|
+
align: "center",
|
|
29164
|
+
children: [
|
|
29165
|
+
{ type: "typography", variant: "caption", color: "muted", content: "@item.timestamp" },
|
|
29166
|
+
{ type: "badge", label: "@item.duration", variant: "outline" }
|
|
29167
|
+
]
|
|
29168
|
+
}
|
|
29169
|
+
]
|
|
29170
|
+
}]
|
|
29171
|
+
}
|
|
29172
|
+
]
|
|
29173
|
+
};
|
|
29174
|
+
return {
|
|
29175
|
+
name: c.traitName,
|
|
29176
|
+
linkedEntity: entityName,
|
|
29177
|
+
category: "interaction",
|
|
29178
|
+
emits: [
|
|
29179
|
+
{ event: "LOG_ENTRY", scope: "external", payload: [
|
|
29180
|
+
{ name: "action", type: "string" },
|
|
29181
|
+
{ name: "detail", type: "string" },
|
|
29182
|
+
{ name: "status", type: "string" }
|
|
29183
|
+
] }
|
|
29184
|
+
],
|
|
29185
|
+
listens: [
|
|
29186
|
+
{ event: "LOG_ENTRY", triggers: "LOG_ENTRY", scope: "external" }
|
|
29187
|
+
],
|
|
29188
|
+
stateMachine: {
|
|
29189
|
+
states: [
|
|
29190
|
+
{ name: "logging", isInitial: true }
|
|
29191
|
+
],
|
|
29192
|
+
events: [
|
|
29193
|
+
{ key: "INIT", name: "Initialize" },
|
|
29194
|
+
{ key: "LOG_ENTRY", name: "Log Entry", payload: [
|
|
29195
|
+
{ name: "action", type: "string", required: true },
|
|
29196
|
+
{ name: "detail", type: "string", required: true },
|
|
29197
|
+
{ name: "status", type: "string", required: true }
|
|
29198
|
+
] },
|
|
29199
|
+
{ key: "CLEAR", name: "Clear Log" }
|
|
29200
|
+
],
|
|
29201
|
+
transitions: [
|
|
29202
|
+
{
|
|
29203
|
+
from: "logging",
|
|
29204
|
+
to: "logging",
|
|
29205
|
+
event: "INIT",
|
|
29206
|
+
effects: [
|
|
29207
|
+
["fetch", entityName],
|
|
29208
|
+
["render-ui", "main", loggingUI]
|
|
29209
|
+
]
|
|
29210
|
+
},
|
|
29211
|
+
{
|
|
29212
|
+
from: "logging",
|
|
29213
|
+
to: "logging",
|
|
29214
|
+
event: "LOG_ENTRY",
|
|
29215
|
+
effects: [
|
|
29216
|
+
["persist", "create", entityName, {
|
|
29217
|
+
action: "@payload.action",
|
|
29218
|
+
detail: "@payload.detail",
|
|
29219
|
+
status: "@payload.status",
|
|
29220
|
+
timestamp: "@now"
|
|
29221
|
+
}],
|
|
29222
|
+
["fetch", entityName],
|
|
29223
|
+
["render-ui", "main", loggingUI]
|
|
29224
|
+
]
|
|
29225
|
+
},
|
|
29226
|
+
{
|
|
29227
|
+
from: "logging",
|
|
29228
|
+
to: "logging",
|
|
29229
|
+
event: "CLEAR",
|
|
29230
|
+
effects: [
|
|
29231
|
+
["persist", "delete", entityName],
|
|
29232
|
+
["fetch", entityName],
|
|
29233
|
+
["render-ui", "main", loggingUI]
|
|
29234
|
+
]
|
|
29235
|
+
}
|
|
29236
|
+
]
|
|
29237
|
+
}
|
|
29238
|
+
};
|
|
29239
|
+
}
|
|
29240
|
+
function buildPage73(c) {
|
|
29241
|
+
return makePage({ name: c.pageName, path: c.pagePath, traitName: c.traitName, isInitial: c.isInitial });
|
|
29242
|
+
}
|
|
29243
|
+
function stdAgentActivityLogEntity(params = {}) {
|
|
29244
|
+
return buildEntity86(resolve100(params));
|
|
29245
|
+
}
|
|
29246
|
+
function stdAgentActivityLogTrait(params = {}) {
|
|
29247
|
+
return buildTrait75(resolve100(params));
|
|
29248
|
+
}
|
|
29249
|
+
function stdAgentActivityLogPage(params = {}) {
|
|
29250
|
+
return buildPage73(resolve100(params));
|
|
29251
|
+
}
|
|
29252
|
+
function stdAgentActivityLog(params = {}) {
|
|
29253
|
+
const c = resolve100(params);
|
|
29254
|
+
return makeOrbital(`${c.entityName}Orbital`, buildEntity86(c), [buildTrait75(c)], [buildPage73(c)]);
|
|
29255
|
+
}
|
|
29192
29256
|
function resolve101(params) {
|
|
29193
29257
|
const entityName = params.entityName ?? "LearningRecord";
|
|
29194
29258
|
const p = plural(entityName);
|
|
@@ -29219,7 +29283,8 @@ function resolve101(params) {
|
|
|
29219
29283
|
{ name: "action", type: "string", default: "" },
|
|
29220
29284
|
{ name: "detail", type: "string", default: "" },
|
|
29221
29285
|
{ name: "timestamp", type: "string", default: "" },
|
|
29222
|
-
{ name: "duration", type: "number", default: 0 }
|
|
29286
|
+
{ name: "duration", type: "number", default: 0 },
|
|
29287
|
+
{ name: "icon", type: "string", default: "circle" }
|
|
29223
29288
|
];
|
|
29224
29289
|
const baseFields = ensureIdField(params.fields ?? []);
|
|
29225
29290
|
const userFieldNames = new Set(baseFields.map((f) => f.name));
|
|
@@ -29259,7 +29324,7 @@ function idleView5(_entityName) {
|
|
|
29259
29324
|
{ type: "divider" },
|
|
29260
29325
|
{
|
|
29261
29326
|
type: "simple-grid",
|
|
29262
|
-
|
|
29327
|
+
cols: 3,
|
|
29263
29328
|
children: [
|
|
29264
29329
|
{ type: "stat-display", label: "Successes", value: `@entity.totalSuccesses`, icon: "check-circle" },
|
|
29265
29330
|
{ type: "stat-display", label: "Failures", value: `@entity.totalFailures`, icon: "x-circle" },
|
|
@@ -29533,7 +29598,6 @@ function stdAgentLearnerPage(params) {
|
|
|
29533
29598
|
...c.isInitial ? { isInitial: true } : {},
|
|
29534
29599
|
traits: [
|
|
29535
29600
|
{ ref: c.traitName },
|
|
29536
|
-
{ ref: "LearnerActivityLog" },
|
|
29537
29601
|
{ ref: "LearnerRecordsBrowse" },
|
|
29538
29602
|
{ ref: "LearnerMemoryLifecycle" },
|
|
29539
29603
|
{ ref: "LearnerCompletionFlow" },
|
|
@@ -29581,18 +29645,6 @@ function stdAgentLearner(params) {
|
|
|
29581
29645
|
e.scope = "internal";
|
|
29582
29646
|
}
|
|
29583
29647
|
}
|
|
29584
|
-
const activityLogTrait = extractTrait(stdAgentActivityLog({
|
|
29585
|
-
entityName,
|
|
29586
|
-
fields,
|
|
29587
|
-
persistence: "runtime"
|
|
29588
|
-
}));
|
|
29589
|
-
activityLogTrait.name = "LearnerActivityLog";
|
|
29590
|
-
activityLogTrait.listens = [];
|
|
29591
|
-
if (activityLogTrait.emits) {
|
|
29592
|
-
for (const e of activityLogTrait.emits) {
|
|
29593
|
-
e.scope = "internal";
|
|
29594
|
-
}
|
|
29595
|
-
}
|
|
29596
29648
|
const recordsBrowseTrait = extractTrait(stdBrowse({
|
|
29597
29649
|
entityName,
|
|
29598
29650
|
fields,
|
|
@@ -29612,7 +29664,6 @@ function stdAgentLearner(params) {
|
|
|
29612
29664
|
...c.isInitial ? { isInitial: true } : {},
|
|
29613
29665
|
traits: [
|
|
29614
29666
|
{ ref: learnerTrait.name },
|
|
29615
|
-
{ ref: activityLogTrait.name },
|
|
29616
29667
|
{ ref: recordsBrowseTrait.name },
|
|
29617
29668
|
{ ref: memoryTrait.name },
|
|
29618
29669
|
{ ref: completionTrait.name },
|
|
@@ -29622,7 +29673,7 @@ function stdAgentLearner(params) {
|
|
|
29622
29673
|
return makeOrbital(
|
|
29623
29674
|
`${entityName}Orbital`,
|
|
29624
29675
|
entity,
|
|
29625
|
-
[learnerTrait,
|
|
29676
|
+
[learnerTrait, recordsBrowseTrait, memoryTrait, completionTrait, providerTrait],
|
|
29626
29677
|
[page]
|
|
29627
29678
|
);
|
|
29628
29679
|
}
|
|
@@ -32393,6 +32444,12 @@ var MODULE_DESCRIPTIONS = {
|
|
|
32393
32444
|
displayName: "Agent Intelligence",
|
|
32394
32445
|
description: "Agent memory management, LLM access, tool invocation, context management, and session control.",
|
|
32395
32446
|
icon: "\u{1F916}"
|
|
32447
|
+
},
|
|
32448
|
+
composition: {
|
|
32449
|
+
name: "Composition",
|
|
32450
|
+
displayName: "Behavior Composition",
|
|
32451
|
+
description: "Compile-time operators for composing N orbitals into a single application schema.",
|
|
32452
|
+
icon: "\u{1F9E9}"
|
|
32396
32453
|
}
|
|
32397
32454
|
};
|
|
32398
32455
|
var BEHAVIOR_GROUPINGS = {
|