@almadar/std 3.13.1 → 3.14.1
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 +173 -25
- package/behaviors/exports/molecules/std-agent-learner.orb +15 -550
- package/behaviors/exports/molecules/std-agent-planner.orb +10 -530
- package/behaviors/exports/molecules/std-agent-rag.orb +4 -1
- package/behaviors/exports/molecules/std-agent-tool-loop.orb +169 -573
- package/behaviors/exports/organisms/std-agent-builder.orb +905 -1453
- package/behaviors/exports/organisms/std-agent-pipeline.orb +806 -1502
- package/behaviors/exports/organisms/std-agent-reviewer.orb +4 -1
- package/behaviors/exports/validation-report.json +2 -2
- package/dist/behaviors/behaviors-registry.json +11173 -5568
- 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 +173 -25
- package/dist/behaviors/exports/molecules/std-agent-learner.orb +15 -550
- package/dist/behaviors/exports/molecules/std-agent-planner.orb +10 -530
- package/dist/behaviors/exports/molecules/std-agent-rag.orb +4 -1
- package/dist/behaviors/exports/molecules/std-agent-tool-loop.orb +169 -573
- package/dist/behaviors/exports/organisms/std-agent-builder.orb +905 -1453
- package/dist/behaviors/exports/organisms/std-agent-pipeline.orb +806 -1502
- package/dist/behaviors/exports/organisms/std-agent-reviewer.orb +4 -1
- package/dist/behaviors/exports/validation-report.json +2 -2
- 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 +11173 -5568
- 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 +173 -25
- package/dist/exports/molecules/std-agent-learner.orb +15 -550
- package/dist/exports/molecules/std-agent-planner.orb +10 -530
- package/dist/exports/molecules/std-agent-rag.orb +4 -1
- package/dist/exports/molecules/std-agent-tool-loop.orb +169 -573
- package/dist/exports/organisms/std-agent-builder.orb +905 -1453
- package/dist/exports/organisms/std-agent-pipeline.orb +806 -1502
- package/dist/exports/organisms/std-agent-reviewer.orb +4 -1
- package/dist/exports/validation-report.json +2 -2
- package/dist/index.js +257 -302
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24876,187 +24876,9 @@ function stdAgentCompletion(params = {}) {
|
|
|
24876
24876
|
};
|
|
24877
24877
|
return makeOrbital(`${c.entityName}Orbital`, entity, [modalTrait, notifTrait, agentTrait], [page]);
|
|
24878
24878
|
}
|
|
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
24879
|
|
|
25058
24880
|
// behaviors/functions/molecules/std-agent-planner.ts
|
|
25059
|
-
function
|
|
24881
|
+
function resolve92(params) {
|
|
25060
24882
|
const entityName = params.entityName ?? "Plan";
|
|
25061
24883
|
const p = plural(entityName);
|
|
25062
24884
|
const requiredFields = [
|
|
@@ -25081,7 +24903,8 @@ function resolve93(params) {
|
|
|
25081
24903
|
{ name: "action", type: "string", default: "" },
|
|
25082
24904
|
{ name: "detail", type: "string", default: "" },
|
|
25083
24905
|
{ name: "timestamp", type: "string", default: "" },
|
|
25084
|
-
{ name: "duration", type: "number", default: 0 }
|
|
24906
|
+
{ name: "duration", type: "number", default: 0 },
|
|
24907
|
+
{ name: "icon", type: "string", default: "circle" }
|
|
25085
24908
|
];
|
|
25086
24909
|
const baseFields = ensureIdField(params.fields ?? []);
|
|
25087
24910
|
const userFieldNames = new Set(baseFields.map((f) => f.name));
|
|
@@ -25266,7 +25089,7 @@ function errorView2(_entityName) {
|
|
|
25266
25089
|
]
|
|
25267
25090
|
};
|
|
25268
25091
|
}
|
|
25269
|
-
function
|
|
25092
|
+
function buildTrait71(c) {
|
|
25270
25093
|
const { entityName, categories, memoryLimit } = c;
|
|
25271
25094
|
const categoryList = categories.join(", ");
|
|
25272
25095
|
return {
|
|
@@ -25449,17 +25272,17 @@ function buildTrait72(c) {
|
|
|
25449
25272
|
}
|
|
25450
25273
|
};
|
|
25451
25274
|
}
|
|
25452
|
-
function
|
|
25275
|
+
function buildEntity78(c) {
|
|
25453
25276
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
25454
25277
|
}
|
|
25455
25278
|
function stdAgentPlannerEntity(params) {
|
|
25456
|
-
return
|
|
25279
|
+
return buildEntity78(resolve92(params));
|
|
25457
25280
|
}
|
|
25458
25281
|
function stdAgentPlannerTrait(params) {
|
|
25459
|
-
return
|
|
25282
|
+
return buildTrait71(resolve92(params));
|
|
25460
25283
|
}
|
|
25461
25284
|
function stdAgentPlannerPage(params) {
|
|
25462
|
-
const c =
|
|
25285
|
+
const c = resolve92(params);
|
|
25463
25286
|
return {
|
|
25464
25287
|
name: c.pageName,
|
|
25465
25288
|
path: c.pagePath,
|
|
@@ -25467,7 +25290,6 @@ function stdAgentPlannerPage(params) {
|
|
|
25467
25290
|
traits: [
|
|
25468
25291
|
{ ref: c.traitName },
|
|
25469
25292
|
{ ref: "PlannerTaskInput" },
|
|
25470
|
-
{ ref: "PlannerActivityLog" },
|
|
25471
25293
|
{ ref: "PlannerClassifierFlow" },
|
|
25472
25294
|
{ ref: "PlannerCompletionFlow" },
|
|
25473
25295
|
{ ref: "PlannerMemoryLifecycle" }
|
|
@@ -25475,9 +25297,9 @@ function stdAgentPlannerPage(params) {
|
|
|
25475
25297
|
};
|
|
25476
25298
|
}
|
|
25477
25299
|
function stdAgentPlanner(params) {
|
|
25478
|
-
const c =
|
|
25300
|
+
const c = resolve92(params);
|
|
25479
25301
|
const { entityName, fields } = c;
|
|
25480
|
-
const plannerTrait =
|
|
25302
|
+
const plannerTrait = buildTrait71(c);
|
|
25481
25303
|
const classifierTrait = extractTrait(stdAgentClassifier({
|
|
25482
25304
|
entityName,
|
|
25483
25305
|
fields,
|
|
@@ -25538,18 +25360,6 @@ function stdAgentPlanner(params) {
|
|
|
25538
25360
|
saveEvent: "PLAN"
|
|
25539
25361
|
}));
|
|
25540
25362
|
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
25363
|
const entity = makeEntity({ name: entityName, fields, persistence: c.persistence });
|
|
25554
25364
|
const page = {
|
|
25555
25365
|
name: c.pageName,
|
|
@@ -25558,7 +25368,6 @@ function stdAgentPlanner(params) {
|
|
|
25558
25368
|
traits: [
|
|
25559
25369
|
{ ref: plannerTrait.name },
|
|
25560
25370
|
{ ref: modalTrait.name },
|
|
25561
|
-
{ ref: activityLogTrait.name },
|
|
25562
25371
|
{ ref: classifierTrait.name },
|
|
25563
25372
|
{ ref: completionTrait.name },
|
|
25564
25373
|
{ ref: memoryTrait.name }
|
|
@@ -25567,11 +25376,11 @@ function stdAgentPlanner(params) {
|
|
|
25567
25376
|
return makeOrbital(
|
|
25568
25377
|
`${entityName}Orbital`,
|
|
25569
25378
|
entity,
|
|
25570
|
-
[plannerTrait, modalTrait,
|
|
25379
|
+
[plannerTrait, modalTrait, classifierTrait, completionTrait, memoryTrait],
|
|
25571
25380
|
[page]
|
|
25572
25381
|
);
|
|
25573
25382
|
}
|
|
25574
|
-
function
|
|
25383
|
+
function resolve93(params) {
|
|
25575
25384
|
const entityName = params.entityName ?? "ToolCall";
|
|
25576
25385
|
const p = plural(entityName);
|
|
25577
25386
|
const requiredFields = [
|
|
@@ -25602,7 +25411,7 @@ function resolve94(params) {
|
|
|
25602
25411
|
isInitial: params.isInitial ?? false
|
|
25603
25412
|
};
|
|
25604
25413
|
}
|
|
25605
|
-
function
|
|
25414
|
+
function buildEntity79(c) {
|
|
25606
25415
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
25607
25416
|
}
|
|
25608
25417
|
function buildAgentTrait7(c) {
|
|
@@ -25743,26 +25552,25 @@ function buildAgentTrait7(c) {
|
|
|
25743
25552
|
};
|
|
25744
25553
|
}
|
|
25745
25554
|
function stdAgentToolCallEntity(params = {}) {
|
|
25746
|
-
return
|
|
25555
|
+
return buildEntity79(resolve93(params));
|
|
25747
25556
|
}
|
|
25748
25557
|
function stdAgentToolCallTrait(params = {}) {
|
|
25749
|
-
return buildAgentTrait7(
|
|
25558
|
+
return buildAgentTrait7(resolve93(params));
|
|
25750
25559
|
}
|
|
25751
25560
|
function stdAgentToolCallPage(params = {}) {
|
|
25752
|
-
const c =
|
|
25561
|
+
const c = resolve93(params);
|
|
25753
25562
|
return {
|
|
25754
25563
|
name: c.pageName,
|
|
25755
25564
|
path: c.pagePath,
|
|
25756
25565
|
...c.isInitial ? { isInitial: true } : {},
|
|
25757
25566
|
traits: [
|
|
25758
25567
|
{ ref: `${c.entityName}Modal` },
|
|
25759
|
-
{ ref: `${c.entityName}Log` },
|
|
25760
25568
|
{ ref: `${c.entityName}Agent` }
|
|
25761
25569
|
]
|
|
25762
25570
|
};
|
|
25763
25571
|
}
|
|
25764
25572
|
function stdAgentToolCall(params = {}) {
|
|
25765
|
-
const c =
|
|
25573
|
+
const c = resolve93(params);
|
|
25766
25574
|
const { entityName, fields } = c;
|
|
25767
25575
|
const invokeContent = {
|
|
25768
25576
|
type: "stack",
|
|
@@ -25790,30 +25598,24 @@ function stdAgentToolCall(params = {}) {
|
|
|
25790
25598
|
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
25791
25599
|
emitOnSave: "INVOKED"
|
|
25792
25600
|
}));
|
|
25793
|
-
const activityLogTrait = extractTrait(stdAgentActivityLog({
|
|
25794
|
-
entityName,
|
|
25795
|
-
fields
|
|
25796
|
-
}));
|
|
25797
25601
|
const agentTrait = buildAgentTrait7(c);
|
|
25798
|
-
const entity =
|
|
25602
|
+
const entity = buildEntity79(c);
|
|
25799
25603
|
const page = {
|
|
25800
25604
|
name: c.pageName,
|
|
25801
25605
|
path: c.pagePath,
|
|
25802
25606
|
...c.isInitial ? { isInitial: true } : {},
|
|
25803
25607
|
traits: [
|
|
25804
25608
|
{ ref: modalTrait.name },
|
|
25805
|
-
{ ref: activityLogTrait.name },
|
|
25806
25609
|
{ ref: agentTrait.name }
|
|
25807
25610
|
]
|
|
25808
25611
|
};
|
|
25809
|
-
return makeOrbital(`${c.entityName}Orbital`, entity, [modalTrait,
|
|
25612
|
+
return makeOrbital(`${c.entityName}Orbital`, entity, [modalTrait, agentTrait], [page]);
|
|
25810
25613
|
}
|
|
25811
|
-
function
|
|
25614
|
+
function resolve94(params) {
|
|
25812
25615
|
const entityName = params.entityName ?? "StepTracker";
|
|
25813
25616
|
const p = plural(entityName);
|
|
25814
25617
|
const stepLabels = params.stepLabels ?? ["Initialize", "Process", "Validate", "Complete"];
|
|
25815
25618
|
const requiredFields = [
|
|
25816
|
-
{ name: "steps", type: "string", default: stepLabels.join(",") },
|
|
25817
25619
|
{ name: "currentStep", type: "number", default: 0 },
|
|
25818
25620
|
{ name: "totalSteps", type: "number", default: stepLabels.length },
|
|
25819
25621
|
{ name: "status", type: "string", default: "idle" }
|
|
@@ -25837,11 +25639,12 @@ function resolve95(params) {
|
|
|
25837
25639
|
isInitial: params.isInitial ?? false
|
|
25838
25640
|
};
|
|
25839
25641
|
}
|
|
25840
|
-
function
|
|
25642
|
+
function buildEntity80(c) {
|
|
25841
25643
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
25842
25644
|
}
|
|
25843
|
-
function
|
|
25645
|
+
function buildTrait72(c) {
|
|
25844
25646
|
const { entityName } = c;
|
|
25647
|
+
const stepsLiteral = c.stepLabels.map((label, i) => ({ id: String(i), title: label }));
|
|
25845
25648
|
const idleUI = {
|
|
25846
25649
|
type: "stack",
|
|
25847
25650
|
direction: "vertical",
|
|
@@ -25859,7 +25662,7 @@ function buildTrait73(c) {
|
|
|
25859
25662
|
]
|
|
25860
25663
|
},
|
|
25861
25664
|
{ type: "divider" },
|
|
25862
|
-
{ type: "wizard-progress", currentStep: "@entity.currentStep",
|
|
25665
|
+
{ type: "wizard-progress", currentStep: "@entity.currentStep", steps: stepsLiteral },
|
|
25863
25666
|
{ type: "button", label: "Start", event: "START", variant: "primary", icon: "play" }
|
|
25864
25667
|
]
|
|
25865
25668
|
};
|
|
@@ -25880,7 +25683,7 @@ function buildTrait73(c) {
|
|
|
25880
25683
|
]
|
|
25881
25684
|
},
|
|
25882
25685
|
{ type: "divider" },
|
|
25883
|
-
{ type: "wizard-progress", currentStep: "@entity.currentStep",
|
|
25686
|
+
{ type: "wizard-progress", currentStep: "@entity.currentStep", steps: stepsLiteral },
|
|
25884
25687
|
{
|
|
25885
25688
|
type: "stack",
|
|
25886
25689
|
direction: "horizontal",
|
|
@@ -25919,7 +25722,7 @@ function buildTrait73(c) {
|
|
|
25919
25722
|
]
|
|
25920
25723
|
},
|
|
25921
25724
|
{ type: "divider" },
|
|
25922
|
-
{ type: "wizard-progress", currentStep: "@entity.totalSteps",
|
|
25725
|
+
{ type: "wizard-progress", currentStep: "@entity.totalSteps", steps: stepsLiteral },
|
|
25923
25726
|
{ type: "alert", variant: "success", message: "All steps completed successfully." },
|
|
25924
25727
|
{ type: "button", label: "Reset", event: "RESET", variant: "ghost", icon: "rotate-ccw" }
|
|
25925
25728
|
]
|
|
@@ -25941,7 +25744,7 @@ function buildTrait73(c) {
|
|
|
25941
25744
|
]
|
|
25942
25745
|
},
|
|
25943
25746
|
{ type: "divider" },
|
|
25944
|
-
{ type: "wizard-progress", currentStep: "@entity.currentStep",
|
|
25747
|
+
{ type: "wizard-progress", currentStep: "@entity.currentStep", steps: stepsLiteral },
|
|
25945
25748
|
{ type: "alert", variant: "error", message: "Pipeline failed at the current step." },
|
|
25946
25749
|
{
|
|
25947
25750
|
type: "stack",
|
|
@@ -26076,25 +25879,25 @@ function buildTrait73(c) {
|
|
|
26076
25879
|
}
|
|
26077
25880
|
};
|
|
26078
25881
|
}
|
|
26079
|
-
function
|
|
25882
|
+
function buildPage72(c) {
|
|
26080
25883
|
return makePage({ name: c.pageName, path: c.pagePath, traitName: c.traitName, isInitial: c.isInitial });
|
|
26081
25884
|
}
|
|
26082
25885
|
function stdAgentStepProgressEntity(params = {}) {
|
|
26083
|
-
return
|
|
25886
|
+
return buildEntity80(resolve94(params));
|
|
26084
25887
|
}
|
|
26085
25888
|
function stdAgentStepProgressTrait(params = {}) {
|
|
26086
|
-
return
|
|
25889
|
+
return buildTrait72(resolve94(params));
|
|
26087
25890
|
}
|
|
26088
25891
|
function stdAgentStepProgressPage(params = {}) {
|
|
26089
|
-
return
|
|
25892
|
+
return buildPage72(resolve94(params));
|
|
26090
25893
|
}
|
|
26091
25894
|
function stdAgentStepProgress(params = {}) {
|
|
26092
|
-
const c =
|
|
26093
|
-
return makeOrbital(`${c.entityName}Orbital`,
|
|
25895
|
+
const c = resolve94(params);
|
|
25896
|
+
return makeOrbital(`${c.entityName}Orbital`, buildEntity80(c), [buildTrait72(c)], [buildPage72(c)]);
|
|
26094
25897
|
}
|
|
26095
25898
|
|
|
26096
25899
|
// behaviors/functions/molecules/std-agent-tool-loop.ts
|
|
26097
|
-
function
|
|
25900
|
+
function resolve95(params) {
|
|
26098
25901
|
const entityName = params.entityName ?? "ToolLoop";
|
|
26099
25902
|
const p = plural(entityName);
|
|
26100
25903
|
const requiredFields = [
|
|
@@ -26292,7 +26095,7 @@ function completedView(_entityName) {
|
|
|
26292
26095
|
{ type: "divider" },
|
|
26293
26096
|
{
|
|
26294
26097
|
type: "simple-grid",
|
|
26295
|
-
|
|
26098
|
+
cols: 2,
|
|
26296
26099
|
children: [
|
|
26297
26100
|
{ type: "stat-display", label: "Iterations", value: `@entity.iterations`, icon: "repeat" },
|
|
26298
26101
|
{ type: "stat-display", label: "Status", value: `@entity.status`, icon: "check" }
|
|
@@ -26329,7 +26132,7 @@ function failedView(_entityName) {
|
|
|
26329
26132
|
{ type: "alert", variant: "error", message: `@entity.error` },
|
|
26330
26133
|
{
|
|
26331
26134
|
type: "simple-grid",
|
|
26332
|
-
|
|
26135
|
+
cols: 2,
|
|
26333
26136
|
children: [
|
|
26334
26137
|
{ type: "stat-display", label: "Iterations Used", value: `@entity.iterations`, icon: "repeat" },
|
|
26335
26138
|
{ type: "stat-display", label: "Max Allowed", value: `@entity.maxIterations`, icon: "shield" }
|
|
@@ -26339,7 +26142,7 @@ function failedView(_entityName) {
|
|
|
26339
26142
|
]
|
|
26340
26143
|
};
|
|
26341
26144
|
}
|
|
26342
|
-
function
|
|
26145
|
+
function buildTrait73(c) {
|
|
26343
26146
|
const { entityName, maxIterations, compactThreshold } = c;
|
|
26344
26147
|
return {
|
|
26345
26148
|
name: c.traitName,
|
|
@@ -26550,17 +26353,17 @@ function buildTrait74(c) {
|
|
|
26550
26353
|
}
|
|
26551
26354
|
};
|
|
26552
26355
|
}
|
|
26553
|
-
function
|
|
26356
|
+
function buildEntity81(c) {
|
|
26554
26357
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
26555
26358
|
}
|
|
26556
26359
|
function stdAgentToolLoopEntity(params) {
|
|
26557
|
-
return
|
|
26360
|
+
return buildEntity81(resolve95(params));
|
|
26558
26361
|
}
|
|
26559
26362
|
function stdAgentToolLoopTrait(params) {
|
|
26560
|
-
return
|
|
26363
|
+
return buildTrait73(resolve95(params));
|
|
26561
26364
|
}
|
|
26562
26365
|
function stdAgentToolLoopPage(params) {
|
|
26563
|
-
const c =
|
|
26366
|
+
const c = resolve95(params);
|
|
26564
26367
|
return {
|
|
26565
26368
|
name: c.pageName,
|
|
26566
26369
|
path: c.pagePath,
|
|
@@ -26568,7 +26371,6 @@ function stdAgentToolLoopPage(params) {
|
|
|
26568
26371
|
traits: [
|
|
26569
26372
|
{ ref: c.traitName },
|
|
26570
26373
|
{ ref: "ToolLoopStepProgress" },
|
|
26571
|
-
{ ref: "ToolLoopActivityLog" },
|
|
26572
26374
|
{ ref: "ToolLoopCompletionFlow" },
|
|
26573
26375
|
{ ref: "ToolLoopToolCallFlow" },
|
|
26574
26376
|
{ ref: "ToolLoopContextMonitor" }
|
|
@@ -26576,9 +26378,9 @@ function stdAgentToolLoopPage(params) {
|
|
|
26576
26378
|
};
|
|
26577
26379
|
}
|
|
26578
26380
|
function stdAgentToolLoop(params) {
|
|
26579
|
-
const c =
|
|
26381
|
+
const c = resolve95(params);
|
|
26580
26382
|
const { entityName, fields } = c;
|
|
26581
|
-
const loopTrait =
|
|
26383
|
+
const loopTrait = buildTrait73(c);
|
|
26582
26384
|
const completionTrait = extractTrait(stdAgentCompletion({
|
|
26583
26385
|
entityName,
|
|
26584
26386
|
fields,
|
|
@@ -26628,18 +26430,6 @@ function stdAgentToolLoop(params) {
|
|
|
26628
26430
|
e.scope = "internal";
|
|
26629
26431
|
}
|
|
26630
26432
|
}
|
|
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
26433
|
const entity = makeEntity({ name: entityName, fields, persistence: c.persistence });
|
|
26644
26434
|
const page = {
|
|
26645
26435
|
name: c.pageName,
|
|
@@ -26648,7 +26438,6 @@ function stdAgentToolLoop(params) {
|
|
|
26648
26438
|
traits: [
|
|
26649
26439
|
{ ref: loopTrait.name },
|
|
26650
26440
|
{ ref: stepProgressTrait.name },
|
|
26651
|
-
{ ref: activityLogTrait.name },
|
|
26652
26441
|
{ ref: completionTrait.name },
|
|
26653
26442
|
{ ref: toolCallTrait.name },
|
|
26654
26443
|
{ ref: contextTrait.name }
|
|
@@ -26657,11 +26446,11 @@ function stdAgentToolLoop(params) {
|
|
|
26657
26446
|
return makeOrbital(
|
|
26658
26447
|
`${entityName}Orbital`,
|
|
26659
26448
|
entity,
|
|
26660
|
-
[loopTrait, stepProgressTrait,
|
|
26449
|
+
[loopTrait, stepProgressTrait, completionTrait, toolCallTrait, contextTrait],
|
|
26661
26450
|
[page]
|
|
26662
26451
|
);
|
|
26663
26452
|
}
|
|
26664
|
-
function
|
|
26453
|
+
function resolve96(params) {
|
|
26665
26454
|
const entityName = params.entityName ?? "FixLoop";
|
|
26666
26455
|
const p = plural(entityName);
|
|
26667
26456
|
const requiredFields = [
|
|
@@ -26857,7 +26646,7 @@ function succeededView() {
|
|
|
26857
26646
|
{ type: "divider" },
|
|
26858
26647
|
{
|
|
26859
26648
|
type: "simple-grid",
|
|
26860
|
-
|
|
26649
|
+
cols: 2,
|
|
26861
26650
|
children: [
|
|
26862
26651
|
{ type: "stat-display", label: "Fix Attempts", value: `@entity.fixAttempts`, icon: "wrench" },
|
|
26863
26652
|
{ type: "stat-display", label: "Status", value: "Passed", icon: "check" }
|
|
@@ -26890,7 +26679,7 @@ function failedView2() {
|
|
|
26890
26679
|
{ type: "alert", variant: "error", message: `@entity.error` },
|
|
26891
26680
|
{
|
|
26892
26681
|
type: "simple-grid",
|
|
26893
|
-
|
|
26682
|
+
cols: 2,
|
|
26894
26683
|
children: [
|
|
26895
26684
|
{ type: "stat-display", label: "Attempts Used", value: `@entity.fixAttempts`, icon: "wrench" },
|
|
26896
26685
|
{ type: "stat-display", label: "Remaining Errors", value: `@entity.errorCount`, icon: "alert-triangle" }
|
|
@@ -26912,7 +26701,7 @@ function failedView2() {
|
|
|
26912
26701
|
]
|
|
26913
26702
|
};
|
|
26914
26703
|
}
|
|
26915
|
-
function
|
|
26704
|
+
function buildTrait74(c) {
|
|
26916
26705
|
const { entityName, maxAttempts, validateTool, fixTool } = c;
|
|
26917
26706
|
return {
|
|
26918
26707
|
name: c.traitName,
|
|
@@ -27106,17 +26895,17 @@ function buildTrait75(c) {
|
|
|
27106
26895
|
}
|
|
27107
26896
|
};
|
|
27108
26897
|
}
|
|
27109
|
-
function
|
|
26898
|
+
function buildEntity82(c) {
|
|
27110
26899
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
27111
26900
|
}
|
|
27112
26901
|
function stdAgentFixLoopEntity(params) {
|
|
27113
|
-
return
|
|
26902
|
+
return buildEntity82(resolve96(params));
|
|
27114
26903
|
}
|
|
27115
26904
|
function stdAgentFixLoopTrait(params) {
|
|
27116
|
-
return
|
|
26905
|
+
return buildTrait74(resolve96(params));
|
|
27117
26906
|
}
|
|
27118
26907
|
function stdAgentFixLoopPage(params) {
|
|
27119
|
-
const c =
|
|
26908
|
+
const c = resolve96(params);
|
|
27120
26909
|
return {
|
|
27121
26910
|
name: c.pageName,
|
|
27122
26911
|
path: c.pagePath,
|
|
@@ -27132,9 +26921,9 @@ function stdAgentFixLoopPage(params) {
|
|
|
27132
26921
|
};
|
|
27133
26922
|
}
|
|
27134
26923
|
function stdAgentFixLoop(params) {
|
|
27135
|
-
const c =
|
|
26924
|
+
const c = resolve96(params);
|
|
27136
26925
|
const { entityName, fields } = c;
|
|
27137
|
-
const fixTrait =
|
|
26926
|
+
const fixTrait = buildTrait74(c);
|
|
27138
26927
|
const validateCallTrait = extractTrait(stdAgentToolCall({
|
|
27139
26928
|
entityName,
|
|
27140
26929
|
fields,
|
|
@@ -27217,7 +27006,7 @@ function stdAgentFixLoop(params) {
|
|
|
27217
27006
|
[page]
|
|
27218
27007
|
);
|
|
27219
27008
|
}
|
|
27220
|
-
function
|
|
27009
|
+
function resolve97(params) {
|
|
27221
27010
|
const entityName = params.entityName ?? "Session";
|
|
27222
27011
|
const p = plural(entityName);
|
|
27223
27012
|
const requiredFields = [
|
|
@@ -27244,7 +27033,7 @@ function resolve98(params) {
|
|
|
27244
27033
|
isInitial: params.isInitial ?? false
|
|
27245
27034
|
};
|
|
27246
27035
|
}
|
|
27247
|
-
function
|
|
27036
|
+
function buildEntity83(c) {
|
|
27248
27037
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
27249
27038
|
}
|
|
27250
27039
|
function buildAgentTrait8(c) {
|
|
@@ -27397,13 +27186,13 @@ function buildAgentTrait8(c) {
|
|
|
27397
27186
|
};
|
|
27398
27187
|
}
|
|
27399
27188
|
function stdAgentSessionEntity(params = {}) {
|
|
27400
|
-
return
|
|
27189
|
+
return buildEntity83(resolve97(params));
|
|
27401
27190
|
}
|
|
27402
27191
|
function stdAgentSessionTrait(params = {}) {
|
|
27403
|
-
return buildAgentTrait8(
|
|
27192
|
+
return buildAgentTrait8(resolve97(params));
|
|
27404
27193
|
}
|
|
27405
27194
|
function stdAgentSessionPage(params = {}) {
|
|
27406
|
-
const c =
|
|
27195
|
+
const c = resolve97(params);
|
|
27407
27196
|
return {
|
|
27408
27197
|
name: c.pageName,
|
|
27409
27198
|
path: c.pagePath,
|
|
@@ -27416,7 +27205,7 @@ function stdAgentSessionPage(params = {}) {
|
|
|
27416
27205
|
};
|
|
27417
27206
|
}
|
|
27418
27207
|
function stdAgentSession(params = {}) {
|
|
27419
|
-
const c =
|
|
27208
|
+
const c = resolve97(params);
|
|
27420
27209
|
const { entityName, fields } = c;
|
|
27421
27210
|
const browseTrait = extractTrait(stdBrowse({
|
|
27422
27211
|
entityName,
|
|
@@ -27475,7 +27264,7 @@ function stdAgentSession(params = {}) {
|
|
|
27475
27264
|
emitOnSave: "LABELED"
|
|
27476
27265
|
}));
|
|
27477
27266
|
const agentTrait = buildAgentTrait8(c);
|
|
27478
|
-
const entity =
|
|
27267
|
+
const entity = buildEntity83(c);
|
|
27479
27268
|
const page = {
|
|
27480
27269
|
name: c.pageName,
|
|
27481
27270
|
path: c.pagePath,
|
|
@@ -27614,7 +27403,7 @@ function stdAgentBuilder(params = {}) {
|
|
|
27614
27403
|
fix: "wrench"
|
|
27615
27404
|
}));
|
|
27616
27405
|
}
|
|
27617
|
-
function
|
|
27406
|
+
function resolve98(params) {
|
|
27618
27407
|
const entityName = params.entityName ?? "SearchResult";
|
|
27619
27408
|
const p = plural(entityName);
|
|
27620
27409
|
const requiredFields = [
|
|
@@ -27640,7 +27429,7 @@ function resolve99(params) {
|
|
|
27640
27429
|
isInitial: params.isInitial ?? false
|
|
27641
27430
|
};
|
|
27642
27431
|
}
|
|
27643
|
-
function
|
|
27432
|
+
function buildEntity84(c) {
|
|
27644
27433
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
27645
27434
|
}
|
|
27646
27435
|
function buildAgentTrait9(c) {
|
|
@@ -27728,13 +27517,13 @@ function buildAgentTrait9(c) {
|
|
|
27728
27517
|
};
|
|
27729
27518
|
}
|
|
27730
27519
|
function stdAgentSearchEntity(params = {}) {
|
|
27731
|
-
return
|
|
27520
|
+
return buildEntity84(resolve98(params));
|
|
27732
27521
|
}
|
|
27733
27522
|
function stdAgentSearchTrait(params = {}) {
|
|
27734
|
-
return buildAgentTrait9(
|
|
27523
|
+
return buildAgentTrait9(resolve98(params));
|
|
27735
27524
|
}
|
|
27736
27525
|
function stdAgentSearchPage(params = {}) {
|
|
27737
|
-
const c =
|
|
27526
|
+
const c = resolve98(params);
|
|
27738
27527
|
return {
|
|
27739
27528
|
name: c.pageName,
|
|
27740
27529
|
path: c.pagePath,
|
|
@@ -27746,7 +27535,7 @@ function stdAgentSearchPage(params = {}) {
|
|
|
27746
27535
|
};
|
|
27747
27536
|
}
|
|
27748
27537
|
function stdAgentSearch(params = {}) {
|
|
27749
|
-
const c =
|
|
27538
|
+
const c = resolve98(params);
|
|
27750
27539
|
const { entityName, fields } = c;
|
|
27751
27540
|
const browseTrait = extractTrait(stdBrowse({
|
|
27752
27541
|
entityName,
|
|
@@ -27767,7 +27556,7 @@ function stdAgentSearch(params = {}) {
|
|
|
27767
27556
|
refreshEvents: ["SEARCHED"]
|
|
27768
27557
|
}));
|
|
27769
27558
|
const agentTrait = buildAgentTrait9(c);
|
|
27770
|
-
const entity =
|
|
27559
|
+
const entity = buildEntity84(c);
|
|
27771
27560
|
const page = {
|
|
27772
27561
|
name: c.pageName,
|
|
27773
27562
|
path: c.pagePath,
|
|
@@ -27781,7 +27570,7 @@ function stdAgentSearch(params = {}) {
|
|
|
27781
27570
|
}
|
|
27782
27571
|
|
|
27783
27572
|
// behaviors/functions/molecules/std-agent-rag.ts
|
|
27784
|
-
function
|
|
27573
|
+
function resolve99(params) {
|
|
27785
27574
|
const entityName = params.entityName ?? "RagRequest";
|
|
27786
27575
|
const p = plural(entityName);
|
|
27787
27576
|
const requiredFields = [
|
|
@@ -28108,17 +27897,17 @@ function buildRagTrait(c) {
|
|
|
28108
27897
|
}
|
|
28109
27898
|
};
|
|
28110
27899
|
}
|
|
28111
|
-
function
|
|
27900
|
+
function buildEntity85(c) {
|
|
28112
27901
|
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
28113
27902
|
}
|
|
28114
27903
|
function stdAgentRagEntity(params) {
|
|
28115
|
-
return
|
|
27904
|
+
return buildEntity85(resolve99(params));
|
|
28116
27905
|
}
|
|
28117
27906
|
function stdAgentRagTrait(params) {
|
|
28118
|
-
return buildRagTrait(
|
|
27907
|
+
return buildRagTrait(resolve99(params));
|
|
28119
27908
|
}
|
|
28120
27909
|
function stdAgentRagPage(params) {
|
|
28121
|
-
const c =
|
|
27910
|
+
const c = resolve99(params);
|
|
28122
27911
|
return {
|
|
28123
27912
|
name: c.pageName,
|
|
28124
27913
|
path: c.pagePath,
|
|
@@ -28133,7 +27922,7 @@ function stdAgentRagPage(params) {
|
|
|
28133
27922
|
};
|
|
28134
27923
|
}
|
|
28135
27924
|
function stdAgentRag(params) {
|
|
28136
|
-
const c =
|
|
27925
|
+
const c = resolve99(params);
|
|
28137
27926
|
const { entityName, fields } = c;
|
|
28138
27927
|
const ragTrait = buildRagTrait(c);
|
|
28139
27928
|
const memoryTrait = extractTrait(stdAgentMemory({
|
|
@@ -29189,6 +28978,185 @@ function stdAgentTutor(params = {}) {
|
|
|
29189
28978
|
concepts: "brain"
|
|
29190
28979
|
}));
|
|
29191
28980
|
}
|
|
28981
|
+
function resolve100(params) {
|
|
28982
|
+
const entityName = params.entityName ?? "ActivityEntry";
|
|
28983
|
+
const p = plural(entityName);
|
|
28984
|
+
const requiredFields = [
|
|
28985
|
+
{ name: "action", type: "string", default: "" },
|
|
28986
|
+
{ name: "detail", type: "string", default: "" },
|
|
28987
|
+
{ name: "status", type: "string", default: "pending" },
|
|
28988
|
+
{ name: "timestamp", type: "string", default: "" },
|
|
28989
|
+
{ name: "duration", type: "number", default: 0 },
|
|
28990
|
+
{ name: "icon", type: "string", default: "circle" }
|
|
28991
|
+
];
|
|
28992
|
+
const baseFields = params.fields ?? [];
|
|
28993
|
+
const existingNames = new Set(baseFields.map((f) => f.name));
|
|
28994
|
+
const mergedFields = [
|
|
28995
|
+
...baseFields,
|
|
28996
|
+
...requiredFields.filter((f) => !existingNames.has(f.name))
|
|
28997
|
+
];
|
|
28998
|
+
const fields = ensureIdField(mergedFields);
|
|
28999
|
+
return {
|
|
29000
|
+
entityName,
|
|
29001
|
+
fields,
|
|
29002
|
+
persistence: params.persistence ?? "persistent",
|
|
29003
|
+
traitName: `${entityName}Log`,
|
|
29004
|
+
pluralName: p,
|
|
29005
|
+
pageName: params.pageName ?? `${entityName}Page`,
|
|
29006
|
+
pagePath: params.pagePath ?? `/${p.toLowerCase()}`,
|
|
29007
|
+
isInitial: params.isInitial ?? false
|
|
29008
|
+
};
|
|
29009
|
+
}
|
|
29010
|
+
function buildEntity86(c) {
|
|
29011
|
+
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence });
|
|
29012
|
+
}
|
|
29013
|
+
function buildTrait75(c) {
|
|
29014
|
+
const { entityName } = c;
|
|
29015
|
+
const loggingUI = {
|
|
29016
|
+
type: "stack",
|
|
29017
|
+
direction: "vertical",
|
|
29018
|
+
gap: "lg",
|
|
29019
|
+
children: [
|
|
29020
|
+
{
|
|
29021
|
+
type: "stack",
|
|
29022
|
+
direction: "horizontal",
|
|
29023
|
+
gap: "sm",
|
|
29024
|
+
justify: "space-between",
|
|
29025
|
+
align: "center",
|
|
29026
|
+
children: [
|
|
29027
|
+
{
|
|
29028
|
+
type: "stack",
|
|
29029
|
+
direction: "horizontal",
|
|
29030
|
+
gap: "sm",
|
|
29031
|
+
align: "center",
|
|
29032
|
+
children: [
|
|
29033
|
+
{ type: "icon", name: "activity", size: "lg" },
|
|
29034
|
+
{ type: "typography", content: "Activity Log", variant: "h2" }
|
|
29035
|
+
]
|
|
29036
|
+
},
|
|
29037
|
+
{ type: "button", label: "Clear", event: "CLEAR", variant: "ghost", icon: "trash" }
|
|
29038
|
+
]
|
|
29039
|
+
},
|
|
29040
|
+
{ type: "divider" },
|
|
29041
|
+
{
|
|
29042
|
+
type: "timeline",
|
|
29043
|
+
entity: entityName,
|
|
29044
|
+
emptyIcon: "activity",
|
|
29045
|
+
emptyTitle: "No activity yet",
|
|
29046
|
+
emptyDescription: "Agent actions will appear here as they occur.",
|
|
29047
|
+
renderItem: ["fn", "item", {
|
|
29048
|
+
type: "stack",
|
|
29049
|
+
direction: "vertical",
|
|
29050
|
+
gap: "xs",
|
|
29051
|
+
children: [
|
|
29052
|
+
{
|
|
29053
|
+
type: "stack",
|
|
29054
|
+
direction: "horizontal",
|
|
29055
|
+
gap: "sm",
|
|
29056
|
+
align: "center",
|
|
29057
|
+
children: [
|
|
29058
|
+
{ type: "badge", label: "@item.status" },
|
|
29059
|
+
{ type: "typography", variant: "h4", content: "@item.action" }
|
|
29060
|
+
]
|
|
29061
|
+
},
|
|
29062
|
+
{ type: "typography", variant: "body", color: "muted", content: "@item.detail" },
|
|
29063
|
+
{
|
|
29064
|
+
type: "stack",
|
|
29065
|
+
direction: "horizontal",
|
|
29066
|
+
gap: "sm",
|
|
29067
|
+
align: "center",
|
|
29068
|
+
children: [
|
|
29069
|
+
{ type: "typography", variant: "caption", color: "muted", content: "@item.timestamp" },
|
|
29070
|
+
{ type: "badge", label: "@item.duration", variant: "outline" }
|
|
29071
|
+
]
|
|
29072
|
+
}
|
|
29073
|
+
]
|
|
29074
|
+
}]
|
|
29075
|
+
}
|
|
29076
|
+
]
|
|
29077
|
+
};
|
|
29078
|
+
return {
|
|
29079
|
+
name: c.traitName,
|
|
29080
|
+
linkedEntity: entityName,
|
|
29081
|
+
category: "interaction",
|
|
29082
|
+
emits: [
|
|
29083
|
+
{ event: "LOG_ENTRY", scope: "external", payload: [
|
|
29084
|
+
{ name: "action", type: "string" },
|
|
29085
|
+
{ name: "detail", type: "string" },
|
|
29086
|
+
{ name: "status", type: "string" }
|
|
29087
|
+
] }
|
|
29088
|
+
],
|
|
29089
|
+
listens: [
|
|
29090
|
+
{ event: "LOG_ENTRY", triggers: "LOG_ENTRY", scope: "external" }
|
|
29091
|
+
],
|
|
29092
|
+
stateMachine: {
|
|
29093
|
+
states: [
|
|
29094
|
+
{ name: "logging", isInitial: true }
|
|
29095
|
+
],
|
|
29096
|
+
events: [
|
|
29097
|
+
{ key: "INIT", name: "Initialize" },
|
|
29098
|
+
{ key: "LOG_ENTRY", name: "Log Entry", payload: [
|
|
29099
|
+
{ name: "action", type: "string", required: true },
|
|
29100
|
+
{ name: "detail", type: "string", required: true },
|
|
29101
|
+
{ name: "status", type: "string", required: true }
|
|
29102
|
+
] },
|
|
29103
|
+
{ key: "CLEAR", name: "Clear Log" }
|
|
29104
|
+
],
|
|
29105
|
+
transitions: [
|
|
29106
|
+
{
|
|
29107
|
+
from: "logging",
|
|
29108
|
+
to: "logging",
|
|
29109
|
+
event: "INIT",
|
|
29110
|
+
effects: [
|
|
29111
|
+
["fetch", entityName],
|
|
29112
|
+
["render-ui", "main", loggingUI]
|
|
29113
|
+
]
|
|
29114
|
+
},
|
|
29115
|
+
{
|
|
29116
|
+
from: "logging",
|
|
29117
|
+
to: "logging",
|
|
29118
|
+
event: "LOG_ENTRY",
|
|
29119
|
+
effects: [
|
|
29120
|
+
["persist", "create", entityName, {
|
|
29121
|
+
action: "@payload.action",
|
|
29122
|
+
detail: "@payload.detail",
|
|
29123
|
+
status: "@payload.status",
|
|
29124
|
+
timestamp: "@now"
|
|
29125
|
+
}],
|
|
29126
|
+
["fetch", entityName],
|
|
29127
|
+
["render-ui", "main", loggingUI]
|
|
29128
|
+
]
|
|
29129
|
+
},
|
|
29130
|
+
{
|
|
29131
|
+
from: "logging",
|
|
29132
|
+
to: "logging",
|
|
29133
|
+
event: "CLEAR",
|
|
29134
|
+
effects: [
|
|
29135
|
+
["persist", "delete", entityName],
|
|
29136
|
+
["fetch", entityName],
|
|
29137
|
+
["render-ui", "main", loggingUI]
|
|
29138
|
+
]
|
|
29139
|
+
}
|
|
29140
|
+
]
|
|
29141
|
+
}
|
|
29142
|
+
};
|
|
29143
|
+
}
|
|
29144
|
+
function buildPage73(c) {
|
|
29145
|
+
return makePage({ name: c.pageName, path: c.pagePath, traitName: c.traitName, isInitial: c.isInitial });
|
|
29146
|
+
}
|
|
29147
|
+
function stdAgentActivityLogEntity(params = {}) {
|
|
29148
|
+
return buildEntity86(resolve100(params));
|
|
29149
|
+
}
|
|
29150
|
+
function stdAgentActivityLogTrait(params = {}) {
|
|
29151
|
+
return buildTrait75(resolve100(params));
|
|
29152
|
+
}
|
|
29153
|
+
function stdAgentActivityLogPage(params = {}) {
|
|
29154
|
+
return buildPage73(resolve100(params));
|
|
29155
|
+
}
|
|
29156
|
+
function stdAgentActivityLog(params = {}) {
|
|
29157
|
+
const c = resolve100(params);
|
|
29158
|
+
return makeOrbital(`${c.entityName}Orbital`, buildEntity86(c), [buildTrait75(c)], [buildPage73(c)]);
|
|
29159
|
+
}
|
|
29192
29160
|
function resolve101(params) {
|
|
29193
29161
|
const entityName = params.entityName ?? "LearningRecord";
|
|
29194
29162
|
const p = plural(entityName);
|
|
@@ -29219,7 +29187,8 @@ function resolve101(params) {
|
|
|
29219
29187
|
{ name: "action", type: "string", default: "" },
|
|
29220
29188
|
{ name: "detail", type: "string", default: "" },
|
|
29221
29189
|
{ name: "timestamp", type: "string", default: "" },
|
|
29222
|
-
{ name: "duration", type: "number", default: 0 }
|
|
29190
|
+
{ name: "duration", type: "number", default: 0 },
|
|
29191
|
+
{ name: "icon", type: "string", default: "circle" }
|
|
29223
29192
|
];
|
|
29224
29193
|
const baseFields = ensureIdField(params.fields ?? []);
|
|
29225
29194
|
const userFieldNames = new Set(baseFields.map((f) => f.name));
|
|
@@ -29259,7 +29228,7 @@ function idleView5(_entityName) {
|
|
|
29259
29228
|
{ type: "divider" },
|
|
29260
29229
|
{
|
|
29261
29230
|
type: "simple-grid",
|
|
29262
|
-
|
|
29231
|
+
cols: 3,
|
|
29263
29232
|
children: [
|
|
29264
29233
|
{ type: "stat-display", label: "Successes", value: `@entity.totalSuccesses`, icon: "check-circle" },
|
|
29265
29234
|
{ type: "stat-display", label: "Failures", value: `@entity.totalFailures`, icon: "x-circle" },
|
|
@@ -29533,7 +29502,6 @@ function stdAgentLearnerPage(params) {
|
|
|
29533
29502
|
...c.isInitial ? { isInitial: true } : {},
|
|
29534
29503
|
traits: [
|
|
29535
29504
|
{ ref: c.traitName },
|
|
29536
|
-
{ ref: "LearnerActivityLog" },
|
|
29537
29505
|
{ ref: "LearnerRecordsBrowse" },
|
|
29538
29506
|
{ ref: "LearnerMemoryLifecycle" },
|
|
29539
29507
|
{ ref: "LearnerCompletionFlow" },
|
|
@@ -29581,18 +29549,6 @@ function stdAgentLearner(params) {
|
|
|
29581
29549
|
e.scope = "internal";
|
|
29582
29550
|
}
|
|
29583
29551
|
}
|
|
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
29552
|
const recordsBrowseTrait = extractTrait(stdBrowse({
|
|
29597
29553
|
entityName,
|
|
29598
29554
|
fields,
|
|
@@ -29612,7 +29568,6 @@ function stdAgentLearner(params) {
|
|
|
29612
29568
|
...c.isInitial ? { isInitial: true } : {},
|
|
29613
29569
|
traits: [
|
|
29614
29570
|
{ ref: learnerTrait.name },
|
|
29615
|
-
{ ref: activityLogTrait.name },
|
|
29616
29571
|
{ ref: recordsBrowseTrait.name },
|
|
29617
29572
|
{ ref: memoryTrait.name },
|
|
29618
29573
|
{ ref: completionTrait.name },
|
|
@@ -29622,7 +29577,7 @@ function stdAgentLearner(params) {
|
|
|
29622
29577
|
return makeOrbital(
|
|
29623
29578
|
`${entityName}Orbital`,
|
|
29624
29579
|
entity,
|
|
29625
|
-
[learnerTrait,
|
|
29580
|
+
[learnerTrait, recordsBrowseTrait, memoryTrait, completionTrait, providerTrait],
|
|
29626
29581
|
[page]
|
|
29627
29582
|
);
|
|
29628
29583
|
}
|