11 سلوكًا · std/behaviors
std-agent-completiontakes a prompt, returns generated text.
uses AgentCompletion from "std/behaviors/std-agent-completion"الكيان: Completion (runtime)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
CompletionGeneration | GENERATE, GENERATION_FAILED, RESET | COMPLETED, GENERATED |
CompletionReady | COMPLETED, RESET | لا شيء |
std-agent-contextkeeps what an in-app assistant sends the model bounded. COMPACT { messages } passes a conversation of at most keepMessages turns straight through as COMPACTED; a longer one has its older turns summarized with call-service llm summarize into one leading note and keeps the last keepMessages turns verbatim. If summarizing fails, the older turns are dropped and the recent ones still go through, with a visible warning — a summarizer outage never blocks the assistant. Headless. Nothing is persisted: the conversation itself lives in std-agent-session.
uses AgentContext from "std/behaviors/std-agent-context"الكيان: AgentContextWindow (runtime)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
AgentContextCompactor | COMPACT | COMPACTED, ContextSummarized, ContextSummarizeFailed |
مفاتيح الإعداد
| السمة | المفتاح | النوع | التسمية |
|---|---|---|---|
AgentContextCompactor | keepMessages | number | Turns kept verbatim |
std-agent-fix-loopvalidate an orbital, generate a repair prompt if errors, apply fix.
uses AgentFixLoop from "std/behaviors/std-agent-fix-loop"الكيان: FixLoop (runtime)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
FixLoopExecution | VALIDATE_ORBITAL, PROMPT_GENERATION_FAILED, RESET | FIX_APPLIED, PROMPT_GENERATED |
FixLoopListener | FIX_APPLIED, RESET | لا شيء |
std-agent-memorywhat an in-app assistant remembers across conversations. Owns AgentMemory rows (content + its embedding, ownerId = the real @user). RECALL { messages } embeds the last turn with call-service llm embed, ranks the stored memories whose embedding is comparable (same length as the query's) by cosine similarity and emits RECALLED { messages, context } with the closest recallLimit memories joined into one context string (empty when nothing is stored); if embedding fails it emits RECALLED with an empty context, so a memory outage never blocks the assistant. REMEMBER { reply } stores the exchange it just recalled for (asked + answered) with its embedding. AgentMemoryRecall is headless (failures show as toasts); AgentMemoryBrowse is the list view. Rows are meant to be private to their owner: the binding organism declares the @read scoping.
uses AgentMemory from "std/behaviors/std-agent-memory"الكيان: AgentMemory (persistent)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
AgentMemoryRecall | LIST, RECALL, REMEMBER | RECALLED, ASSISTANT_MEMORIES_LOADED, MemoriesForList, MemoryListFailed, MEMORY_STORED, AgentMemoriesLoadFailed, MemoriesForRecall, MemoryEmbedded, MemoryEmbedFailed |
AgentMemoryBrowse | MEMORY_STORED | AgentMemoriesLoaded, AgentMemoriesLoadFailed |
مفاتيح الإعداد
| السمة | المفتاح | النوع | التسمية |
|---|---|---|---|
AgentMemoryRecall | recallLimit | number | Memories recalled per request |
std-agent-plannerrecall memories, then generate a plan from the prompt + recalled context.
uses AgentPlanner from "std/behaviors/std-agent-planner"الكيان: PlannerPlan (runtime)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
PlannerExecution | PLAN, RECALL_FAILED, PLAN_GENERATION_FAILED, RESET | PLANNED, MEMORIES_RECALLED, PLAN_GENERATED |
PlannerListener | PLANNED, RESET | لا شيء |
std-agent-sessionthe conversation with an in-app assistant. AgentThread owns the persisted AgentMessage rows (role, content, ownerId stamped with the real @user, createdAt): SEND stores the user's message, reloads the thread and emits CONVERSE with the whole conversation, oldest first, for std-agent-tool-loop to answer; REPLIED stores the reply. AgentConversation is what the user sees, in the browser: the thread as chat bubbles with every step the assistant takes interleaved live (STEP: each model call, each tool it used and what the app answered), a thinking row while it works, and a chat bar. The two talk over the assistant contract, from any orbital: AgentConversation emits ASSISTANT_SEND and hears AgentMessagesLoaded, ASSISTANT_THREAD_FAILED, ASSISTANT_STEP, ASSISTANT_REPLIED and ASSISTANT_REPLY_FAILED; AgentThread hears ASSISTANT_SEND. So a conversation placed on any section's page reaches the app's one assistant (std-agent-assistant) with no wiring. Rows are meant to be private to their owner: owner-scoped access needs an [identity] roster, so the binding organism declares the @read/@create scoping on AgentMessage — this generic atom cannot.
uses AgentSession from "std/behaviors/std-agent-session"الكيان: AgentMessage (persistent)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
AgentThread | OPEN_CHAT, SEND_IN_CHAT, REPLY_IN_CHAT | ASSISTANT_THREAD_FAILED, CONVERSE, AgentMessagesLoaded, AgentMessagesLoadFailed, AgentConversationLoaded, AgentMessageSaved, AgentMessageSaveFailed |
AgentConversation | THREAD_LOADED, STEP, REPLIED, CHATS_LISTED, MEMORIES_LISTED, BACK_TO_CHAT, REPLY_FAILED | ASSISTANT_HISTORY_REQUESTED, ASSISTANT_NEW_CHAT, NEW_CHAT_CLICKED, ASSISTANT_SEND, ASSISTANT_CHATS_REQUESTED, ASSISTANT_CHAT_SELECTED, ASSISTANT_MEMORIES_REQUESTED, OPEN_CHATS_CLICKED, OPEN_MEMORY_CLICKED, CHAT_PICKED, ASK |
مفاتيح الإعداد
| السمة | المفتاح | النوع | التسمية |
|---|---|---|---|
AgentConversation | backLabel | string | Back to the conversation |
AgentConversation | chatsEmptyTitle | string | Empty conversation list |
AgentConversation | chatsLabel | string | Past conversations button |
AgentConversation | emptyTitle | string | Empty conversation title |
AgentConversation | links | [AgentLink] | Links above the conversation |
AgentConversation | memoryEmptyTitle | string | Empty memory list |
AgentConversation | memoryLabel | string | Memory button |
AgentConversation | newChatLabel | string | New conversation button |
AgentConversation | placeholder | string | Message placeholder |
AgentConversation | untitledLabel | string | Title of a conversation with no messages yet |
std-agent-tool-calltakes messages + tools, returns tool-call result.
uses AgentToolCall from "std/behaviors/std-agent-tool-call"الكيان: ToolCall (runtime)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
ToolCallExecution | CALL_TOOLS, TOOLS_FAILED, RESET | TOOLS_CALLED |
ToolCallReady | TOOLS_CALLED, RESET | لا شيء |
std-agent-tool-loopanswers a conversation by operating the running app as the caller, through call-service llm call-tools. Its tools are { scope: declared } (every declared external input plus a read over every persisted entity), or named declared inputs (addressed like a listens source: Trait.EVENT, Orbital.Trait.EVENT) and entities to read; each input fires as the signed-in user through the ordinary dispatch (guards and entity policies apply) and each read returns only the rows the caller may read. Headless: the conversation UI (std-agent-session) shows the reply; a failure shows as a toast. CONVERSE carries the conversation (and optionally what std-agent-memory recalled); ASSISTANT_STEP carries each step live while it works (a model call, a tool it used, what the app answered) to the asking tab; ASSISTANT_REPLIED carries the reply, every step and the token usage; ASSISTANT_REPLY_FAILED carries the error. These names are the assistant contract std-agent-session's conversation hears from any orbital. Compose with std-agent-session (the conversation) and std-agent-trace (the step record).
uses AgentToolLoop from "std/behaviors/std-agent-tool-loop"الكيان: AgentTurn (runtime)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
AgentToolLoop | CONVERSE | ASSISTANT_STEP, ASSISTANT_REPLIED, ASSISTANT_REPLY_FAILED, ANSWERED, ASK_FAILED |
مفاتيح الإعداد
| السمة | المفتاح | النوع | التسمية |
|---|---|---|---|
AgentToolLoop | instructions | string | How should the assistant behave? |
AgentToolLoop | maxSteps | number | Model round-trips per request |
AgentToolLoop | tools | [AgentTool] | What may the assistant do? |
std-agent-tracethe persisted record of what an in-app assistant did. Each REPLIED (from std-agent-tool-loop) stores one AgentRun row: the reply, every step (each model call, each tool used with its arguments, whether it took effect and why not), the tokens and the model calls; each REPLY_FAILED stores a failed run with its error. The record verification grades and later optimisation reads, in one format for tests and production. AgentTraceRecorder is headless; AgentRunBrowse is the run list. Rows carry ownerId (the real @user); the binding organism scopes @read.
uses AgentTrace from "std/behaviors/std-agent-trace"الكيان: AgentRun (persistent)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
AgentTraceRecorder | REPLIED, REPLY_FAILED | RUN_RECORDED |
AgentRunBrowse | RUN_RECORDED | AgentRunsLoaded, AgentRunsLoadFailed |
std-agent-assistantan in-app assistant that operates the running app for the signed-in user. Each section's floating button opens it in a side panel docked beside the page (std-panel-launcher; a side sheet on small screens), where the conversation shows every step the assistant takes live as it works; /assistant is the same conversation as a full page, in the app's own shell (pass appName and navItems); past conversations and what the assistant remembers open in place from its toolbar (Back returns to the chat), on either surface. One request flows down a chain of std agent atoms on the bus: the conversation (std-agent-session) SENDs → CONVERSE → std-agent-context bounds it → std-agent-memory adds what it recalls → std-agent-tool-loop answers it through call-service llm call-tools, firing only the inputs and reading only the entities its tools allow, as the signed-in user → ASSISTANT_REPLIED goes back to the conversation, to memory (remembered) and to std-agent-trace (the run record). By default the tools are the program's own declarations: every -> external input (its @description is the tool text) and a read over every persisted entity, so composing building blocks composes the assistant's abilities. Any section's page gets the assistant with two traits, XAssistant = AgentSession.traits.AgentConversation and a std-panel-launcher dock: the conversation speaks the ASSISTANT_* contract from any orbital, so the assistant needs no per-section wiring. Import the orbital once per app: orbital Assistant = Agent.orbitals.AgentAssistantOrbital { config { instructions: "…" } }. The conversation, memory and run records live in AgentRecordsOrbital; retarget them onto your own owner-scoped entities (ownerId a relation to your [identity] roster, with @read/@create) with entities { AgentMessage: …, AgentMemory: …, AgentRun: …, AgentChat: … }. The conversation is kept across pages and reloads (each person's most recently used conversation is the current one);
uses AgentAssistant from "std/behaviors/std-agent-assistant"الكيان: AgentAssistant (runtime)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
AssistantThread | لا شيء | لا شيء |
AssistantChatKeeper | لا شيء | لا شيء |
AssistantConversation | لا شيء | لا شيء |
AssistantLayout | لا شيء | لا شيء |
AssistantContext | لا شيء | لا شيء |
AssistantMemory | لا شيء | لا شيء |
AssistantLoop | لا شيء | لا شيء |
AssistantTrace | لا شيء | لا شيء |
مفاتيح الإعداد
| السمة | المفتاح | النوع | التسمية |
|---|---|---|---|
AssistantConversation | backLabel | string | Back to the conversation |
AssistantConversation | chatsEmptyTitle | string | Empty conversation list |
AssistantConversation | chatsLabel | string | Past conversations button |
AssistantConversation | emptyTitle | string | Empty conversation title |
AssistantConversation | links | [AgentLink] | Links above the conversation |
AssistantConversation | memoryEmptyTitle | string | Empty memory list |
AssistantConversation | memoryLabel | string | Memory button |
AssistantConversation | newChatLabel | string | New conversation button |
AssistantConversation | placeholder | string | Message placeholder |
AssistantConversation | untitledLabel | string | Title of a conversation with no messages yet |
AssistantLayout | accessDeniedDescription | string | Access-denied message |
AssistantLayout | accessDeniedTitle | string | Access-denied title |
AssistantLayout | allowedRoles | [string] | Who may open this page? |
AssistantLayout | appName | string | What should this app be called? |
AssistantLayout | contentClassName | string | Content wrapper class |
AssistantLayout | contentTrait | trait | Content trait |
AssistantLayout | currentPath | string | Current path |
AssistantLayout | layoutMode | string | Where should navigation be placed? |
AssistantLayout | layoutPattern | pattern | Layout pattern |
AssistantLayout | navItems | [NavItem] | Which sections appear in the sidebar? |
AssistantLayout | notificationClickEvent | event | Notification click event |
AssistantLayout | notifications | [NotificationSpec] | What notifications should appear? |
AssistantLayout | searchEvent | event | Search event |
AssistantLayout | sidebarTrait | trait | Sidebar trait |
AssistantLayout | theme | string | Theme |
AssistantLayout | topBarActions | [ItemAction] | What shortcuts go in the top bar? |
AssistantLayout | viewerAvatar | string | Signed-in avatar |
AssistantLayout | viewerEmail | string | Signed-in email |
AssistantLayout | viewerName | string | Who is signed in |
AssistantLayout | viewerRole | string | Viewer's role |
AssistantContext | keepMessages | number | Turns kept verbatim |
AssistantMemory | recallLimit | number | Memories recalled per request |
AssistantLoop | instructions | string | How should the assistant behave? |
AssistantLoop | maxSteps | number | Model round-trips per request |
AssistantLoop | tools | [AgentTool] | What may the assistant do? |
std-agent-builderplan, build, validate, fix a single orbital end-to-end.
uses AgentBuilder from "std/behaviors/std-agent-builder"الكيان: BuilderProcess (runtime)
السمات
| السمة | الأحداث | يبثّ |
|---|---|---|
BuilderPipeline | START, PLAN_FAILED, RESET, RETRY | BUILD_COMPLETE, PLANNED |
BuilderListener | BUILD_COMPLETE, RESET | لا شيء |