@burdenoff/microfe-stewards 2026.1204.3 → 2026.1204.4
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/dist/stewards/i18n/en.d.ts +8 -0
- package/dist/stewards/i18n/en.js +9 -1
- package/dist/stewards/i18n/en.js.map +1 -1
- package/dist/stewards/utils/charterForm.d.ts +3 -0
- package/dist/stewards/utils/charterForm.js +12 -0
- package/dist/stewards/utils/charterForm.js.map +1 -1
- package/package.json +1 -1
|
@@ -136,6 +136,13 @@ export declare const enTranslations: {
|
|
|
136
136
|
readonly 'desk:write_file': "Write files";
|
|
137
137
|
readonly 'platform:current_time': "Check the time";
|
|
138
138
|
readonly 'platform:notify_owner': "Notify the owner";
|
|
139
|
+
readonly 'workqueue:list': "See the work queues";
|
|
140
|
+
readonly 'workqueue:add': "Add work items";
|
|
141
|
+
readonly 'workqueue:lease': "Take the next work item";
|
|
142
|
+
readonly 'workqueue:extend': "Keep working on an item longer";
|
|
143
|
+
readonly 'workqueue:complete': "Mark a work item done";
|
|
144
|
+
readonly 'workqueue:fail': "Report a work item as failed";
|
|
145
|
+
readonly 'workflow-run:read': "Read the result of a workflow run (review tasks)";
|
|
139
146
|
};
|
|
140
147
|
readonly budget: {
|
|
141
148
|
readonly credits: "AI credits";
|
|
@@ -279,6 +286,7 @@ export declare const enTranslations: {
|
|
|
279
286
|
readonly groupAct: "Act on the screen";
|
|
280
287
|
readonly groupFiles: "Files and shell";
|
|
281
288
|
readonly groupPlatform: "BotManor tools";
|
|
289
|
+
readonly groupWorkQueues: "FluidGrids work queues and review tasks";
|
|
282
290
|
readonly customTitle: "Connectors and workflows";
|
|
283
291
|
readonly customHint: "One key per line: mcp:<connection>:<tool>, node:<provider>:<operation>, workflow:<id>.";
|
|
284
292
|
readonly customInvalid: "Not a valid tool key: {key}";
|
package/dist/stewards/i18n/en.js
CHANGED
|
@@ -135,7 +135,14 @@ var t = { stewards: {
|
|
|
135
135
|
"desk:read_file": "Read files",
|
|
136
136
|
"desk:write_file": "Write files",
|
|
137
137
|
"platform:current_time": "Check the time",
|
|
138
|
-
"platform:notify_owner": "Notify the owner"
|
|
138
|
+
"platform:notify_owner": "Notify the owner",
|
|
139
|
+
"workqueue:list": "See the work queues",
|
|
140
|
+
"workqueue:add": "Add work items",
|
|
141
|
+
"workqueue:lease": "Take the next work item",
|
|
142
|
+
"workqueue:extend": "Keep working on an item longer",
|
|
143
|
+
"workqueue:complete": "Mark a work item done",
|
|
144
|
+
"workqueue:fail": "Report a work item as failed",
|
|
145
|
+
"workflow-run:read": "Read the result of a workflow run (review tasks)"
|
|
139
146
|
},
|
|
140
147
|
budget: {
|
|
141
148
|
credits: "AI credits",
|
|
@@ -279,6 +286,7 @@ var t = { stewards: {
|
|
|
279
286
|
groupAct: "Act on the screen",
|
|
280
287
|
groupFiles: "Files and shell",
|
|
281
288
|
groupPlatform: "BotManor tools",
|
|
289
|
+
groupWorkQueues: "FluidGrids work queues and review tasks",
|
|
282
290
|
customTitle: "Connectors and workflows",
|
|
283
291
|
customHint: "One key per line: mcp:<connection>:<tool>, node:<provider>:<operation>, workflow:<id>.",
|
|
284
292
|
customInvalid: "Not a valid tool key: {key}",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","names":["enEditors","enTranslations"],"sources":["../../../src/stewards/i18n/en.ts"],"sourcesContent":["/**\n * English strings for microfe-stewards. Keys are dot-notation; the host's\n * I18nProvider resolves them against the translations it loads, and `useStewardsT`\n * falls back to this object when the host has no entry (or no provider).\n * Register it with the shell's `fallbackTranslations`.\n */\nimport { enEditors } from './enEditors';\n\nexport const enTranslations = {\n stewards: {\n ...enEditors,\n nav: { label: 'Stewards' },\n common: {\n back: 'Back',\n cancel: 'Cancel',\n loading: 'Loading…',\n retry: 'Try again',\n none: 'None',\n noCap: 'No cap',\n never: 'Never',\n credits: 'credits',\n unknown: 'Unknown',\n forbiddenTitle: 'You do not have access',\n forbiddenBody: 'Your role does not allow you to view Stewards in this workspace.',\n errorTitle: 'Something went wrong',\n notFoundTitle: 'Not found',\n notFoundBody: 'This steward or run does not exist, or you cannot see it.',\n },\n enums: {\n status: { DRAFT: 'Draft', ACTIVE: 'Active', PAUSED: 'Paused', ARCHIVED: 'Archived' },\n autonomy: { OBSERVE: 'Observe', ASK: 'Ask', GUIDED: 'Guided', TRUSTED: 'Trusted' },\n autonomyHelp: {\n OBSERVE:\n 'Read only, by construction. Can look, summarise and report; no outward actions exist.',\n ASK: 'Every outward action asks a person first.',\n GUIDED:\n 'A reviewer model decides each outward action against the charter; when unsure it asks you.',\n TRUSTED:\n 'Your standing rules apply first, then the reviewer model. Still bounded by budgets.',\n },\n desk: {\n NONE: 'No desk',\n BROWSER: 'Browser only',\n CLOUD: 'Cloud desk',\n OWN_MACHINE: 'Own machine',\n },\n deskHelp: {\n NONE: 'Works through connectors and tools only.',\n BROWSER: 'A managed browser. The agent needs the Web browsing capability.',\n CLOUD: 'A cloud desktop. The agent needs the Computer use capability.',\n OWN_MACHINE: 'A machine you connect. The agent needs the Computer use capability.',\n },\n egress: {\n PUBLIC: 'Any public site',\n ALLOW_LIST: 'Only the sites I list',\n BLOCKED: 'No web access',\n },\n runStatus: {\n PROPOSED: 'Proposed',\n QUEUED: 'Queued',\n RUNNING: 'Running',\n WAITING_APPROVAL: 'Waiting for approval',\n WAITING_TAKEOVER: 'Waiting for a person',\n PAUSED_BUDGET: 'Paused — budget',\n COMPLETED: 'Completed',\n FAILED: 'Failed',\n CANCELLED: 'Cancelled',\n STOPPED: 'Stopped',\n },\n trigger: {\n OWNER_CHAT: 'Owner chat',\n SCHEDULE: 'Schedule',\n WEBHOOK: 'Webhook',\n APP_EVENT: 'App event',\n PLATFORM_EVENT: 'Platform event',\n CHANNEL_MESSAGE: 'Channel message',\n WATCH: 'Watch',\n PROACTIVE: 'Proactive',\n API: 'API',\n WORKFLOW: 'Workflow',\n A2A: 'Agent to agent',\n },\n trust: {\n OWNER: 'Owner',\n MEMBER: 'Member',\n SYSTEM: 'System',\n EXTERNAL: 'External content',\n UNTRUSTED: 'Untrusted content',\n },\n stepKind: {\n MODEL_CALL: 'Model call',\n TOOL_CALL: 'Connector tool',\n DESK_ACTION: 'Desk action',\n APPROVAL_WAIT: 'Approval wait',\n TAKEOVER: 'Takeover',\n SUB_RUN: 'Sub-run',\n MEMORY_WRITE: 'Memory write',\n NOTE: 'Note',\n },\n verdict: {\n ALLOWED: 'Allowed',\n ASKED: 'Asked',\n APPROVED: 'Approved',\n DENIED: 'Denied',\n BLOCKED_DRY_RUN: 'Dry run',\n FAILED: 'Failed',\n SKIPPED: 'Skipped',\n },\n approvalStatus: {\n PENDING: 'Pending',\n APPROVED: 'Approved',\n DENIED: 'Denied',\n EXPIRED: 'Expired',\n CANCELLED: 'Cancelled',\n },\n scope: {\n ONCE: 'Once',\n RUN: 'This run',\n DUTY: 'This duty',\n TIME_LIMITED: 'Time-limited',\n STANDING: 'Standing',\n },\n },\n tools: {\n 'desk:screenshot': 'Screenshot',\n 'desk:snapshot': 'Read the screen structure',\n 'desk:click': 'Click',\n 'desk:type': 'Type',\n 'desk:key': 'Press keys',\n 'desk:scroll': 'Scroll',\n 'desk:navigate': 'Open a URL',\n 'desk:focus_window': 'Switch window',\n 'desk:secret_fill': 'Fill a stored secret',\n 'desk:shell': 'Run shell commands',\n 'desk:read_file': 'Read files',\n 'desk:write_file': 'Write files',\n 'platform:current_time': 'Check the time',\n 'platform:notify_owner': 'Notify the owner',\n },\n budget: {\n credits: 'AI credits',\n deskMinutes: 'Desk minutes',\n steps: 'Steps',\n wallSeconds: 'Wall-clock seconds',\n connectorSpendMinor: 'Connector spend (minor units)',\n perRun: 'Per run',\n perDay: 'Per day',\n total: 'Total',\n limit: 'Limit',\n invalid: 'Enter a number of 0 or more for {name} (whole numbers, except credits).',\n hint: 'Run stops when any limit is hit. Leave a box empty for no cap at that level.',\n },\n fixed: {\n title: 'Always asks a person — can’t be loosened',\n badge: 'Fixed',\n password: 'Password and security-setting changes',\n payment: 'Entering payment details',\n otp: 'Reading one-time codes',\n external: 'Messages to people outside the workspace',\n },\n list: {\n title: 'Stewards',\n subtitle:\n 'Agents with a charter, duties and a desk — they work on a schedule or on events, inside the limits you set.',\n newSteward: 'New steward',\n statusFilter: 'Status',\n allStatuses: 'All',\n tableLabel: 'Stewards',\n colSteward: 'Steward',\n colStatus: 'Status',\n colAutonomy: 'Autonomy',\n colDesk: 'Desk',\n colLastRun: 'Last run',\n colToday: 'Today · spend / daily cap',\n colWaiting: 'Waiting',\n neverRun: 'Never run',\n tileActive: 'Active stewards',\n tileWaiting: 'Waiting for approval',\n tileWaitingHint: 'Approval requests across stewards',\n tileSpend: 'Credits used today',\n empty: 'No stewards yet.',\n emptyFiltered: 'No stewards match this status.',\n emptyHint: 'Make one of your agents a steward to give it a charter and a desk.',\n loadError: 'Could not load stewards.',\n },\n wizard: {\n title: 'New steward',\n stepOf: 'Step {step} of {total}',\n steps: { agent: 'Agent', charter: 'Charter', desk: 'Desk', review: 'Review' },\n next: 'Continue',\n create: 'Create steward',\n creating: 'Creating…',\n agentTitle: 'Base agent',\n agentHelp: 'A steward is an existing agent plus a charter, duties and a desk.',\n pickExisting: 'Use an existing agent',\n createNew: 'Create a new agent',\n noAgents: 'No active agents available. Create one here.',\n agentSearch: 'Search agents',\n agentName: 'Agent name',\n agentPrompt: 'What is this agent for?',\n agentPromptHelp: 'Becomes the agent’s system prompt. You can refine it later.',\n capabilities: 'Capabilities',\n capabilityHelp: 'Capabilities decide which desks the agent can use.',\n capWeb: 'Web browsing',\n capComputer: 'Computer use',\n charterTitle: 'Charter',\n charterHelp:\n 'Plain-language rules, one per line. The reviewer model checks them on every outward action.',\n charterLabel: 'Charter rules',\n charterPlaceholder:\n 'Only summarise ledgers from the Finance folder; never edit source sheets.\\nSend the weekly summary only to finance@example.com.',\n charterRequired: 'Write at least one rule.',\n autonomyTitle: 'Autonomy level',\n autonomyHint: 'Can be lowered at any time; raising it is logged.',\n autonomyLockedByAdmin: 'A workspace admin limits stewards to {level}.',\n toolsTitle: 'Allowed tools & connectors',\n toolsCount: '{count} selected',\n deskTitle: 'Desk',\n deskHelp: 'Where the steward may work on a screen.',\n deskNeeds:\n 'This agent does not have the {capability} capability, so this desk may be refused.',\n egressTitle: 'Web access from the desk',\n allowedHosts: 'Allowed sites',\n allowedHostsHelp: 'One per line: example.com, or *.example.com for its subdomains.',\n reviewTitle: 'Review',\n reviewBody: 'The steward starts as a draft. Activate it from its page when you are ready.',\n reviewAgent: 'Agent',\n reviewAutonomy: 'Autonomy',\n reviewDesk: 'Desk',\n reviewTools: 'Tools',\n reviewBudget: 'Daily AI credits',\n reviewNewAgentDraft:\n 'The new agent is created as a draft. Give it a model and publish it from Agents before you activate the steward.',\n createError: 'Could not create the steward.',\n newAgentError: 'Could not create the agent.',\n },\n detail: {\n owner: 'Base agent',\n tabs: {\n overview: 'Overview',\n charter: 'Charter',\n daybook: 'Daybook',\n duties: 'Duties',\n memory: 'Memory',\n playbooks: 'Playbooks',\n },\n version: 'Charter v{version}, edited {when}',\n pause: 'Pause steward',\n resume: 'Resume',\n activate: 'Activate',\n archive: 'Archive',\n runNow: 'Run now',\n running: 'Starting…',\n runTitle: 'Run now',\n runPrompt: 'What should the steward do?',\n runPromptPlaceholder: 'Check the shared inbox and summarise what needs me today.',\n runDry: 'Dry run — record what it would do, without doing it',\n runStart: 'Start run',\n runError: 'Could not start the run.',\n statusError: 'Could not change the status.',\n overviewToday: 'Today',\n overviewRecent: 'Recent runs',\n noRuns: 'No runs yet.',\n openApprovals: 'Open approvals ({count})',\n archived: 'This steward is archived and cannot be changed.',\n colRun: 'Run',\n colStarted: 'Started',\n colTrigger: 'Trigger',\n },\n charter: {\n rulesTitle: 'Rules',\n rulesHint: 'Plain language — checked by the reviewer model on every outward action',\n rulesLabel: 'Charter rules',\n autonomyTitle: 'Autonomy & budgets',\n usage: 'Today',\n toolsTitle: 'Allowed tools',\n toolsHint: 'An empty list means the steward has no tools.',\n groupLook: 'Look at the screen',\n groupAct: 'Act on the screen',\n groupFiles: 'Files and shell',\n groupPlatform: 'BotManor tools',\n customTitle: 'Connectors and workflows',\n customHint:\n 'One key per line: mcp:<connection>:<tool>, node:<provider>:<operation>, workflow:<id>.',\n customInvalid: 'Not a valid tool key: {key}',\n connectionsLabel: 'Allowed connection ids',\n connectionsHint: 'One id per line.',\n dryRun: 'Dry-run mode',\n dryRunHelp: 'Plan and record actions without executing outward ones.',\n deskTitle: 'Desk web access',\n timezone: 'Time zone',\n timezoneHelp: 'Daily budgets and the daybook count days in this time zone.',\n rulesSection: 'Standing approval rules',\n rulesSectionHint: 'Apply at the Trusted level. Revoke one and the steward asks again.',\n rulesEmpty:\n 'No standing rules. Approving a request with a duty, time-limited or standing scope creates one.',\n colTool: 'Tool',\n colDestination: 'Destination',\n colPurpose: 'Purpose',\n colLimit: 'Limit',\n colExpires: 'Expires',\n revoke: 'Revoke',\n save: 'Save charter',\n saving: 'Saving…',\n saved: 'Charter saved as version {version}.',\n saveError: 'Could not save the charter.',\n unsaved: 'You have unsaved changes.',\n discard: 'Discard changes',\n historyTitle: 'Version history',\n historyCurrent: 'Version {version} — current',\n historyEdited: 'Last edited {when}',\n historySession: 'Saved in this session',\n historyNote:\n 'Every save bumps the version and is recorded on each step it governs. Earlier versions are not listed yet.',\n archivedLocked: 'Archived stewards cannot be edited.',\n forbiddenSave: 'You can read this charter but not change it.',\n },\n daybook: {\n title: 'Daybook',\n prev: 'Previous day',\n next: 'Next day',\n today: 'Today',\n allTriggers: 'All triggers',\n allStatuses: 'All statuses',\n colTime: 'Time',\n colTrigger: 'Trigger',\n colRun: 'Run',\n colStatus: 'Status',\n colSteps: 'Steps',\n colCredits: 'Credits',\n colDuration: 'Duration',\n empty: 'No runs on this day.',\n summary: 'Day summary',\n runs: 'Runs',\n runsBreakdown: '{completed} completed · {failed} failed',\n approvals: 'Approvals',\n approvalsBreakdown: 'asked / granted · {pending} pending',\n spendVsCap: 'Spend vs daily cap',\n stepsVsCap: 'Steps vs daily cap',\n attention: 'Needs attention',\n attentionEmpty: 'Nothing needs attention.',\n dryRun: 'Dry run',\n loadError: 'Could not load the daybook.',\n running: 'running',\n },\n desk: {\n title: 'Live desk',\n hint: 'What the Steward sees and does on its desk',\n intro:\n 'Watch the Steward work on its desk. You can take over for a sign-in, a CAPTCHA or a one-time code.',\n watch: 'Watch live',\n stopWatching: 'Stop watching',\n takeOver: 'Take over',\n takingOver: 'Taking over…',\n handBack: 'Hand back',\n handingBack: 'Handing back…',\n watchAgain: 'Watch again',\n reconnect: 'Reconnect',\n canvasLabelView: 'Live view of the Steward desk. View only.',\n canvasLabelControl:\n 'Live view of the Steward desk. You are in control; keyboard and pointer go to the desk.',\n controlHint: 'Keyboard and pointer go to the desk while it has focus. Press Tab to leave it.',\n waitingFrame: 'Waiting for the desk to send its first image…',\n bannerSteward: 'Steward in control',\n bannerStewardBody: 'You are watching. The Steward is working on the desk.',\n bannerYou: 'You are in control',\n bannerYouBody:\n 'The Steward is paused. What you type goes to the desk and is never recorded. Hand back when you are done.',\n bannerOther: 'Another person is in control',\n bannerOtherBody: 'The Steward is paused while they work on the desk.',\n bannerConnecting: 'Connecting to the desk…',\n bannerReconnecting: 'Connection lost. Reconnecting (attempt {attempt})…',\n endedLease: 'The desk session ended',\n endedLeaseBody: 'Nobody holds the desk any more, so the stream was closed.',\n endedLeaseControlBody:\n 'Your control of the desk ended. Hand back to let the Steward continue, or take over again.',\n endedIdle: 'Stream closed after a period of inactivity',\n endedIdleBody: 'Nothing was sent for a while, so the stream was closed to protect the desk.',\n failedForbidden: 'You cannot view this desk',\n failedForbiddenBody:\n \"Only the Steward's owner and its approvers can watch or take over its desk.\",\n failedNotFound: 'The desk is not available',\n failedNotFoundBody:\n 'The desk or its session was not found. The run may not have started on a desk yet.',\n failedSignIn: 'Please sign in again',\n failedSignInBody:\n 'Your session could not be confirmed for the live view. Sign in again, then reconnect.',\n failedBadRequest: 'The live view could not start',\n failedBadRequestBody: 'The desk stream sent something unexpected. Try again in a moment.',\n failedTooMany: 'Too many open desk streams',\n failedTooManyBody: 'Close another live view, then reconnect.',\n failedUnavailable: 'The desk stream is unavailable',\n failedUnavailableBody:\n 'The connection kept dropping or the desk is not streaming. Try again in a moment.',\n failedMint: 'The live view could not be opened',\n failedMintBody:\n 'The request for a live view was refused. The run may not be on a desk right now.',\n handedBack: 'You handed control back. The Steward will continue from its last checkpoint.',\n actionError: 'The action did not go through.',\n },\n run: {\n title: 'Run',\n steward: 'Steward',\n trigger: 'Trigger',\n autonomy: 'Autonomy',\n started: 'Started',\n stopRun: 'Stop run',\n stopping: 'Stopping…',\n retry: 'Retry',\n retryDry: 'Run again as dry run',\n retryLive: 'Run again live',\n retryLiveConfirm:\n 'A live run repeats real desk actions, such as sends or purchases, and cannot be undone. Use a dry run first unless you are sure.',\n retryLiveConfirmAction: 'Run live',\n retryBlockedActive: 'Another run of this steward is still in progress.',\n retryBlockedStatus: 'Activate the steward before running it again.',\n retrying: 'Starting…',\n retryError: 'Could not start the new run.',\n cancelError: 'Could not stop the run.',\n dryBadge: 'Dry run',\n trustTitle: 'Trust level',\n trustDegraded: 'Lowered during the run',\n trustSame: 'Unchanged during the run',\n budgetTitle: 'Run budget — credits',\n stepsTitle: 'Steps',\n verdictsTitle: 'Policy verdicts',\n verdictsLegend: 'allowed · asked · denied',\n stepsHeading: 'Execution steps',\n stepsOrdered: 'ordered',\n noSteps: 'No steps recorded yet.',\n colNumber: '#',\n colStep: 'Step',\n colVerdict: 'Verdict',\n colCredits: 'Credits',\n colTime: 'Time',\n stepDetail: 'Step {seq} · {tool}',\n pickStep: 'Select a step to see its details.',\n arguments: 'Arguments (redacted)',\n noArguments: 'No arguments.',\n result: 'Result',\n screenshot: 'Desk screenshot',\n screenshotNone: 'No desk for this step.',\n screenshotRef: 'Screenshot file {id}',\n screenshotError: 'The screenshot could not be loaded.',\n screenshotAlt: 'Desk screenshot for this step',\n trail: 'Policy decision',\n trailVerdict: 'Verdict',\n trailReasons: 'Reasons',\n trailClassification: 'Classification',\n trailTrust: 'Trust',\n trailApproval: 'Approval request {id}',\n trailRule: 'Standing rule {id}',\n trailDryRun: 'Recorded in dry-run mode; nothing was executed.',\n cost: 'Cost',\n deskSeconds: 'Desk time',\n approvalsTitle: 'Approvals this run asked for',\n stopReason: 'Stopped: {reason}',\n live: 'Live updates on',\n polling: 'Live updates unavailable — refreshing every few seconds.',\n loadError: 'Could not load the run.',\n },\n },\n} as const;\n"],"mappings":";;AAQA,IAAaC,IAAiB,EAC5B,UAAU;CACR,GAAGD;CACH,KAAK,EAAE,OAAO,WAAW;CACzB,QAAQ;EACN,MAAM;EACN,QAAQ;EACR,SAAS;EACT,OAAO;EACP,MAAM;EACN,OAAO;EACP,OAAO;EACP,SAAS;EACT,SAAS;EACT,gBAAgB;EAChB,eAAe;EACf,YAAY;EACZ,eAAe;EACf,cAAc;CAChB;CACA,OAAO;EACL,QAAQ;GAAE,OAAO;GAAS,QAAQ;GAAU,QAAQ;GAAU,UAAU;EAAW;EACnF,UAAU;GAAE,SAAS;GAAW,KAAK;GAAO,QAAQ;GAAU,SAAS;EAAU;EACjF,cAAc;GACZ,SACE;GACF,KAAK;GACL,QACE;GACF,SACE;EACJ;EACA,MAAM;GACJ,MAAM;GACN,SAAS;GACT,OAAO;GACP,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,SAAS;GACT,OAAO;GACP,aAAa;EACf;EACA,QAAQ;GACN,QAAQ;GACR,YAAY;GACZ,SAAS;EACX;EACA,WAAW;GACT,UAAU;GACV,QAAQ;GACR,SAAS;GACT,kBAAkB;GAClB,kBAAkB;GAClB,eAAe;GACf,WAAW;GACX,QAAQ;GACR,WAAW;GACX,SAAS;EACX;EACA,SAAS;GACP,YAAY;GACZ,UAAU;GACV,SAAS;GACT,WAAW;GACX,gBAAgB;GAChB,iBAAiB;GACjB,OAAO;GACP,WAAW;GACX,KAAK;GACL,UAAU;GACV,KAAK;EACP;EACA,OAAO;GACL,OAAO;G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T,SAAS;EACT,cAAc;EACd,gBAAgB;EAChB,eAAe;EACf,gBAAgB;EAChB,aACE;EACF,gBAAgB;EAChB,eAAe;CACjB;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;EACb,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,WAAW;EACX,UAAU;EACV,YAAY;EACZ,aAAa;EACb,OAAO;EACP,SAAS;EACT,MAAM;EACN,eAAe;EACf,WAAW;EACX,oBAAoB;EACpB,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,gBAAgB;EAChB,QAAQ;EACR,WAAW;EACX,SAAS;CACX;CACA,MAAM;EACJ,OAAO;EACP,MAAM;EACN,OACE;EACF,OAAO;EACP,cAAc;EACd,UAAU;EACV,YAAY;EACZ,UAAU;EACV,aAAa;EACb,YAAY;EACZ,WAAW;EACX,iBAAiB;EACjB,oBACE;EACF,aAAa;EACb,cAAc;EACd,eAAe;EACf,mBAAmB;EACnB,WAAW;EACX,eACE;EACF,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB;EACpB,YAAY;EACZ,gBAAgB;EAChB,uBACE;EACF,WAAW;EACX,eAAe;EACf,iBAAiB;EACjB,qBACE;EACF,gBAAgB;EAChB,oBACE;EACF,cAAc;EACd,kBACE;EACF,kBAAkB;EAClB,sBAAsB;EACtB,eAAe;EACf,mBAAmB;EACnB,mBAAmB;EACnB,uBACE;EACF,YAAY;EACZ,gBACE;EACF,YAAY;EACZ,aAAa;CACf;CACA,KAAK;EACH,OAAO;EACP,SAAS;EACT,SAAS;EACT,UAAU;EACV,SAAS;EACT,SAAS;EACT,UAAU;EACV,OAAO;EACP,UAAU;EACV,WAAW;EACX,kBACE;EACF,wBAAwB;EACxB,oBAAoB;EACpB,oBAAoB;EACpB,UAAU;EACV,YAAY;EACZ,aAAa;EACb,UAAU;EACV,YAAY;EACZ,eAAe;EACf,WAAW;EACX,aAAa;EACb,YAAY;EACZ,eAAe;EACf,gBAAgB;EAChB,cAAc;EACd,cAAc;EACd,SAAS;EACT,WAAW;EACX,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,SAAS;EACT,YAAY;EACZ,UAAU;EACV,WAAW;EACX,aAAa;EACb,QAAQ;EACR,YAAY;EACZ,gBAAgB;EAChB,eAAe;EACf,iBAAiB;EACjB,eAAe;EACf,OAAO;EACP,cAAc;EACd,cAAc;EACd,qBAAqB;EACrB,YAAY;EACZ,eAAe;EACf,WAAW;EACX,aAAa;EACb,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,YAAY;EACZ,MAAM;EACN,SAAS;EACT,WAAW;CACb;AACF,EACF"}
|
|
1
|
+
{"version":3,"file":"en.js","names":["enEditors","enTranslations"],"sources":["../../../src/stewards/i18n/en.ts"],"sourcesContent":["/**\n * English strings for microfe-stewards. Keys are dot-notation; the host's\n * I18nProvider resolves them against the translations it loads, and `useStewardsT`\n * falls back to this object when the host has no entry (or no provider).\n * Register it with the shell's `fallbackTranslations`.\n */\nimport { enEditors } from './enEditors';\n\nexport const enTranslations = {\n stewards: {\n ...enEditors,\n nav: { label: 'Stewards' },\n common: {\n back: 'Back',\n cancel: 'Cancel',\n loading: 'Loading…',\n retry: 'Try again',\n none: 'None',\n noCap: 'No cap',\n never: 'Never',\n credits: 'credits',\n unknown: 'Unknown',\n forbiddenTitle: 'You do not have access',\n forbiddenBody: 'Your role does not allow you to view Stewards in this workspace.',\n errorTitle: 'Something went wrong',\n notFoundTitle: 'Not found',\n notFoundBody: 'This steward or run does not exist, or you cannot see it.',\n },\n enums: {\n status: { DRAFT: 'Draft', ACTIVE: 'Active', PAUSED: 'Paused', ARCHIVED: 'Archived' },\n autonomy: { OBSERVE: 'Observe', ASK: 'Ask', GUIDED: 'Guided', TRUSTED: 'Trusted' },\n autonomyHelp: {\n OBSERVE:\n 'Read only, by construction. Can look, summarise and report; no outward actions exist.',\n ASK: 'Every outward action asks a person first.',\n GUIDED:\n 'A reviewer model decides each outward action against the charter; when unsure it asks you.',\n TRUSTED:\n 'Your standing rules apply first, then the reviewer model. Still bounded by budgets.',\n },\n desk: {\n NONE: 'No desk',\n BROWSER: 'Browser only',\n CLOUD: 'Cloud desk',\n OWN_MACHINE: 'Own machine',\n },\n deskHelp: {\n NONE: 'Works through connectors and tools only.',\n BROWSER: 'A managed browser. The agent needs the Web browsing capability.',\n CLOUD: 'A cloud desktop. The agent needs the Computer use capability.',\n OWN_MACHINE: 'A machine you connect. The agent needs the Computer use capability.',\n },\n egress: {\n PUBLIC: 'Any public site',\n ALLOW_LIST: 'Only the sites I list',\n BLOCKED: 'No web access',\n },\n runStatus: {\n PROPOSED: 'Proposed',\n QUEUED: 'Queued',\n RUNNING: 'Running',\n WAITING_APPROVAL: 'Waiting for approval',\n WAITING_TAKEOVER: 'Waiting for a person',\n PAUSED_BUDGET: 'Paused — budget',\n COMPLETED: 'Completed',\n FAILED: 'Failed',\n CANCELLED: 'Cancelled',\n STOPPED: 'Stopped',\n },\n trigger: {\n OWNER_CHAT: 'Owner chat',\n SCHEDULE: 'Schedule',\n WEBHOOK: 'Webhook',\n APP_EVENT: 'App event',\n PLATFORM_EVENT: 'Platform event',\n CHANNEL_MESSAGE: 'Channel message',\n WATCH: 'Watch',\n PROACTIVE: 'Proactive',\n API: 'API',\n WORKFLOW: 'Workflow',\n A2A: 'Agent to agent',\n },\n trust: {\n OWNER: 'Owner',\n MEMBER: 'Member',\n SYSTEM: 'System',\n EXTERNAL: 'External content',\n UNTRUSTED: 'Untrusted content',\n },\n stepKind: {\n MODEL_CALL: 'Model call',\n TOOL_CALL: 'Connector tool',\n DESK_ACTION: 'Desk action',\n APPROVAL_WAIT: 'Approval wait',\n TAKEOVER: 'Takeover',\n SUB_RUN: 'Sub-run',\n MEMORY_WRITE: 'Memory write',\n NOTE: 'Note',\n },\n verdict: {\n ALLOWED: 'Allowed',\n ASKED: 'Asked',\n APPROVED: 'Approved',\n DENIED: 'Denied',\n BLOCKED_DRY_RUN: 'Dry run',\n FAILED: 'Failed',\n SKIPPED: 'Skipped',\n },\n approvalStatus: {\n PENDING: 'Pending',\n APPROVED: 'Approved',\n DENIED: 'Denied',\n EXPIRED: 'Expired',\n CANCELLED: 'Cancelled',\n },\n scope: {\n ONCE: 'Once',\n RUN: 'This run',\n DUTY: 'This duty',\n TIME_LIMITED: 'Time-limited',\n STANDING: 'Standing',\n },\n },\n tools: {\n 'desk:screenshot': 'Screenshot',\n 'desk:snapshot': 'Read the screen structure',\n 'desk:click': 'Click',\n 'desk:type': 'Type',\n 'desk:key': 'Press keys',\n 'desk:scroll': 'Scroll',\n 'desk:navigate': 'Open a URL',\n 'desk:focus_window': 'Switch window',\n 'desk:secret_fill': 'Fill a stored secret',\n 'desk:shell': 'Run shell commands',\n 'desk:read_file': 'Read files',\n 'desk:write_file': 'Write files',\n 'platform:current_time': 'Check the time',\n 'platform:notify_owner': 'Notify the owner',\n 'workqueue:list': 'See the work queues',\n 'workqueue:add': 'Add work items',\n 'workqueue:lease': 'Take the next work item',\n 'workqueue:extend': 'Keep working on an item longer',\n 'workqueue:complete': 'Mark a work item done',\n 'workqueue:fail': 'Report a work item as failed',\n 'workflow-run:read': 'Read the result of a workflow run (review tasks)',\n },\n budget: {\n credits: 'AI credits',\n deskMinutes: 'Desk minutes',\n steps: 'Steps',\n wallSeconds: 'Wall-clock seconds',\n connectorSpendMinor: 'Connector spend (minor units)',\n perRun: 'Per run',\n perDay: 'Per day',\n total: 'Total',\n limit: 'Limit',\n invalid: 'Enter a number of 0 or more for {name} (whole numbers, except credits).',\n hint: 'Run stops when any limit is hit. Leave a box empty for no cap at that level.',\n },\n fixed: {\n title: 'Always asks a person — can’t be loosened',\n badge: 'Fixed',\n password: 'Password and security-setting changes',\n payment: 'Entering payment details',\n otp: 'Reading one-time codes',\n external: 'Messages to people outside the workspace',\n },\n list: {\n title: 'Stewards',\n subtitle:\n 'Agents with a charter, duties and a desk — they work on a schedule or on events, inside the limits you set.',\n newSteward: 'New steward',\n statusFilter: 'Status',\n allStatuses: 'All',\n tableLabel: 'Stewards',\n colSteward: 'Steward',\n colStatus: 'Status',\n colAutonomy: 'Autonomy',\n colDesk: 'Desk',\n colLastRun: 'Last run',\n colToday: 'Today · spend / daily cap',\n colWaiting: 'Waiting',\n neverRun: 'Never run',\n tileActive: 'Active stewards',\n tileWaiting: 'Waiting for approval',\n tileWaitingHint: 'Approval requests across stewards',\n tileSpend: 'Credits used today',\n empty: 'No stewards yet.',\n emptyFiltered: 'No stewards match this status.',\n emptyHint: 'Make one of your agents a steward to give it a charter and a desk.',\n loadError: 'Could not load stewards.',\n },\n wizard: {\n title: 'New steward',\n stepOf: 'Step {step} of {total}',\n steps: { agent: 'Agent', charter: 'Charter', desk: 'Desk', review: 'Review' },\n next: 'Continue',\n create: 'Create steward',\n creating: 'Creating…',\n agentTitle: 'Base agent',\n agentHelp: 'A steward is an existing agent plus a charter, duties and a desk.',\n pickExisting: 'Use an existing agent',\n createNew: 'Create a new agent',\n noAgents: 'No active agents available. Create one here.',\n agentSearch: 'Search agents',\n agentName: 'Agent name',\n agentPrompt: 'What is this agent for?',\n agentPromptHelp: 'Becomes the agent’s system prompt. You can refine it later.',\n capabilities: 'Capabilities',\n capabilityHelp: 'Capabilities decide which desks the agent can use.',\n capWeb: 'Web browsing',\n capComputer: 'Computer use',\n charterTitle: 'Charter',\n charterHelp:\n 'Plain-language rules, one per line. The reviewer model checks them on every outward action.',\n charterLabel: 'Charter rules',\n charterPlaceholder:\n 'Only summarise ledgers from the Finance folder; never edit source sheets.\\nSend the weekly summary only to finance@example.com.',\n charterRequired: 'Write at least one rule.',\n autonomyTitle: 'Autonomy level',\n autonomyHint: 'Can be lowered at any time; raising it is logged.',\n autonomyLockedByAdmin: 'A workspace admin limits stewards to {level}.',\n toolsTitle: 'Allowed tools & connectors',\n toolsCount: '{count} selected',\n deskTitle: 'Desk',\n deskHelp: 'Where the steward may work on a screen.',\n deskNeeds:\n 'This agent does not have the {capability} capability, so this desk may be refused.',\n egressTitle: 'Web access from the desk',\n allowedHosts: 'Allowed sites',\n allowedHostsHelp: 'One per line: example.com, or *.example.com for its subdomains.',\n reviewTitle: 'Review',\n reviewBody: 'The steward starts as a draft. Activate it from its page when you are ready.',\n reviewAgent: 'Agent',\n reviewAutonomy: 'Autonomy',\n reviewDesk: 'Desk',\n reviewTools: 'Tools',\n reviewBudget: 'Daily AI credits',\n reviewNewAgentDraft:\n 'The new agent is created as a draft. Give it a model and publish it from Agents before you activate the steward.',\n createError: 'Could not create the steward.',\n newAgentError: 'Could not create the agent.',\n },\n detail: {\n owner: 'Base agent',\n tabs: {\n overview: 'Overview',\n charter: 'Charter',\n daybook: 'Daybook',\n duties: 'Duties',\n memory: 'Memory',\n playbooks: 'Playbooks',\n },\n version: 'Charter v{version}, edited {when}',\n pause: 'Pause steward',\n resume: 'Resume',\n activate: 'Activate',\n archive: 'Archive',\n runNow: 'Run now',\n running: 'Starting…',\n runTitle: 'Run now',\n runPrompt: 'What should the steward do?',\n runPromptPlaceholder: 'Check the shared inbox and summarise what needs me today.',\n runDry: 'Dry run — record what it would do, without doing it',\n runStart: 'Start run',\n runError: 'Could not start the run.',\n statusError: 'Could not change the status.',\n overviewToday: 'Today',\n overviewRecent: 'Recent runs',\n noRuns: 'No runs yet.',\n openApprovals: 'Open approvals ({count})',\n archived: 'This steward is archived and cannot be changed.',\n colRun: 'Run',\n colStarted: 'Started',\n colTrigger: 'Trigger',\n },\n charter: {\n rulesTitle: 'Rules',\n rulesHint: 'Plain language — checked by the reviewer model on every outward action',\n rulesLabel: 'Charter rules',\n autonomyTitle: 'Autonomy & budgets',\n usage: 'Today',\n toolsTitle: 'Allowed tools',\n toolsHint: 'An empty list means the steward has no tools.',\n groupLook: 'Look at the screen',\n groupAct: 'Act on the screen',\n groupFiles: 'Files and shell',\n groupPlatform: 'BotManor tools',\n groupWorkQueues: 'FluidGrids work queues and review tasks',\n customTitle: 'Connectors and workflows',\n customHint:\n 'One key per line: mcp:<connection>:<tool>, node:<provider>:<operation>, workflow:<id>.',\n customInvalid: 'Not a valid tool key: {key}',\n connectionsLabel: 'Allowed connection ids',\n connectionsHint: 'One id per line.',\n dryRun: 'Dry-run mode',\n dryRunHelp: 'Plan and record actions without executing outward ones.',\n deskTitle: 'Desk web access',\n timezone: 'Time zone',\n timezoneHelp: 'Daily budgets and the daybook count days in this time zone.',\n rulesSection: 'Standing approval rules',\n rulesSectionHint: 'Apply at the Trusted level. Revoke one and the steward asks again.',\n rulesEmpty:\n 'No standing rules. Approving a request with a duty, time-limited or standing scope creates one.',\n colTool: 'Tool',\n colDestination: 'Destination',\n colPurpose: 'Purpose',\n colLimit: 'Limit',\n colExpires: 'Expires',\n revoke: 'Revoke',\n save: 'Save charter',\n saving: 'Saving…',\n saved: 'Charter saved as version {version}.',\n saveError: 'Could not save the charter.',\n unsaved: 'You have unsaved changes.',\n discard: 'Discard changes',\n historyTitle: 'Version history',\n historyCurrent: 'Version {version} — current',\n historyEdited: 'Last edited {when}',\n historySession: 'Saved in this session',\n historyNote:\n 'Every save bumps the version and is recorded on each step it governs. Earlier versions are not listed yet.',\n archivedLocked: 'Archived stewards cannot be edited.',\n forbiddenSave: 'You can read this charter but not change it.',\n },\n daybook: {\n title: 'Daybook',\n prev: 'Previous day',\n next: 'Next day',\n today: 'Today',\n allTriggers: 'All triggers',\n allStatuses: 'All statuses',\n colTime: 'Time',\n colTrigger: 'Trigger',\n colRun: 'Run',\n colStatus: 'Status',\n colSteps: 'Steps',\n colCredits: 'Credits',\n colDuration: 'Duration',\n empty: 'No runs on this day.',\n summary: 'Day summary',\n runs: 'Runs',\n runsBreakdown: '{completed} completed · {failed} failed',\n approvals: 'Approvals',\n approvalsBreakdown: 'asked / granted · {pending} pending',\n spendVsCap: 'Spend vs daily cap',\n stepsVsCap: 'Steps vs daily cap',\n attention: 'Needs attention',\n attentionEmpty: 'Nothing needs attention.',\n dryRun: 'Dry run',\n loadError: 'Could not load the daybook.',\n running: 'running',\n },\n desk: {\n title: 'Live desk',\n hint: 'What the Steward sees and does on its desk',\n intro:\n 'Watch the Steward work on its desk. You can take over for a sign-in, a CAPTCHA or a one-time code.',\n watch: 'Watch live',\n stopWatching: 'Stop watching',\n takeOver: 'Take over',\n takingOver: 'Taking over…',\n handBack: 'Hand back',\n handingBack: 'Handing back…',\n watchAgain: 'Watch again',\n reconnect: 'Reconnect',\n canvasLabelView: 'Live view of the Steward desk. View only.',\n canvasLabelControl:\n 'Live view of the Steward desk. You are in control; keyboard and pointer go to the desk.',\n controlHint: 'Keyboard and pointer go to the desk while it has focus. Press Tab to leave it.',\n waitingFrame: 'Waiting for the desk to send its first image…',\n bannerSteward: 'Steward in control',\n bannerStewardBody: 'You are watching. The Steward is working on the desk.',\n bannerYou: 'You are in control',\n bannerYouBody:\n 'The Steward is paused. What you type goes to the desk and is never recorded. Hand back when you are done.',\n bannerOther: 'Another person is in control',\n bannerOtherBody: 'The Steward is paused while they work on the desk.',\n bannerConnecting: 'Connecting to the desk…',\n bannerReconnecting: 'Connection lost. Reconnecting (attempt {attempt})…',\n endedLease: 'The desk session ended',\n endedLeaseBody: 'Nobody holds the desk any more, so the stream was closed.',\n endedLeaseControlBody:\n 'Your control of the desk ended. Hand back to let the Steward continue, or take over again.',\n endedIdle: 'Stream closed after a period of inactivity',\n endedIdleBody: 'Nothing was sent for a while, so the stream was closed to protect the desk.',\n failedForbidden: 'You cannot view this desk',\n failedForbiddenBody:\n \"Only the Steward's owner and its approvers can watch or take over its desk.\",\n failedNotFound: 'The desk is not available',\n failedNotFoundBody:\n 'The desk or its session was not found. The run may not have started on a desk yet.',\n failedSignIn: 'Please sign in again',\n failedSignInBody:\n 'Your session could not be confirmed for the live view. Sign in again, then reconnect.',\n failedBadRequest: 'The live view could not start',\n failedBadRequestBody: 'The desk stream sent something unexpected. Try again in a moment.',\n failedTooMany: 'Too many open desk streams',\n failedTooManyBody: 'Close another live view, then reconnect.',\n failedUnavailable: 'The desk stream is unavailable',\n failedUnavailableBody:\n 'The connection kept dropping or the desk is not streaming. Try again in a moment.',\n failedMint: 'The live view could not be opened',\n failedMintBody:\n 'The request for a live view was refused. The run may not be on a desk right now.',\n handedBack: 'You handed control back. The Steward will continue from its last checkpoint.',\n actionError: 'The action did not go through.',\n },\n run: {\n title: 'Run',\n steward: 'Steward',\n trigger: 'Trigger',\n autonomy: 'Autonomy',\n started: 'Started',\n stopRun: 'Stop run',\n stopping: 'Stopping…',\n retry: 'Retry',\n retryDry: 'Run again as dry run',\n retryLive: 'Run again live',\n retryLiveConfirm:\n 'A live run repeats real desk actions, such as sends or purchases, and cannot be undone. Use a dry run first unless you are sure.',\n retryLiveConfirmAction: 'Run live',\n retryBlockedActive: 'Another run of this steward is still in progress.',\n retryBlockedStatus: 'Activate the steward before running it again.',\n retrying: 'Starting…',\n retryError: 'Could not start the new run.',\n cancelError: 'Could not stop the run.',\n dryBadge: 'Dry run',\n trustTitle: 'Trust level',\n trustDegraded: 'Lowered during the run',\n trustSame: 'Unchanged during the run',\n budgetTitle: 'Run budget — credits',\n stepsTitle: 'Steps',\n verdictsTitle: 'Policy verdicts',\n verdictsLegend: 'allowed · asked · denied',\n stepsHeading: 'Execution steps',\n stepsOrdered: 'ordered',\n noSteps: 'No steps recorded yet.',\n colNumber: '#',\n colStep: 'Step',\n colVerdict: 'Verdict',\n colCredits: 'Credits',\n colTime: 'Time',\n stepDetail: 'Step {seq} · {tool}',\n pickStep: 'Select a step to see its details.',\n arguments: 'Arguments (redacted)',\n noArguments: 'No arguments.',\n result: 'Result',\n screenshot: 'Desk screenshot',\n screenshotNone: 'No desk for this step.',\n screenshotRef: 'Screenshot file {id}',\n screenshotError: 'The screenshot could not be loaded.',\n screenshotAlt: 'Desk screenshot for this step',\n trail: 'Policy decision',\n trailVerdict: 'Verdict',\n trailReasons: 'Reasons',\n trailClassification: 'Classification',\n trailTrust: 'Trust',\n trailApproval: 'Approval request {id}',\n trailRule: 'Standing rule {id}',\n trailDryRun: 'Recorded in dry-run mode; nothing was executed.',\n cost: 'Cost',\n deskSeconds: 'Desk time',\n approvalsTitle: 'Approvals this run asked for',\n stopReason: 'Stopped: {reason}',\n live: 'Live updates on',\n polling: 'Live updates unavailable — refreshing every few seconds.',\n loadError: 'Could not load the run.',\n },\n },\n} as const;\n"],"mappings":";;AAQA,IAAaC,IAAiB,EAC5B,UAAU;CACR,GAAGD;CACH,KAAK,EAAE,OAAO,WAAW;CACzB,QAAQ;EACN,MAAM;EACN,QAAQ;EACR,SAAS;EACT,OAAO;EACP,MAAM;EACN,OAAO;EACP,OAAO;EACP,SAAS;EACT,SAAS;EACT,gBAAgB;EAChB,eAAe;EACf,YAAY;EACZ,eAAe;EACf,cAAc;CAChB;CACA,OAAO;EACL,QAAQ;GAAE,OAAO;GAAS,QAAQ;GAAU,QAAQ;GAAU,UAAU;EAAW;EACnF,UAAU;GAAE,SAAS;GAAW,KAAK;GAAO,QAAQ;GAAU,SAAS;EAAU;EACjF,cAAc;GACZ,SACE;GACF,KAAK;GACL,QACE;GACF,SACE;EACJ;EACA,MAAM;GACJ,MAAM;GACN,SAAS;GACT,OAAO;GACP,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,SAAS;GACT,OAAO;GACP,aAAa;EACf;EACA,QAAQ;GACN,QAAQ;GACR,YAAY;GACZ,SAAS;EACX;EACA,WAAW;GACT,UAAU;GACV,QAAQ;GACR,SAAS;GACT,kBAAkB;GAClB,kBAAkB;GAClB,eAAe;GACf,WAAW;GACX,QAAQ;GACR,WAAW;GACX,SAAS;EACX;EACA,SAAS;GACP,YAAY;GACZ,UAAU;GACV,SAAS;GACT,WAAW;GACX,gBAAgB;GAChB,iBAAiB;GACjB,OAAO;GACP,WAAW;GACX,KAAK;GACL,UAAU;GACV,KAAK;EACP;EACA,OAAO;GACL,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,UAAU;GACV,WAAW;EACb;EACA,UAAU;GACR,YAAY;GACZ,WAAW;GACX,aAAa;GACb,eAAe;GACf,UAAU;GACV,SAAS;GACT,cAAc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d,gBAAgB;EAChB,eAAe;EACf,gBAAgB;EAChB,aACE;EACF,gBAAgB;EAChB,eAAe;CACjB;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;EACb,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,WAAW;EACX,UAAU;EACV,YAAY;EACZ,aAAa;EACb,OAAO;EACP,SAAS;EACT,MAAM;EACN,eAAe;EACf,WAAW;EACX,oBAAoB;EACpB,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,gBAAgB;EAChB,QAAQ;EACR,WAAW;EACX,SAAS;CACX;CACA,MAAM;EACJ,OAAO;EACP,MAAM;EACN,OACE;EACF,OAAO;EACP,cAAc;EACd,UAAU;EACV,YAAY;EACZ,UAAU;EACV,aAAa;EACb,YAAY;EACZ,WAAW;EACX,iBAAiB;EACjB,oBACE;EACF,aAAa;EACb,cAAc;EACd,eAAe;EACf,mBAAmB;EACnB,WAAW;EACX,eACE;EACF,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB;EACpB,YAAY;EACZ,gBAAgB;EAChB,uBACE;EACF,WAAW;EACX,eAAe;EACf,iBAAiB;EACjB,qBACE;EACF,gBAAgB;EAChB,oBACE;EACF,cAAc;EACd,kBACE;EACF,kBAAkB;EAClB,sBAAsB;EACtB,eAAe;EACf,mBAAmB;EACnB,mBAAmB;EACnB,uBACE;EACF,YAAY;EACZ,gBACE;EACF,YAAY;EACZ,aAAa;CACf;CACA,KAAK;EACH,OAAO;EACP,SAAS;EACT,SAAS;EACT,UAAU;EACV,SAAS;EACT,SAAS;EACT,UAAU;EACV,OAAO;EACP,UAAU;EACV,WAAW;EACX,kBACE;EACF,wBAAwB;EACxB,oBAAoB;EACpB,oBAAoB;EACpB,UAAU;EACV,YAAY;EACZ,aAAa;EACb,UAAU;EACV,YAAY;EACZ,eAAe;EACf,WAAW;EACX,aAAa;EACb,YAAY;EACZ,eAAe;EACf,gBAAgB;EAChB,cAAc;EACd,cAAc;EACd,SAAS;EACT,WAAW;EACX,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,SAAS;EACT,YAAY;EACZ,UAAU;EACV,WAAW;EACX,aAAa;EACb,QAAQ;EACR,YAAY;EACZ,gBAAgB;EAChB,eAAe;EACf,iBAAiB;EACjB,eAAe;EACf,OAAO;EACP,cAAc;EACd,cAAc;EACd,qBAAqB;EACrB,YAAY;EACZ,eAAe;EACf,WAAW;EACX,aAAa;EACb,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,YAAY;EACZ,MAAM;EACN,SAAS;EACT,WAAW;CACb;AACF,EACF"}
|
|
@@ -19,6 +19,9 @@ export declare const DESK_TOOL_GROUPS: readonly [{
|
|
|
19
19
|
}, {
|
|
20
20
|
readonly id: "groupPlatform";
|
|
21
21
|
readonly keys: readonly ["platform:current_time", "platform:notify_owner"];
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "groupWorkQueues";
|
|
24
|
+
readonly keys: readonly ["workqueue:list", "workqueue:add", "workqueue:lease", "workqueue:extend", "workqueue:complete", "workqueue:fail", "workflow-run:read"];
|
|
22
25
|
}];
|
|
23
26
|
/** Keys outside the switch list: connectors (mcp, node) and workflows. */
|
|
24
27
|
export declare function customToolKeys(allowed: readonly string[]): string[];
|
|
@@ -37,6 +37,18 @@ var e = [
|
|
|
37
37
|
{
|
|
38
38
|
id: "groupPlatform",
|
|
39
39
|
keys: ["platform:current_time", "platform:notify_owner"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "groupWorkQueues",
|
|
43
|
+
keys: [
|
|
44
|
+
"workqueue:list",
|
|
45
|
+
"workqueue:add",
|
|
46
|
+
"workqueue:lease",
|
|
47
|
+
"workqueue:extend",
|
|
48
|
+
"workqueue:complete",
|
|
49
|
+
"workqueue:fail",
|
|
50
|
+
"workflow-run:read"
|
|
51
|
+
]
|
|
40
52
|
}
|
|
41
53
|
], r = new Set(n.flatMap((e) => e.keys));
|
|
42
54
|
function i(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charterForm.js","names":["BUDGET_KEYS","BUDGET_LEVELS","DESK_TOOL_GROUPS","SWITCH_KEYS","g","customToolKeys","allowed","k","mergeToolKeys","switches","custom","CUSTOM_TOOL_KEY","firstInvalidCustomKey","keys","splitLines","text","l","budgetToForm","budget","out","key","value","emptyBudgetsForm","formToBudget","form","raw","n","sameBudget","a","b","LEVEL_FIELD","sameList","v","i","buildCharterUpdate","initial","current","input","bad","level","parsed","charterToForm","charter"],"sources":["../../../src/stewards/utils/charterForm.ts"],"sourcesContent":["import type {\n BotmanorStewardAutonomy,\n BotmanorStewardBudgetInput,\n BotmanorStewardDeskEgressMode,\n UpdateBotmanorStewardCharterInput,\n} from '../../generated/wspace-types';\n\nexport const BUDGET_KEYS = [\n 'credits',\n 'deskMinutes',\n 'steps',\n 'wallSeconds',\n 'connectorSpendMinor',\n] as const;\nexport type BudgetKey = (typeof BUDGET_KEYS)[number];\nexport const BUDGET_LEVELS = ['perRun', 'perDay', 'total'] as const;\nexport type BudgetLevel = (typeof BUDGET_LEVELS)[number];\n\n/** Text boxes: an empty box means \"no cap at this level\". */\nexport type BudgetFormValue = Record<BudgetKey, string>;\nexport type BudgetsForm = Record<BudgetLevel, BudgetFormValue>;\n\n/** Desk actions the charter can allow, grouped for the switches (spec 10 section 3.2). */\nexport const DESK_TOOL_GROUPS = [\n { id: 'groupLook', keys: ['desk:screenshot', 'desk:snapshot'] },\n {\n id: 'groupAct',\n keys: [\n 'desk:click',\n 'desk:type',\n 'desk:key',\n 'desk:scroll',\n 'desk:navigate',\n 'desk:focus_window',\n ],\n },\n {\n id: 'groupFiles',\n keys: ['desk:secret_fill', 'desk:shell', 'desk:read_file', 'desk:write_file'],\n },\n { id: 'groupPlatform', keys: ['platform:current_time', 'platform:notify_owner'] },\n] as const;\n\nconst SWITCH_KEYS: ReadonlySet<string> = new Set(DESK_TOOL_GROUPS.flatMap((g) => g.keys));\n\n/** Keys outside the switch list: connectors (mcp, node) and workflows. */\nexport function customToolKeys(allowed: readonly string[]): string[] {\n return allowed.filter((k) => !SWITCH_KEYS.has(k));\n}\n\n/** The allow-list the server stores: switches on, plus the custom keys, de-duplicated. */\nexport function mergeToolKeys(switches: readonly string[], custom: readonly string[]): string[] {\n return [...new Set([...switches, ...custom])];\n}\n\nconst CUSTOM_TOOL_KEY =\n /^(mcp:[A-Za-z0-9][A-Za-z0-9_.-]{0,127}:[A-Za-z0-9][A-Za-z0-9_.-]{0,127}|node:[a-z0-9_]+:[A-Za-z0-9_]+|workflow:[A-Za-z0-9][A-Za-z0-9_.-]{0,127})$/;\n\n/** The first custom key the server would refuse by shape, else null. */\nexport function firstInvalidCustomKey(keys: readonly string[]): string | null {\n return keys.find((k) => !CUSTOM_TOOL_KEY.test(k)) ?? null;\n}\n\n/** One entry per non-empty line, trimmed. */\nexport function splitLines(text: string): string[] {\n return [\n ...new Set(\n text\n .split(/\\r?\\n/)\n .map((l) => l.trim())\n .filter(Boolean)\n ),\n ];\n}\n\ntype BudgetLike = Partial<Record<BudgetKey, number | null>> | null | undefined;\n\nexport function budgetToForm(budget: BudgetLike): BudgetFormValue {\n const out = {} as BudgetFormValue;\n for (const key of BUDGET_KEYS) {\n const value = budget?.[key];\n out[key] = value == null ? '' : String(value);\n }\n return out;\n}\n\nexport function emptyBudgetsForm(): BudgetsForm {\n return { perRun: budgetToForm(null), perDay: budgetToForm(null), total: budgetToForm(null) };\n}\n\n/**\n * Parses the boxes. Credits may be fractional; the others are whole numbers.\n * Returns the offending key on a bad value (negative, not a number).\n */\nexport function formToBudget(\n form: BudgetFormValue\n): { ok: true; value: BotmanorStewardBudgetInput } | { ok: false; key: BudgetKey } {\n const value: BotmanorStewardBudgetInput = {};\n for (const key of BUDGET_KEYS) {\n const raw = form[key].trim();\n if (raw === '') continue;\n const n = Number(raw);\n const valid = Number.isFinite(n) && n >= 0 && (key === 'credits' ? true : Number.isInteger(n));\n if (!valid) return { ok: false, key };\n value[key] = n;\n }\n return { ok: true, value };\n}\n\nfunction sameBudget(a: BudgetFormValue, b: BudgetFormValue): boolean {\n return BUDGET_KEYS.every((k) => a[k].trim() === b[k].trim());\n}\n\nexport interface CharterForm {\n charterText: string;\n autonomyLevel: BotmanorStewardAutonomy;\n allowedToolKeys: string[];\n allowedConnectionIds: string[];\n budgets: BudgetsForm;\n dryRunDefault: boolean;\n deskEgressMode: BotmanorStewardDeskEgressMode;\n deskAllowedHosts: string[];\n timezone: string;\n}\n\nexport type CharterFormError =\n | { kind: 'budget'; level: BudgetLevel; key: BudgetKey }\n | { kind: 'toolKey'; key: string }\n | { kind: 'charterText' };\n\nconst LEVEL_FIELD = {\n perRun: 'budgetPerRun',\n perDay: 'budgetPerDay',\n total: 'budgetTotal',\n} as const;\n\nfunction sameList(a: readonly string[], b: readonly string[]): boolean {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n}\n\n/**\n * The update input holding only what changed (the server bumps charterVersion\n * on every change, so an unchanged save must send nothing), or the first error.\n */\nexport function buildCharterUpdate(\n initial: CharterForm,\n current: CharterForm\n): { ok: true; input: UpdateBotmanorStewardCharterInput } | { ok: false; error: CharterFormError } {\n const input: UpdateBotmanorStewardCharterInput = {};\n if (current.charterText.trim() !== initial.charterText.trim()) {\n if (current.charterText.trim() === '') return { ok: false, error: { kind: 'charterText' } };\n input.charterText = current.charterText.trim();\n }\n if (current.autonomyLevel !== initial.autonomyLevel) input.autonomyLevel = current.autonomyLevel;\n if (!sameList(current.allowedToolKeys, initial.allowedToolKeys)) {\n const bad = firstInvalidCustomKey(customToolKeys(current.allowedToolKeys));\n if (bad) return { ok: false, error: { kind: 'toolKey', key: bad } };\n input.allowedToolKeys = current.allowedToolKeys;\n }\n if (!sameList(current.allowedConnectionIds, initial.allowedConnectionIds)) {\n input.allowedConnectionIds = current.allowedConnectionIds;\n }\n for (const level of BUDGET_LEVELS) {\n if (sameBudget(current.budgets[level], initial.budgets[level])) continue;\n const parsed = formToBudget(current.budgets[level]);\n if (!parsed.ok) return { ok: false, error: { kind: 'budget', level, key: parsed.key } };\n input[LEVEL_FIELD[level]] = parsed.value;\n }\n if (current.dryRunDefault !== initial.dryRunDefault) input.dryRunDefault = current.dryRunDefault;\n if (current.deskEgressMode !== initial.deskEgressMode) {\n input.deskEgressMode = current.deskEgressMode;\n }\n if (!sameList(current.deskAllowedHosts, initial.deskAllowedHosts)) {\n input.deskAllowedHosts = current.deskAllowedHosts;\n }\n if (current.timezone.trim() !== initial.timezone.trim()) input.timezone = current.timezone.trim();\n return { ok: true, input };\n}\n\ninterface CharterSource {\n charterText: string;\n autonomyLevel: BotmanorStewardAutonomy;\n allowedToolKeys: string[];\n allowedConnectionIds: string[];\n budgetPerRun: BudgetLike;\n budgetPerDay: BudgetLike;\n budgetTotal: BudgetLike;\n dryRunDefault: boolean;\n deskEgressMode: BotmanorStewardDeskEgressMode;\n deskAllowedHosts: string[];\n timezone: string;\n}\n\n/** The editable form for a steward's current charter. */\nexport function charterToForm(charter: CharterSource): CharterForm {\n return {\n charterText: charter.charterText,\n autonomyLevel: charter.autonomyLevel,\n allowedToolKeys: [...charter.allowedToolKeys],\n allowedConnectionIds: [...charter.allowedConnectionIds],\n budgets: {\n perRun: budgetToForm(charter.budgetPerRun),\n perDay: budgetToForm(charter.budgetPerDay),\n total: budgetToForm(charter.budgetTotal),\n },\n dryRunDefault: charter.dryRunDefault,\n deskEgressMode: charter.deskEgressMode,\n deskAllowedHosts: [...charter.deskAllowedHosts],\n timezone: charter.timezone,\n };\n}\n"],"mappings":";AAOA,IAAaA,IAAc;CACzB;CACA;CACA;CACA;CACA;AACF,GAEaC,IAAgB;CAAC;CAAU;CAAU;AAAO,GAQ5CC,IAAmB;CAC9B;EAAE,IAAI;EAAa,MAAM,CAAC,mBAAmB,eAAe;CAAE;CAC9D;EACE,IAAI;EACJ,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,IAAI;EACJ,MAAM;GAAC;GAAoB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I,EAAM,GAAG;EAChE,IAAMC,IAASjB,EAAaa,EAAQ,QAAQG,EAAM;EAClD,IAAI,CAACC,EAAO,IAAI,OAAO;GAAE,IAAI;GAAO,OAAO;IAAE,MAAM;IAAUD;IAAO,KAAKC,EAAO;GAAI;EAAE;EACtFH,EAAMP,EAAYS,MAAUC,EAAO;CACrC;CASA,OARIJ,EAAQ,kBAAkBD,EAAQ,kBAAeE,EAAM,gBAAgBD,EAAQ,gBAC/EA,EAAQ,mBAAmBD,EAAQ,mBACrCE,EAAM,iBAAiBD,EAAQ,iBAE5BL,EAASK,EAAQ,kBAAkBD,EAAQ,gBAAgB,MAC9DE,EAAM,mBAAmBD,EAAQ,mBAE/BA,EAAQ,SAAS,KAAK,MAAMD,EAAQ,SAAS,KAAK,MAAGE,EAAM,WAAWD,EAAQ,SAAS,KAAK,IACzF;EAAE,IAAI;EAAMC;CAAM;AAC3B;AAiBA,SAAgBI,EAAcC,GAAqC;CACjE,OAAO;EACL,aAAaA,EAAQ;EACrB,eAAeA,EAAQ;EACvB,iBAAiB,CAAC,GAAGA,EAAQ,eAAe;EAC5C,sBAAsB,CAAC,GAAGA,EAAQ,oBAAoB;EACtD,SAAS;GACP,QAAQzB,EAAayB,EAAQ,YAAY;GACzC,QAAQzB,EAAayB,EAAQ,YAAY;GACzC,OAAOzB,EAAayB,EAAQ,WAAW;EACzC;EACA,eAAeA,EAAQ;EACvB,gBAAgBA,EAAQ;EACxB,kBAAkB,CAAC,GAAGA,EAAQ,gBAAgB;EAC9C,UAAUA,EAAQ;CACpB;AACF"}
|
|
1
|
+
{"version":3,"file":"charterForm.js","names":["BUDGET_KEYS","BUDGET_LEVELS","DESK_TOOL_GROUPS","SWITCH_KEYS","g","customToolKeys","allowed","k","mergeToolKeys","switches","custom","CUSTOM_TOOL_KEY","firstInvalidCustomKey","keys","splitLines","text","l","budgetToForm","budget","out","key","value","emptyBudgetsForm","formToBudget","form","raw","n","sameBudget","a","b","LEVEL_FIELD","sameList","v","i","buildCharterUpdate","initial","current","input","bad","level","parsed","charterToForm","charter"],"sources":["../../../src/stewards/utils/charterForm.ts"],"sourcesContent":["import type {\n BotmanorStewardAutonomy,\n BotmanorStewardBudgetInput,\n BotmanorStewardDeskEgressMode,\n UpdateBotmanorStewardCharterInput,\n} from '../../generated/wspace-types';\n\nexport const BUDGET_KEYS = [\n 'credits',\n 'deskMinutes',\n 'steps',\n 'wallSeconds',\n 'connectorSpendMinor',\n] as const;\nexport type BudgetKey = (typeof BUDGET_KEYS)[number];\nexport const BUDGET_LEVELS = ['perRun', 'perDay', 'total'] as const;\nexport type BudgetLevel = (typeof BUDGET_LEVELS)[number];\n\n/** Text boxes: an empty box means \"no cap at this level\". */\nexport type BudgetFormValue = Record<BudgetKey, string>;\nexport type BudgetsForm = Record<BudgetLevel, BudgetFormValue>;\n\n/** Desk actions the charter can allow, grouped for the switches (spec 10 section 3.2). */\nexport const DESK_TOOL_GROUPS = [\n { id: 'groupLook', keys: ['desk:screenshot', 'desk:snapshot'] },\n {\n id: 'groupAct',\n keys: [\n 'desk:click',\n 'desk:type',\n 'desk:key',\n 'desk:scroll',\n 'desk:navigate',\n 'desk:focus_window',\n ],\n },\n {\n id: 'groupFiles',\n keys: ['desk:secret_fill', 'desk:shell', 'desk:read_file', 'desk:write_file'],\n },\n { id: 'groupPlatform', keys: ['platform:current_time', 'platform:notify_owner'] },\n // FluidGrids work queues and the run-result read.\n {\n id: 'groupWorkQueues',\n keys: [\n 'workqueue:list',\n 'workqueue:add',\n 'workqueue:lease',\n 'workqueue:extend',\n 'workqueue:complete',\n 'workqueue:fail',\n 'workflow-run:read',\n ],\n },\n] as const;\n\nconst SWITCH_KEYS: ReadonlySet<string> = new Set(DESK_TOOL_GROUPS.flatMap((g) => g.keys));\n\n/** Keys outside the switch list: connectors (mcp, node) and workflows. */\nexport function customToolKeys(allowed: readonly string[]): string[] {\n return allowed.filter((k) => !SWITCH_KEYS.has(k));\n}\n\n/** The allow-list the server stores: switches on, plus the custom keys, de-duplicated. */\nexport function mergeToolKeys(switches: readonly string[], custom: readonly string[]): string[] {\n return [...new Set([...switches, ...custom])];\n}\n\nconst CUSTOM_TOOL_KEY =\n /^(mcp:[A-Za-z0-9][A-Za-z0-9_.-]{0,127}:[A-Za-z0-9][A-Za-z0-9_.-]{0,127}|node:[a-z0-9_]+:[A-Za-z0-9_]+|workflow:[A-Za-z0-9][A-Za-z0-9_.-]{0,127})$/;\n\n/** The first custom key the server would refuse by shape, else null. */\nexport function firstInvalidCustomKey(keys: readonly string[]): string | null {\n return keys.find((k) => !CUSTOM_TOOL_KEY.test(k)) ?? null;\n}\n\n/** One entry per non-empty line, trimmed. */\nexport function splitLines(text: string): string[] {\n return [\n ...new Set(\n text\n .split(/\\r?\\n/)\n .map((l) => l.trim())\n .filter(Boolean)\n ),\n ];\n}\n\ntype BudgetLike = Partial<Record<BudgetKey, number | null>> | null | undefined;\n\nexport function budgetToForm(budget: BudgetLike): BudgetFormValue {\n const out = {} as BudgetFormValue;\n for (const key of BUDGET_KEYS) {\n const value = budget?.[key];\n out[key] = value == null ? '' : String(value);\n }\n return out;\n}\n\nexport function emptyBudgetsForm(): BudgetsForm {\n return { perRun: budgetToForm(null), perDay: budgetToForm(null), total: budgetToForm(null) };\n}\n\n/**\n * Parses the boxes. Credits may be fractional; the others are whole numbers.\n * Returns the offending key on a bad value (negative, not a number).\n */\nexport function formToBudget(\n form: BudgetFormValue\n): { ok: true; value: BotmanorStewardBudgetInput } | { ok: false; key: BudgetKey } {\n const value: BotmanorStewardBudgetInput = {};\n for (const key of BUDGET_KEYS) {\n const raw = form[key].trim();\n if (raw === '') continue;\n const n = Number(raw);\n const valid = Number.isFinite(n) && n >= 0 && (key === 'credits' ? true : Number.isInteger(n));\n if (!valid) return { ok: false, key };\n value[key] = n;\n }\n return { ok: true, value };\n}\n\nfunction sameBudget(a: BudgetFormValue, b: BudgetFormValue): boolean {\n return BUDGET_KEYS.every((k) => a[k].trim() === b[k].trim());\n}\n\nexport interface CharterForm {\n charterText: string;\n autonomyLevel: BotmanorStewardAutonomy;\n allowedToolKeys: string[];\n allowedConnectionIds: string[];\n budgets: BudgetsForm;\n dryRunDefault: boolean;\n deskEgressMode: BotmanorStewardDeskEgressMode;\n deskAllowedHosts: string[];\n timezone: string;\n}\n\nexport type CharterFormError =\n | { kind: 'budget'; level: BudgetLevel; key: BudgetKey }\n | { kind: 'toolKey'; key: string }\n | { kind: 'charterText' };\n\nconst LEVEL_FIELD = {\n perRun: 'budgetPerRun',\n perDay: 'budgetPerDay',\n total: 'budgetTotal',\n} as const;\n\nfunction sameList(a: readonly string[], b: readonly string[]): boolean {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n}\n\n/**\n * The update input holding only what changed (the server bumps charterVersion\n * on every change, so an unchanged save must send nothing), or the first error.\n */\nexport function buildCharterUpdate(\n initial: CharterForm,\n current: CharterForm\n): { ok: true; input: UpdateBotmanorStewardCharterInput } | { ok: false; error: CharterFormError } {\n const input: UpdateBotmanorStewardCharterInput = {};\n if (current.charterText.trim() !== initial.charterText.trim()) {\n if (current.charterText.trim() === '') return { ok: false, error: { kind: 'charterText' } };\n input.charterText = current.charterText.trim();\n }\n if (current.autonomyLevel !== initial.autonomyLevel) input.autonomyLevel = current.autonomyLevel;\n if (!sameList(current.allowedToolKeys, initial.allowedToolKeys)) {\n const bad = firstInvalidCustomKey(customToolKeys(current.allowedToolKeys));\n if (bad) return { ok: false, error: { kind: 'toolKey', key: bad } };\n input.allowedToolKeys = current.allowedToolKeys;\n }\n if (!sameList(current.allowedConnectionIds, initial.allowedConnectionIds)) {\n input.allowedConnectionIds = current.allowedConnectionIds;\n }\n for (const level of BUDGET_LEVELS) {\n if (sameBudget(current.budgets[level], initial.budgets[level])) continue;\n const parsed = formToBudget(current.budgets[level]);\n if (!parsed.ok) return { ok: false, error: { kind: 'budget', level, key: parsed.key } };\n input[LEVEL_FIELD[level]] = parsed.value;\n }\n if (current.dryRunDefault !== initial.dryRunDefault) input.dryRunDefault = current.dryRunDefault;\n if (current.deskEgressMode !== initial.deskEgressMode) {\n input.deskEgressMode = current.deskEgressMode;\n }\n if (!sameList(current.deskAllowedHosts, initial.deskAllowedHosts)) {\n input.deskAllowedHosts = current.deskAllowedHosts;\n }\n if (current.timezone.trim() !== initial.timezone.trim()) input.timezone = current.timezone.trim();\n return { ok: true, input };\n}\n\ninterface CharterSource {\n charterText: string;\n autonomyLevel: BotmanorStewardAutonomy;\n allowedToolKeys: string[];\n allowedConnectionIds: string[];\n budgetPerRun: BudgetLike;\n budgetPerDay: BudgetLike;\n budgetTotal: BudgetLike;\n dryRunDefault: boolean;\n deskEgressMode: BotmanorStewardDeskEgressMode;\n deskAllowedHosts: string[];\n timezone: string;\n}\n\n/** The editable form for a steward's current charter. */\nexport function charterToForm(charter: CharterSource): CharterForm {\n return {\n charterText: charter.charterText,\n autonomyLevel: charter.autonomyLevel,\n allowedToolKeys: [...charter.allowedToolKeys],\n allowedConnectionIds: [...charter.allowedConnectionIds],\n budgets: {\n perRun: budgetToForm(charter.budgetPerRun),\n perDay: budgetToForm(charter.budgetPerDay),\n total: budgetToForm(charter.budgetTotal),\n },\n dryRunDefault: charter.dryRunDefault,\n deskEgressMode: charter.deskEgressMode,\n deskAllowedHosts: [...charter.deskAllowedHosts],\n timezone: charter.timezone,\n };\n}\n"],"mappings":";AAOA,IAAaA,IAAc;CACzB;CACA;CACA;CACA;CACA;AACF,GAEaC,IAAgB;CAAC;CAAU;CAAU;AAAO,GAQ5CC,IAAmB;CAC9B;EAAE,IAAI;EAAa,MAAM,CAAC,mBAAmB,eAAe;CAAE;CAC9D;EACE,IAAI;EACJ,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,IAAI;EACJ,MAAM;GAAC;GAAoB;GAAc;GAAkB;EAAiB;CAC9E;CACA;EAAE,IAAI;EAAiB,MAAM,CAAC,yBAAyB,uBAAuB;CAAE;CAEhF;EACE,IAAI;EACJ,MAAM;GACJ;GACA;GACA;GAC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