@onetype/framework 2.0.42 → 2.0.43
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/addons/ai/addon.js +78 -0
- package/addons/ai/addons/agents/item/functions/describe.js +28 -0
- package/addons/ai/addons/agents/item/functions/execute.js +41 -0
- package/addons/ai/addons/agents/item/functions/messages.js +38 -0
- package/addons/ai/addons/agents/item/functions/run.js +49 -0
- package/addons/ai/addons/agents/item/functions/schema.js +45 -0
- package/addons/ai/addons/agents/load.js +9 -0
- package/addons/ai/addons/orchestrators/item/functions/agents/execute.js +14 -0
- package/addons/ai/addons/orchestrators/item/functions/agents/steps.js +23 -0
- package/addons/ai/addons/orchestrators/item/functions/modes/action.js +131 -0
- package/addons/ai/addons/orchestrators/item/functions/run.js +28 -0
- package/addons/ai/addons/orchestrators/item/functions/utils/emit.js +11 -0
- package/addons/ai/addons/orchestrators/item/functions/utils/history.js +8 -0
- package/addons/ai/addons/orchestrators/item/functions/utils/state.js +29 -0
- package/addons/ai/addons/orchestrators/load.js +15 -0
- package/addons/ai/addons/pipelines/functions/execute.js +56 -0
- package/addons/ai/addons/pipelines/functions/run.js +72 -0
- package/addons/ai/addons/pipelines/load.js +6 -0
- package/addons/ai/addons/providers/functions/default.js +8 -0
- package/addons/ai/addons/providers/item/functions/request.js +108 -0
- package/addons/ai/addons/providers/items/nue.js +69 -0
- package/addons/ai/addons/providers/items/ollama.js +79 -0
- package/addons/ai/addons/providers/load.js +8 -0
- package/addons/ai/items/agents/steps.js +159 -0
- package/addons/ai/items/agents/summary.js +29 -0
- package/addons/ai/items/orchestrators/general.js +7 -0
- package/addons/ai/load.js +13 -0
- package/addons/ai/test/agents.js +149 -0
- package/addons/ai/test/index.js +63 -0
- package/addons/core/assets/back/functions/utils/transform.js +21 -23
- package/addons/core/assets/back/items/html/css.js +2 -2
- package/addons/core/assets/back/items/html/js.js +2 -2
- package/addons/core/clients/back/http/item/functions/gRPC/create.js +3 -3
- package/addons/core/clients/back/http/item/functions/http/create.js +3 -3
- package/addons/core/commands/back/functions/grpc/client.js +3 -3
- package/addons/core/commands/back/functions/grpc/server.js +2 -2
- package/addons/core/commands/core/addon.js +4 -1
- package/addons/core/commands/core/functions/run.js +1 -1
- package/addons/core/commands/core/item/functions/run.js +1 -1
- package/addons/core/commands/core/load.js +27 -9
- package/addons/core/database/back/events/addon.add.js +1 -1
- package/addons/core/database/back/events/middleware/addon.items.find.js +2 -2
- package/addons/core/database/back/events/middleware/item.crud.create.js +2 -2
- package/addons/core/database/back/events/middleware/item.crud.delete.js +2 -2
- package/addons/core/database/back/events/middleware/item.crud.update.js +2 -2
- package/addons/core/database/back/item/functions/create.js +4 -3
- package/addons/core/database/back/item/functions/delete.js +1 -1
- package/addons/core/database/back/item/functions/find.js +1 -1
- package/addons/core/database/back/item/functions/update.js +3 -3
- package/addons/core/database/front/events/addon.add.js +1 -1
- package/addons/core/servers/back/grpc/item/functions/start.js +1 -1
- package/addons/core/servers/back/http/item/functions/start.js +6 -6
- package/addons/float/overlays/css/overlay.css +35 -0
- package/addons/float/overlays/js/addon.js +18 -0
- package/addons/float/overlays/js/events/click.js +27 -0
- package/addons/float/overlays/js/events/escape.js +18 -0
- package/addons/float/overlays/js/functions/flip.js +51 -0
- package/addons/float/overlays/js/functions/index.js +17 -0
- package/addons/float/overlays/js/functions/position.js +62 -0
- package/addons/float/overlays/js/functions/reposition.js +29 -0
- package/addons/float/overlays/js/item/catch/add.js +123 -0
- package/addons/float/overlays/js/item/catch/remove.js +29 -0
- package/addons/float/popup/css/popup.css +93 -0
- package/addons/float/popup/js/addon.js +34 -0
- package/addons/float/popup/js/functions/close.js +25 -0
- package/addons/float/popup/js/functions/modal.js +31 -0
- package/addons/float/popup/js/functions/popup.js +21 -0
- package/addons/float/popup/js/functions/toast.js +55 -0
- package/addons/float/popup/js/functions/tooltip.js +34 -0
- package/addons/float/popup/js/items/directives/popup.js +58 -0
- package/addons/float/popup/js/items/directives/tooltip.js +72 -0
- package/addons/render/directives/front/{js/#register/addon.js → addon.js} +8 -8
- package/addons/render/directives/front/{js/functions → functions}/process/attributes.js +7 -2
- package/addons/render/directives/front/{js/functions → functions}/process/match.js +8 -8
- package/addons/render/directives/front/functions/process.js +88 -0
- package/{lib/items/directives → addons/render/directives/front/items/self}/1000-render.js +1 -0
- package/{lib/items/directives → addons/render/directives/front/items/self}/110-show.js +3 -5
- package/{lib/items/directives → addons/render/directives/front/items/self}/160-slot.js +1 -0
- package/{lib/items/directives → addons/render/directives/front/items/self}/200-for.js +3 -3
- package/addons/render/directives/front/items/self/500-click-outside.js +45 -0
- package/addons/render/directives/front/items/self/500-events.js +68 -0
- package/addons/render/directives/front/items/self/500-mouse-enter.js +62 -0
- package/addons/render/directives/front/items/self/500-mouse-leave.js +62 -0
- package/{lib/items/directives → addons/render/directives/front/items/self}/650-fetch.js +2 -3
- package/{lib/items/directives → addons/render/directives/front/items/self}/660-form.js +5 -6
- package/addons/render/{elements/front/items/directives → directives/front/items/self}/element.js +7 -1
- package/addons/render/directives/front/items/self/node.js +43 -0
- package/{lib/items/elements → addons/render/elements/front/items/self}/cards/pricing/pricing.js +2 -2
- package/addons/render/elements/front/items/self/core/builder/builder.css +180 -0
- package/addons/render/elements/front/items/self/core/builder/builder.js +257 -0
- package/addons/render/elements/front/items/self/core/repeater/repeater.css +197 -0
- package/addons/render/elements/front/items/self/core/repeater/repeater.js +224 -0
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/button/button.js +2 -2
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/checkbox/checkbox.js +21 -8
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/color/color.css +28 -0
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/color/color.js +35 -13
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/date/date.js +3 -4
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/input/input.js +40 -4
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/radio/radio.js +24 -6
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/rating/rating.js +2 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/select/select.js +3 -7
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/slider/slider.js +89 -74
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/tags/tags.js +5 -5
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/textarea/textarea.js +41 -6
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/toggle/toggle.css +4 -0
- package/{lib/items/elements → addons/render/elements/front/items/self}/form/toggle/toggle.js +7 -8
- package/{lib/items/elements → addons/render/elements/front/items/self}/global/code/code.js +3 -4
- package/{lib/items/elements → addons/render/elements/front/items/self}/global/faq/faq.js +2 -2
- package/{lib/items/elements → addons/render/elements/front/items/self}/global/heading/heading.js +6 -17
- package/addons/render/elements/front/items/self/global/markdown/markdown.js +26 -0
- package/{lib/items/elements → addons/render/elements/front/items/self}/global/menu/menu.js +1 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/global/tags/tags.js +1 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/navigation/navbar/navbar.js +5 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/navigation/sidebar/sidebar.js +1 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/navigation/tabs/tabs.js +1 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/status/code/code.css +1 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/status/empty/empty.css +1 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/status/empty/empty.js +4 -0
- package/{lib/items/elements → addons/render/elements/front/items/self}/status/error/error.css +1 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/status/error/error.js +1 -1
- package/{lib/items/elements → addons/render/elements/front/items/self}/status/loading/loading.css +8 -1
- package/addons/render/pages/core/load.js +1 -1
- package/addons/render/pages/front/events/click.js +1 -1
- package/addons/render/pages/front/events/load.js +6 -16
- package/addons/render/pages/front/functions/change.js +21 -110
- package/addons/render/pages/front/functions/match.js +2 -3
- package/addons/render/pages/front/functions/open.js +3 -35
- package/addons/render/pages/front/functions/resolve.js +30 -0
- package/addons/render/pages/front/item/catch/add.js +12 -10
- package/addons/render/pages/front/item/catch/remove.js +5 -7
- package/addons/render/pages/front/item/functions/enter.js +15 -28
- package/addons/render/pages/front/item/functions/leave.js +6 -8
- package/addons/render/pages/front/items/commands/change.js +60 -0
- package/addons/render/pages/front/items/commands/list.js +38 -0
- package/addons/render/pages/front/items/directives/change.js +1 -1
- package/addons/render/transforms/css/transforms.css +4 -0
- package/addons/render/transforms/{addon.js → js/addon.js} +7 -0
- package/addons/render/transforms/js/item/functions/run.js +87 -0
- package/addons/services/cloudflare/images/back/addon.js +23 -0
- package/addons/services/cloudflare/images/back/expose.js +22 -0
- package/addons/services/cloudflare/images/back/functions/api.js +47 -0
- package/addons/services/cloudflare/images/back/functions/meta/detect.js +28 -0
- package/addons/services/cloudflare/images/back/functions/meta/dimensions/gif.js +11 -0
- package/addons/services/cloudflare/images/back/functions/meta/dimensions/jpeg.js +31 -0
- package/addons/services/cloudflare/images/back/functions/meta/dimensions/png.js +11 -0
- package/addons/services/cloudflare/images/back/functions/meta/dimensions/webp.js +36 -0
- package/addons/services/cloudflare/images/back/functions/meta.js +16 -0
- package/addons/services/cloudflare/images/back/items/commands/delete.js +38 -0
- package/addons/services/cloudflare/images/back/items/commands/get.js +56 -0
- package/addons/services/cloudflare/images/back/items/commands/list.js +49 -0
- package/addons/services/cloudflare/images/back/items/commands/upload.js +79 -0
- package/addons/services/cloudflare/images/back/load.js +21 -0
- package/addons/services/cloudflare/images/front/items/elements/browse/browse.css +235 -0
- package/addons/services/cloudflare/images/front/items/elements/browse/browse.js +193 -0
- package/addons/services/cloudflare/images/front/items/elements/input/input.css +154 -0
- package/addons/services/cloudflare/images/front/items/elements/input/input.js +147 -0
- package/addons/services/cloudflare/images/sql.txt +43 -0
- package/lib/events.js +12 -12
- package/lib/load.js +11 -49
- package/lib/src/classes/addon/class.js +1 -2
- package/lib/src/classes/addon/classes/item/mixins/get.js +3 -3
- package/lib/src/classes/addon/classes/item/mixins/set.js +3 -5
- package/lib/src/classes/addon/classes/item/mixins/store.js +1 -1
- package/lib/src/classes/addon/classes/render/class.js +8 -22
- package/lib/src/classes/addon/classes/render/mixins/compile.js +6 -4
- package/lib/src/classes/addon/classes/render/mixins/dom.js +3 -1
- package/lib/src/classes/addon/classes/render/mixins/events.js +30 -43
- package/lib/src/classes/addon/classes/render/mixins/get.js +0 -5
- package/lib/src/classes/addon/classes/render/mixins/methods.js +105 -40
- package/lib/src/classes/addon/classes/render/mixins/process.js +7 -3
- package/lib/src/classes/addon/classes/render/mixins/set.js +3 -1
- package/lib/src/classes/addon/mixins/fields.js +4 -6
- package/lib/src/classes/addon/mixins/functions.js +11 -11
- package/lib/src/classes/addon/mixins/items.js +17 -9
- package/lib/src/classes/addon/mixins/render.js +1 -1
- package/lib/src/classes/addon/mixins/table.js +1 -1
- package/lib/src/classes/error/class.js +10 -0
- package/lib/src/mixins/addons.js +7 -20
- package/lib/src/mixins/assets.js +1 -1
- package/lib/src/mixins/data.js +14 -14
- package/lib/src/mixins/dependencies.js +5 -5
- package/lib/src/mixins/dom.js +204 -201
- package/lib/src/mixins/emitter.js +13 -14
- package/lib/src/mixins/error.js +14 -1
- package/lib/src/mixins/function.js +1 -0
- package/lib/src/mixins/generate.js +1 -1
- package/lib/src/mixins/helper.js +3 -31
- package/lib/{items/elements/global/markdown → src/mixins}/markdown.js +90 -139
- package/lib/src/mixins/middleware.js +2 -2
- package/lib/src/mixins/observer.js +337 -0
- package/lib/src/mixins/request.js +2 -2
- package/lib/src/mixins/route.js +11 -2
- package/lib/src/mixins/state.js +17 -3
- package/lib/src/onetype.js +11 -18
- package/lib/styles/classes/layout.css +1 -3
- package/lib/styles/variables.css +2 -1
- package/package.json +5 -7
- package/README.md +0 -86
- package/addons/ai/agents/addon.js +0 -23
- package/addons/ai/agents/functions/parse.js +0 -129
- package/addons/ai/agents/item/functions/run.js +0 -218
- package/addons/ai/agents/load.js +0 -8
- package/addons/ai/orchestrator/addon.js +0 -25
- package/addons/ai/orchestrator/item/functions/run.js +0 -277
- package/addons/ai/orchestrator/item/functions/state/agent.js +0 -41
- package/addons/ai/orchestrator/item/functions/state/conclusion.js +0 -27
- package/addons/ai/orchestrator/item/functions/state/done.js +0 -40
- package/addons/ai/orchestrator/item/functions/state/execute.js +0 -16
- package/addons/ai/orchestrator/item/functions/state/goal.js +0 -34
- package/addons/ai/orchestrator/item/functions/state/input.js +0 -55
- package/addons/ai/orchestrator/item/functions/state/summary.js +0 -26
- package/addons/ai/orchestrator/items/agents/achievable.js +0 -37
- package/addons/ai/orchestrator/items/agents/agent.js +0 -46
- package/addons/ai/orchestrator/items/agents/conclusion.js +0 -41
- package/addons/ai/orchestrator/items/agents/done.js +0 -40
- package/addons/ai/orchestrator/items/agents/goal.js +0 -58
- package/addons/ai/orchestrator/items/agents/input.js +0 -34
- package/addons/ai/orchestrator/items/agents/planner.js +0 -30
- package/addons/ai/orchestrator/items/agents/summary.js +0 -29
- package/addons/ai/orchestrator/items/chat.js +0 -10
- package/addons/ai/orchestrator/load.js +0 -25
- package/addons/ai/providers/addon.js +0 -16
- package/addons/ai/providers/functions/default.js +0 -14
- package/addons/ai/providers/item/functions/request.js +0 -62
- package/addons/ai/providers/items/nue.js +0 -98
- package/addons/ai/providers/load.js +0 -10
- package/addons/core/queue/index.js +0 -66
- package/addons/float/modals/front/css/modals.css +0 -26
- package/addons/float/modals/front/js/addon.js +0 -10
- package/addons/float/modals/front/js/item/catch/add.js +0 -48
- package/addons/float/modals/front/js/item/catch/remove.js +0 -9
- package/addons/float/overlays/front/css/overlays.css +0 -29
- package/addons/float/overlays/front/js/addon.js +0 -17
- package/addons/float/overlays/front/js/events/click.js +0 -27
- package/addons/float/overlays/front/js/events/escape.js +0 -18
- package/addons/float/overlays/front/js/functions/flip.js +0 -74
- package/addons/float/overlays/front/js/functions/index.js +0 -17
- package/addons/float/overlays/front/js/functions/position.js +0 -63
- package/addons/float/overlays/front/js/item/catch/add.js +0 -121
- package/addons/float/overlays/front/js/item/catch/remove.js +0 -16
- package/addons/float/popups/css/popups.css +0 -4
- package/addons/float/popups/js/addon.js +0 -18
- package/addons/float/popups/js/item/catch/add.js +0 -7
- package/addons/float/popups/js/item/catch/remove.js +0 -7
- package/addons/float/popups/js/item/catch/set.js +0 -73
- package/addons/float/popups/js/items/directives/popup.js +0 -54
- package/addons/float/toasts/addon.js +0 -17
- package/addons/float/toasts/item/catch/add.js +0 -7
- package/addons/float/toasts/item/catch/remove.js +0 -7
- package/addons/float/toasts/item/catch/set.js +0 -86
- package/addons/float/toasts/items/elements/toast/toast.css +0 -84
- package/addons/float/toasts/items/elements/toast/toast.js +0 -61
- package/addons/float/tooltips/addon.js +0 -15
- package/addons/float/tooltips/item/catch/add.js +0 -7
- package/addons/float/tooltips/item/catch/remove.js +0 -26
- package/addons/float/tooltips/item/catch/set.js +0 -65
- package/addons/float/tooltips/items/directives/tooltip.js +0 -74
- package/addons/float/tooltips/items/elements/tooltip.css +0 -64
- package/addons/float/tooltips/items/elements/tooltip.js +0 -42
- package/addons/render/directives/front/js/functions/process.js +0 -57
- package/addons/render/transforms/item/functions/run.js +0 -18
- package/docs/addons.md +0 -281
- package/docs/architecture.md +0 -238
- package/docs/commands.md +0 -308
- package/docs/database.md +0 -171
- package/docs/frontend.md +0 -396
- package/docs/servers.md +0 -187
- package/examples/basic-api/README.md +0 -34
- package/examples/basic-api/addons/tasks/addon.js +0 -10
- package/examples/basic-api/addons/tasks/items/commands/create.js +0 -22
- package/examples/basic-api/addons/tasks/items/commands/delete.js +0 -26
- package/examples/basic-api/addons/tasks/items/commands/list.js +0 -17
- package/examples/basic-api/addons/tasks/items/commands/toggle.js +0 -26
- package/examples/basic-api/addons/tasks/load.js +0 -8
- package/examples/basic-api/index.js +0 -15
- package/examples/basic-api/package.json +0 -7
- package/examples/basic-front/back/assets.js +0 -12
- package/examples/basic-front/back/index.js +0 -13
- package/examples/basic-front/back/items/commands/html.js +0 -14
- package/examples/basic-front/back/items/commands/test.js +0 -19
- package/examples/basic-front/back/items/html/fonts.js +0 -12
- package/examples/basic-front/front/pages/home.js +0 -16
- package/examples/basic-front/front/styles/main.css +0 -31
- package/examples/basic-front/front/test.js +0 -7
- package/examples/basic-front/package.json +0 -7
- package/lib/items/directives/500-blur.js +0 -46
- package/lib/items/directives/500-change.js +0 -53
- package/lib/items/directives/500-click-outside.js +0 -50
- package/lib/items/directives/500-click.js +0 -52
- package/lib/items/directives/500-double-click.js +0 -52
- package/lib/items/directives/500-focus.js +0 -46
- package/lib/items/directives/500-input.js +0 -46
- package/lib/items/directives/500-keydown.js +0 -53
- package/lib/items/directives/500-keyup.js +0 -53
- package/lib/items/directives/500-mouse-enter.js +0 -61
- package/lib/items/directives/500-mouse-leave.js +0 -61
- package/lib/items/directives/500-mouse-move.js +0 -45
- package/lib/items/directives/500-scroll.js +0 -45
- package/lib/items/directives/500-submit.js +0 -52
- package/lib/items/elements/ai/chat/chat.css +0 -710
- package/lib/items/elements/ai/chat/chat.js +0 -429
- package/lib/src/mixins/logger.js +0 -83
- package/lib/styles/queries.css +0 -6
- package/lists.md +0 -586
- package/orchestrator.md +0 -288
- /package/addons/modules/shortcuts/front/{#register/addon.js → addon.js} +0 -0
- /package/addons/render/directives/front/{js/functions → functions}/process/data.js +0 -0
- /package/{lib/items/directives → addons/render/directives/front/items/self}/100-if.js +0 -0
- /package/{lib/items/directives → addons/render/directives/front/items/self}/700-text.js +0 -0
- /package/{lib/items/directives → addons/render/directives/front/items/self}/750-html.js +0 -0
- /package/addons/render/elements/front/{#register/addon.js → addon.js} +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/cards/pricing/pricing.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/button/button.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/checkbox/checkbox.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/date/date.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/field/field.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/field/field.js +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/input/input.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/radio/radio.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/rating/rating.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/section/section.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/section/section.js +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/select/select.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/slider/slider.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/tags/tags.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/form/textarea/textarea.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/code/code.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/faq/faq.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/heading/heading.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/markdown/markdown.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/menu/menu.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/notice/notice.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/notice/notice.js +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/parameters/parameters.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/parameters/parameters.js +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/global/tags/tags.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/navigation/navbar/navbar.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/navigation/sidebar/sidebar.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/navigation/tabs/tabs.css +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/status/code/code.js +0 -0
- /package/{lib/items/elements → addons/render/elements/front/items/self}/status/loading/loading.js +0 -0
- /package/addons/render/transforms/{functions → js/functions}/data.js +0 -0
- /package/addons/render/transforms/{functions → js/functions}/run.js +0 -0
- /package/addons/render/transforms/{functions → js/functions}/runtime.js +0 -0
- /package/addons/render/transforms/{item → js/item}/functions/load.js +0 -0
- /package/addons/render/transforms/{items/directives → js/items/self}/transform.js +0 -0
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
import onetype from 'onetype';
|
|
2
|
-
import orchestrator from '#orchestrator/addon.js';
|
|
3
|
-
import agents from '#agents/addon.js';
|
|
4
|
-
|
|
5
|
-
const dim = (s) => `\x1b[2m${s}\x1b[0m`;
|
|
6
|
-
const bold = (s) => `\x1b[1m${s}\x1b[0m`;
|
|
7
|
-
const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
|
|
8
|
-
const green = (s) => `\x1b[32m${s}\x1b[0m`;
|
|
9
|
-
const yellow = (s) => `\x1b[33m${s}\x1b[0m`;
|
|
10
|
-
const red = (s) => `\x1b[31m${s}\x1b[0m`;
|
|
11
|
-
const magenta = (s) => `\x1b[35m${s}\x1b[0m`;
|
|
12
|
-
|
|
13
|
-
orchestrator.Fn('item.run', async function(item)
|
|
14
|
-
{
|
|
15
|
-
const state = {
|
|
16
|
-
data: item.Get('data'),
|
|
17
|
-
task: item.Get('task'),
|
|
18
|
-
agents: item.Get('agents').map((agent) =>
|
|
19
|
-
{
|
|
20
|
-
agent = agents.ItemGet(agent);
|
|
21
|
-
|
|
22
|
-
if(!agent)
|
|
23
|
-
{
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
id: agent.Get('id'),
|
|
29
|
-
description: agent.Get('description'),
|
|
30
|
-
config: agent.Get('input')
|
|
31
|
-
}
|
|
32
|
-
}).filter(Boolean),
|
|
33
|
-
|
|
34
|
-
stop: false,
|
|
35
|
-
done: false,
|
|
36
|
-
agent: null,
|
|
37
|
-
goal: null,
|
|
38
|
-
input: {},
|
|
39
|
-
output: {},
|
|
40
|
-
conclusion: null,
|
|
41
|
-
summary: null,
|
|
42
|
-
history: [],
|
|
43
|
-
|
|
44
|
-
steps: { count: 0, total: item.Get('steps') },
|
|
45
|
-
tokens: { input: 0, output: 0 }
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const prev = { input: 0, output: 0 };
|
|
49
|
-
|
|
50
|
-
const tks = () =>
|
|
51
|
-
{
|
|
52
|
-
const input = state.tokens.input - prev.input;
|
|
53
|
-
const output = state.tokens.output - prev.output;
|
|
54
|
-
|
|
55
|
-
prev.input = state.tokens.input;
|
|
56
|
-
prev.output = state.tokens.output;
|
|
57
|
-
|
|
58
|
-
return dim(`[${input}in/${output}out]`);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const truncate = (s, max = 120) => s.length > max ? s.slice(0, max) + '…' : s;
|
|
62
|
-
|
|
63
|
-
console.log('');
|
|
64
|
-
console.log(bold('ORCHESTRATOR') + dim(` — ${state.task}`));
|
|
65
|
-
// console.log(dim(`agents: ${state.agents.map(a => a.id).join(', ')}`));
|
|
66
|
-
console.log(dim(`max steps: ${state.steps.total}`));
|
|
67
|
-
console.log('');
|
|
68
|
-
|
|
69
|
-
item.Set('status', 'running');
|
|
70
|
-
item.Set('state', state);
|
|
71
|
-
|
|
72
|
-
const start = Date.now();
|
|
73
|
-
|
|
74
|
-
try
|
|
75
|
-
{
|
|
76
|
-
/* Planner */
|
|
77
|
-
|
|
78
|
-
const planner = await agents.ItemGet('orchestrator-planner').Fn('run', {
|
|
79
|
-
prompt: state.task
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
state.plan = planner.tasks;
|
|
83
|
-
state.tokens.input += planner._meta.tokens.input;
|
|
84
|
-
state.tokens.output += planner._meta.tokens.output;
|
|
85
|
-
|
|
86
|
-
console.log(bold(yellow('PLAN')) + dim(` — ${state.plan.length} tasks`));
|
|
87
|
-
|
|
88
|
-
for (const task of state.plan)
|
|
89
|
-
{
|
|
90
|
-
console.log(dim(` [${task.order}] `) + dim(task.task));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
console.log('');
|
|
94
|
-
|
|
95
|
-
/* Achievable */
|
|
96
|
-
|
|
97
|
-
const check = await agents.ItemGet('orchestrator-achievable').Fn('run', {
|
|
98
|
-
tasks: state.plan,
|
|
99
|
-
agents: state.agents.map(a => ({ id: a.id, description: a.description }))
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
state.tokens.input += check._meta.tokens.input;
|
|
103
|
-
state.tokens.output += check._meta.tokens.output;
|
|
104
|
-
|
|
105
|
-
if (!check.achievable)
|
|
106
|
-
{
|
|
107
|
-
const rejected = check.rejected || [];
|
|
108
|
-
|
|
109
|
-
console.log(bold(red('NOT ACHIEVABLE')));
|
|
110
|
-
|
|
111
|
-
for (const r of rejected)
|
|
112
|
-
{
|
|
113
|
-
console.log(red(' ✗ ') + dim(r.task) + dim(` — ${r.reason}`));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
console.log('');
|
|
117
|
-
|
|
118
|
-
item.Set('status', 'failed');
|
|
119
|
-
|
|
120
|
-
return state;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
console.log(bold(green('ACHIEVABLE')));
|
|
124
|
-
console.log('');
|
|
125
|
-
|
|
126
|
-
return state;
|
|
127
|
-
|
|
128
|
-
while (state.steps.count < state.steps.total)
|
|
129
|
-
{
|
|
130
|
-
if (state.history.length > 0)
|
|
131
|
-
{
|
|
132
|
-
await item.Fn('state.done', state);
|
|
133
|
-
|
|
134
|
-
const { actions } = state.debug;
|
|
135
|
-
const pending = actions.filter(a => !a.confirmed).map(a => a.action);
|
|
136
|
-
const info = dim(` — ${state.debug.confirmed}/${state.debug.total}`) + (pending.length ? dim(` pending: ${pending.join(', ')}`) : '');
|
|
137
|
-
|
|
138
|
-
if (state.done)
|
|
139
|
-
{
|
|
140
|
-
console.log(green(' done') + info + ` ${tks()}`);
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
console.log(dim(' done') + info + ` ${tks()}`);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if(state.stop)
|
|
148
|
-
{
|
|
149
|
-
const onStop = item.Get('onStop');
|
|
150
|
-
|
|
151
|
-
if(onStop)
|
|
152
|
-
{
|
|
153
|
-
await onStop({ state });
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
state.steps.count++;
|
|
160
|
-
|
|
161
|
-
console.log(bold(cyan(`STEP ${state.steps.count}/${state.steps.total}`)));
|
|
162
|
-
|
|
163
|
-
/* Agent + Goal */
|
|
164
|
-
|
|
165
|
-
await item.Fn('state.agent', state);
|
|
166
|
-
console.log(yellow(' agent') + dim(` — ${state.agent}`) + ` ${tks()}`);
|
|
167
|
-
console.log(dim(` goal — ${state.goal}`));
|
|
168
|
-
|
|
169
|
-
/* Input */
|
|
170
|
-
|
|
171
|
-
await item.Fn('state.input', state);
|
|
172
|
-
|
|
173
|
-
const fields = Object.keys(state.input);
|
|
174
|
-
|
|
175
|
-
if (fields.length > 0)
|
|
176
|
-
{
|
|
177
|
-
const pairs = fields.map(k => `${k}: ${JSON.stringify(state.input[k])}`).join(', ');
|
|
178
|
-
console.log(magenta(' input') + dim(` — ${pairs}`) + ` ${tks()}`);
|
|
179
|
-
}
|
|
180
|
-
else
|
|
181
|
-
{
|
|
182
|
-
console.log(dim(' input — (none)') + ` ${tks()}`);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/* Execute */
|
|
186
|
-
|
|
187
|
-
await item.Fn('state.execute', state);
|
|
188
|
-
|
|
189
|
-
const keys = Object.keys(state.output);
|
|
190
|
-
const preview = keys.map(k =>
|
|
191
|
-
{
|
|
192
|
-
const v = JSON.stringify(state.output[k]);
|
|
193
|
-
return `${k}: ${v.length > 60 ? v.slice(0, 60) + '…' : v}`;
|
|
194
|
-
}).join(', ');
|
|
195
|
-
|
|
196
|
-
console.log(cyan(' exec ') + dim(` — ${truncate(preview, 200)}`) + ` ${tks()}`);
|
|
197
|
-
|
|
198
|
-
/* Conclusion */
|
|
199
|
-
|
|
200
|
-
await item.Fn('state.conclusion', state);
|
|
201
|
-
console.log(green(' concl') + dim(` — ${state.conclusion}`) + ` ${tks()}`);
|
|
202
|
-
|
|
203
|
-
state.history.push({
|
|
204
|
-
agent: state.agent,
|
|
205
|
-
step: state.steps.count,
|
|
206
|
-
goal: state.goal,
|
|
207
|
-
input: { ...state.input },
|
|
208
|
-
output: { ...state.output },
|
|
209
|
-
conclusion: state.conclusion
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
const onStep = item.Get('onStep');
|
|
213
|
-
|
|
214
|
-
if(onStep)
|
|
215
|
-
{
|
|
216
|
-
await onStep({ state });
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
console.log('');
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
if(state.stop)
|
|
223
|
-
{
|
|
224
|
-
item.Set('status', 'stopped');
|
|
225
|
-
|
|
226
|
-
return state;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
if(!state.done)
|
|
230
|
-
{
|
|
231
|
-
throw onetype.Error(422, `Max steps (${state.steps.total}) reached without completing task`, {state});
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/* Summary */
|
|
235
|
-
|
|
236
|
-
await item.Fn('state.summary', state);
|
|
237
|
-
|
|
238
|
-
const elapsed = ((Date.now() - start) / 1000).toFixed(1);
|
|
239
|
-
|
|
240
|
-
console.log('');
|
|
241
|
-
console.log(bold(green('COMPLETE')) + dim(` — ${state.steps.count} steps, ${elapsed}s`));
|
|
242
|
-
console.log(dim(`tokens: ${state.tokens.input}in / ${state.tokens.output}out`));
|
|
243
|
-
console.log(green('summary') + dim(` — ${state.summary}`));
|
|
244
|
-
console.log('');
|
|
245
|
-
|
|
246
|
-
item.Set('status', 'completed');
|
|
247
|
-
|
|
248
|
-
const onSuccess = item.Get('onSuccess');
|
|
249
|
-
|
|
250
|
-
if(onSuccess)
|
|
251
|
-
{
|
|
252
|
-
await onSuccess({ state });
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
return state;
|
|
256
|
-
}
|
|
257
|
-
catch (error)
|
|
258
|
-
{
|
|
259
|
-
const elapsed = ((Date.now() - start) / 1000).toFixed(1);
|
|
260
|
-
|
|
261
|
-
console.log('');
|
|
262
|
-
console.log(bold(red('FAILED')) + dim(` — step ${state.steps.count}, ${elapsed}s`));
|
|
263
|
-
console.log(red(error.message));
|
|
264
|
-
console.log('');
|
|
265
|
-
|
|
266
|
-
item.Set('status', 'failed');
|
|
267
|
-
|
|
268
|
-
const onFail = item.Get('onFail');
|
|
269
|
-
|
|
270
|
-
if(onFail)
|
|
271
|
-
{
|
|
272
|
-
await onFail({ state, error });
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
throw error;
|
|
276
|
-
}
|
|
277
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import onetype from 'onetype';
|
|
2
|
-
import agents from '#agents/load.js';
|
|
3
|
-
import orchestrator from '#orchestrator/addon.js';
|
|
4
|
-
|
|
5
|
-
orchestrator.Fn('item.state.agent', async function(item, state)
|
|
6
|
-
{
|
|
7
|
-
const payload = {
|
|
8
|
-
task: state.task,
|
|
9
|
-
history: state.history.map((item) =>
|
|
10
|
-
{
|
|
11
|
-
return {
|
|
12
|
-
step: item.step,
|
|
13
|
-
agent: item.agent,
|
|
14
|
-
goal: item.goal,
|
|
15
|
-
conclusion: item.conclusion
|
|
16
|
-
}
|
|
17
|
-
}),
|
|
18
|
-
agents: state.agents
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const result = await agents.ItemGet('orchestrator-agent').Fn('run', payload);
|
|
22
|
-
|
|
23
|
-
if (!state.agents.find((a) => a.id === result.agent))
|
|
24
|
-
{
|
|
25
|
-
throw onetype.Error(422, `Agent "${result.agent}" not found in available agents`);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
state.agent = result.agent;
|
|
29
|
-
state.goal = result.goal;
|
|
30
|
-
state.tokens.input += result._meta.tokens.input;
|
|
31
|
-
state.tokens.output += result._meta.tokens.output;
|
|
32
|
-
|
|
33
|
-
const onAgent = item.Get('onAgent');
|
|
34
|
-
|
|
35
|
-
if(onAgent)
|
|
36
|
-
{
|
|
37
|
-
await onAgent({ state, output: result });
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return result;
|
|
41
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import agents from '#agents/load.js';
|
|
2
|
-
import orchestrator from '#orchestrator/addon.js';
|
|
3
|
-
|
|
4
|
-
orchestrator.Fn('item.state.conclusion', async function(item, state)
|
|
5
|
-
{
|
|
6
|
-
const payload = {
|
|
7
|
-
task: state.task,
|
|
8
|
-
goal: state.goal,
|
|
9
|
-
agent: state.agents.find((entry) => entry.id === state.agent),
|
|
10
|
-
output: state.output
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const result = await agents.ItemGet('orchestrator-conclusion').Fn('run', payload);
|
|
14
|
-
|
|
15
|
-
state.conclusion = result.conclusion;
|
|
16
|
-
state.tokens.input += result._meta.tokens.input;
|
|
17
|
-
state.tokens.output += result._meta.tokens.output;
|
|
18
|
-
|
|
19
|
-
const onConclusion = item.Get('onConclusion');
|
|
20
|
-
|
|
21
|
-
if(onConclusion)
|
|
22
|
-
{
|
|
23
|
-
await onConclusion({ state, output: result });
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return result;
|
|
27
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import agents from '#agents/load.js';
|
|
2
|
-
import orchestrator from '#orchestrator/addon.js';
|
|
3
|
-
|
|
4
|
-
orchestrator.Fn('item.state.done', async function(item, state)
|
|
5
|
-
{
|
|
6
|
-
const agent = agents.ItemGet('orchestrator-done');
|
|
7
|
-
|
|
8
|
-
const payload = {
|
|
9
|
-
task: state.task,
|
|
10
|
-
history: state.history.map((item) =>
|
|
11
|
-
{
|
|
12
|
-
return {
|
|
13
|
-
step: item.step,
|
|
14
|
-
agent: item.agent,
|
|
15
|
-
goal: item.goal,
|
|
16
|
-
conclusion: item.conclusion
|
|
17
|
-
}
|
|
18
|
-
}),
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const result = await agent.Fn('run', payload);
|
|
22
|
-
|
|
23
|
-
state.done = result.done;
|
|
24
|
-
|
|
25
|
-
const actions = result.actions || [];
|
|
26
|
-
const confirmed = actions.filter(a => a.confirmed).length;
|
|
27
|
-
|
|
28
|
-
state.debug = { total: actions.length, confirmed, done: result.done, actions };
|
|
29
|
-
state.tokens.input += result._meta.tokens.input;
|
|
30
|
-
state.tokens.output += result._meta.tokens.output;
|
|
31
|
-
|
|
32
|
-
const onDone = item.Get('onDone');
|
|
33
|
-
|
|
34
|
-
if(onDone)
|
|
35
|
-
{
|
|
36
|
-
await onDone({ state, output: result });
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return result;
|
|
40
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import agents from '#agents/load.js';
|
|
2
|
-
import orchestrator from '#orchestrator/addon.js';
|
|
3
|
-
|
|
4
|
-
orchestrator.Fn('item.state.execute', async function(item, state)
|
|
5
|
-
{
|
|
6
|
-
const result = await agents.ItemGet(state.agent).Fn('run', state.input);
|
|
7
|
-
|
|
8
|
-
const { _meta, ...output } = result;
|
|
9
|
-
|
|
10
|
-
state.output = output;
|
|
11
|
-
|
|
12
|
-
state.tokens.input += result._meta.tokens.input;
|
|
13
|
-
state.tokens.output += result._meta.tokens.output;
|
|
14
|
-
|
|
15
|
-
return result;
|
|
16
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import agents from '#agents/load.js';
|
|
2
|
-
import orchestrator from '#orchestrator/addon.js';
|
|
3
|
-
|
|
4
|
-
orchestrator.Fn('item.state.goal', async function(item, state)
|
|
5
|
-
{
|
|
6
|
-
const payload = {
|
|
7
|
-
task: state.task,
|
|
8
|
-
agent: state.agents.find((item) => item.id === state.agent),
|
|
9
|
-
history: state.history.map((entry) =>
|
|
10
|
-
{
|
|
11
|
-
return {
|
|
12
|
-
step: entry.step,
|
|
13
|
-
agent: entry.agent,
|
|
14
|
-
goal: entry.goal,
|
|
15
|
-
conclusion: entry.conclusion
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const result = await agents.ItemGet('orchestrator-goal').Fn('run', payload);
|
|
21
|
-
|
|
22
|
-
state.goal = result.goal;
|
|
23
|
-
state.tokens.input += result._meta.tokens.input;
|
|
24
|
-
state.tokens.output += result._meta.tokens.output;
|
|
25
|
-
|
|
26
|
-
const onGoal = item.Get('onGoal');
|
|
27
|
-
|
|
28
|
-
if(onGoal)
|
|
29
|
-
{
|
|
30
|
-
await onGoal({ state, output: result });
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return result;
|
|
34
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import onetype from 'onetype';
|
|
2
|
-
import agents from '#agents/load.js';
|
|
3
|
-
import orchestrator from '#orchestrator/addon.js';
|
|
4
|
-
|
|
5
|
-
orchestrator.Fn('item.state.input', async function(item, state)
|
|
6
|
-
{
|
|
7
|
-
const agent = agents.ItemGet(state.agent);
|
|
8
|
-
const schema = agent.Get('input');
|
|
9
|
-
const fields = Object.keys(schema);
|
|
10
|
-
|
|
11
|
-
if (fields.length === 0)
|
|
12
|
-
{
|
|
13
|
-
state.input = {};
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const payload = {
|
|
18
|
-
goal: state.goal,
|
|
19
|
-
agent: {
|
|
20
|
-
id: agent.Get('id'),
|
|
21
|
-
description: agent.Get('description'),
|
|
22
|
-
config: agent.Get('input')
|
|
23
|
-
},
|
|
24
|
-
fields: schema
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const result = await agents.ItemGet('orchestrator-input').Fn('run', payload);
|
|
28
|
-
|
|
29
|
-
const matched = {};
|
|
30
|
-
|
|
31
|
-
for (const field of fields)
|
|
32
|
-
{
|
|
33
|
-
const value = result.values?.[field];
|
|
34
|
-
|
|
35
|
-
if (value === undefined || value === null) continue;
|
|
36
|
-
|
|
37
|
-
matched[field] = value;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* Defaults */
|
|
41
|
-
|
|
42
|
-
for (const field of fields)
|
|
43
|
-
{
|
|
44
|
-
if (matched[field] === undefined && schema[field]?.value !== undefined)
|
|
45
|
-
{
|
|
46
|
-
matched[field] = schema[field].value;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
state.input = onetype.DataDefine(matched, schema);
|
|
51
|
-
state.tokens.input += result._meta.tokens.input;
|
|
52
|
-
state.tokens.output += result._meta.tokens.output;
|
|
53
|
-
|
|
54
|
-
return result;
|
|
55
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import agents from '#agents/load.js';
|
|
2
|
-
import orchestrator from '#orchestrator/addon.js';
|
|
3
|
-
|
|
4
|
-
orchestrator.Fn('item.state.summary', async function(item, state)
|
|
5
|
-
{
|
|
6
|
-
const payload = {
|
|
7
|
-
task: state.task,
|
|
8
|
-
history: state.history.map((entry) =>
|
|
9
|
-
{
|
|
10
|
-
return {
|
|
11
|
-
step: entry.step,
|
|
12
|
-
agent: entry.agent,
|
|
13
|
-
goal: entry.goal,
|
|
14
|
-
conclusion: entry.conclusion
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const result = await agents.ItemGet('orchestrator-summary').Fn('run', payload);
|
|
20
|
-
|
|
21
|
-
state.summary = result.summary;
|
|
22
|
-
state.tokens.input += result._meta.tokens.input;
|
|
23
|
-
state.tokens.output += result._meta.tokens.output;
|
|
24
|
-
|
|
25
|
-
return result;
|
|
26
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
onetype.AddonReady('agents', (agents) =>
|
|
2
|
-
{
|
|
3
|
-
agents.Item({
|
|
4
|
-
id: 'orchestrator-achievable',
|
|
5
|
-
name: 'Orchestrator Achievable',
|
|
6
|
-
description: 'Checks if the planned tasks can be executed by the available agents',
|
|
7
|
-
instructions: `
|
|
8
|
-
You receive a list of planned tasks and a list of available agents.
|
|
9
|
-
For each task, determine if the required actions can be performed by the available agents.
|
|
10
|
-
Agents can be chained, repeated, and used conditionally by an orchestrator.
|
|
11
|
-
Filtering, looping, and conditional logic are handled by the orchestrator — not by agents.
|
|
12
|
-
A task is achievable if the underlying actions (list, create, delete, etc.) have matching agents.
|
|
13
|
-
Only reject when the action type itself has no matching agent.
|
|
14
|
-
`,
|
|
15
|
-
tokens: 1000,
|
|
16
|
-
input: {
|
|
17
|
-
tasks: {
|
|
18
|
-
type: 'array',
|
|
19
|
-
description: 'Planned tasks [{task, order}]'
|
|
20
|
-
},
|
|
21
|
-
agents: {
|
|
22
|
-
type: 'array',
|
|
23
|
-
description: 'Available agents [{id, description}]'
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
output: {
|
|
27
|
-
achievable: {
|
|
28
|
-
type: 'boolean',
|
|
29
|
-
description: 'true if all tasks can be handled by available agents'
|
|
30
|
-
},
|
|
31
|
-
rejected: {
|
|
32
|
-
type: 'array',
|
|
33
|
-
description: 'Tasks that no agent can handle [{task, reason}]'
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
onetype.AddonReady('agents', (agents) =>
|
|
2
|
-
{
|
|
3
|
-
agents.Item({
|
|
4
|
-
id: 'orchestrator-agent',
|
|
5
|
-
name: 'Orchestrator Agent',
|
|
6
|
-
description: 'Selects the next agent and writes its goal',
|
|
7
|
-
instructions: `
|
|
8
|
-
Pick the next agent and write its goal.
|
|
9
|
-
|
|
10
|
-
Read conclusions to know what is done. If data is missing, pick a listing agent first.
|
|
11
|
-
If data exists, pick the action agent. Complete remaining items of the same type before moving on.
|
|
12
|
-
Agent ID must exactly match one from the agents list.
|
|
13
|
-
|
|
14
|
-
Goal: one action, one target. Include concrete values from conclusions. Never guess.
|
|
15
|
-
`,
|
|
16
|
-
tokens: 400,
|
|
17
|
-
input: {
|
|
18
|
-
task: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
description: 'The original user request'
|
|
21
|
-
},
|
|
22
|
-
history: {
|
|
23
|
-
type: 'array',
|
|
24
|
-
description: 'Completed steps [{step, agent, goal, conclusion}]'
|
|
25
|
-
},
|
|
26
|
-
agents: {
|
|
27
|
-
type: 'array',
|
|
28
|
-
description: 'Available agents [{id, description, config}]'
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
output: {
|
|
32
|
-
agent: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Exact agent ID from the agents list'
|
|
35
|
-
},
|
|
36
|
-
reason: {
|
|
37
|
-
type: 'string',
|
|
38
|
-
description: 'One sentence: why this agent now'
|
|
39
|
-
},
|
|
40
|
-
goal: {
|
|
41
|
-
type: 'string',
|
|
42
|
-
description: 'Actionable goal with literal values for the agent'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
onetype.AddonReady('agents', (agents) =>
|
|
2
|
-
{
|
|
3
|
-
agents.Item({
|
|
4
|
-
id: 'orchestrator-conclusion',
|
|
5
|
-
name: 'Orchestrator Conclusion',
|
|
6
|
-
description: 'Records what happened — the only memory future steps can read',
|
|
7
|
-
instructions: `
|
|
8
|
-
You are the orchestrator's memory. Future steps ONLY read your conclusion.
|
|
9
|
-
Omitted data is lost forever.
|
|
10
|
-
|
|
11
|
-
Single dense paragraph. Include every field and value from the output.
|
|
12
|
-
ALL items if the output is a list. Preserve data relevant to the task and goal.
|
|
13
|
-
Past tense. Max 60 words.
|
|
14
|
-
`,
|
|
15
|
-
tokens: 300,
|
|
16
|
-
input: {
|
|
17
|
-
task: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
description: 'The original user request'
|
|
20
|
-
},
|
|
21
|
-
goal: {
|
|
22
|
-
type: 'string',
|
|
23
|
-
description: 'What this step was trying to do'
|
|
24
|
-
},
|
|
25
|
-
agent: {
|
|
26
|
-
type: 'object',
|
|
27
|
-
description: 'Agent that ran {id, description, config}'
|
|
28
|
-
},
|
|
29
|
-
output: {
|
|
30
|
-
type: 'object',
|
|
31
|
-
description: 'Raw output from the agent'
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
output: {
|
|
35
|
-
conclusion: {
|
|
36
|
-
type: 'string',
|
|
37
|
-
description: 'Dense conclusion with all IDs'
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
onetype.AddonReady('agents', (agents) =>
|
|
2
|
-
{
|
|
3
|
-
agents.Item({
|
|
4
|
-
id: 'orchestrator-done',
|
|
5
|
-
name: 'Orchestrator Done',
|
|
6
|
-
description: 'Checks if the orchestration task has been achieved',
|
|
7
|
-
instructions: `
|
|
8
|
-
Determine if the task is fully complete.
|
|
9
|
-
|
|
10
|
-
Parse the task into distinct required actions. Only count mutating actions
|
|
11
|
-
(create, update, delete, add, remove, publish, etc). Listings are not actions.
|
|
12
|
-
|
|
13
|
-
For each action, check if a conclusion confirms it succeeded.
|
|
14
|
-
Scope expands when conclusions reveal multiple items to process.
|
|
15
|
-
|
|
16
|
-
done = true ONLY when every required action has a confirming conclusion.
|
|
17
|
-
`,
|
|
18
|
-
tokens: 400,
|
|
19
|
-
input: {
|
|
20
|
-
task: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
description: 'The original user request'
|
|
23
|
-
},
|
|
24
|
-
history: {
|
|
25
|
-
type: 'array',
|
|
26
|
-
description: 'Completed steps [{step, agent, goal, conclusion}]'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
output: {
|
|
30
|
-
actions: {
|
|
31
|
-
type: 'array',
|
|
32
|
-
description: 'Each required action with its status [{action, confirmed}]'
|
|
33
|
-
},
|
|
34
|
-
done: {
|
|
35
|
-
type: 'boolean',
|
|
36
|
-
description: 'true when every action is confirmed'
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|