@burdenoff/microfe-stewards 2026.1124.2 → 2026.1201.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/dev/fixtures.d.ts +1 -1
  2. package/dist/dev/shellPermissions.d.ts +12 -0
  3. package/dist/dev/shellStub.d.ts +1 -0
  4. package/dist/generated/global-types.d.ts +1257 -32
  5. package/dist/generated/wspace-operations.d.ts +1393 -3
  6. package/dist/generated/wspace-operations.js +396 -4
  7. package/dist/generated/wspace-operations.js.map +1 -1
  8. package/dist/generated/wspace-types.d.ts +17274 -86
  9. package/dist/generated/wspace-types.js +18 -4
  10. package/dist/generated/wspace-types.js.map +1 -1
  11. package/dist/index.js +4 -3
  12. package/dist/stewards/StewardsRoot.d.ts +2 -0
  13. package/dist/stewards/StewardsRoot.js +26 -11
  14. package/dist/stewards/StewardsRoot.js.map +1 -1
  15. package/dist/stewards/StewardsRoutes.d.ts +4 -2
  16. package/dist/stewards/StewardsRoutes.js +49 -14
  17. package/dist/stewards/StewardsRoutes.js.map +1 -1
  18. package/dist/stewards/components/CharterControls.d.ts +29 -0
  19. package/dist/stewards/components/CharterControls.js +145 -0
  20. package/dist/stewards/components/CharterControls.js.map +1 -0
  21. package/dist/stewards/components/LinesField.d.ts +14 -0
  22. package/dist/stewards/components/LinesField.js +27 -0
  23. package/dist/stewards/components/LinesField.js.map +1 -0
  24. package/dist/stewards/components/RunsTable.d.ts +7 -0
  25. package/dist/stewards/components/RunsTable.js +72 -0
  26. package/dist/stewards/components/RunsTable.js.map +1 -0
  27. package/dist/stewards/components/StewardsTable.js +111 -68
  28. package/dist/stewards/components/StewardsTable.js.map +1 -1
  29. package/dist/stewards/components/fieldClasses.d.ts +4 -0
  30. package/dist/stewards/components/fieldClasses.js +5 -0
  31. package/dist/stewards/components/fieldClasses.js.map +1 -0
  32. package/dist/stewards/components/stewardLabels.d.ts +13 -6
  33. package/dist/stewards/components/stewardLabels.js +28 -20
  34. package/dist/stewards/components/stewardLabels.js.map +1 -1
  35. package/dist/stewards/components/ui.d.ts +49 -0
  36. package/dist/stewards/components/ui.js +111 -0
  37. package/dist/stewards/components/ui.js.map +1 -0
  38. package/dist/stewards/i18n/en.d.ts +408 -0
  39. package/dist/stewards/i18n/en.js +402 -0
  40. package/dist/stewards/i18n/en.js.map +1 -0
  41. package/dist/stewards/i18n/useStewardsT.d.ts +5 -0
  42. package/dist/stewards/i18n/useStewardsT.js +32 -0
  43. package/dist/stewards/i18n/useStewardsT.js.map +1 -0
  44. package/dist/stewards/index.d.ts +2 -1
  45. package/dist/stewards/index.js +4 -3
  46. package/dist/stewards/pages/StewardCharterPage.d.ts +1 -0
  47. package/dist/stewards/pages/StewardCharterPage.js +411 -0
  48. package/dist/stewards/pages/StewardCharterPage.js.map +1 -0
  49. package/dist/stewards/pages/StewardDaybookPage.d.ts +1 -0
  50. package/dist/stewards/pages/StewardDaybookPage.js +298 -0
  51. package/dist/stewards/pages/StewardDaybookPage.js.map +1 -0
  52. package/dist/stewards/pages/StewardLayout.d.ts +7 -0
  53. package/dist/stewards/pages/StewardLayout.js +220 -0
  54. package/dist/stewards/pages/StewardLayout.js.map +1 -0
  55. package/dist/stewards/pages/StewardNewPage.d.ts +1 -0
  56. package/dist/stewards/pages/StewardNewPage.js +448 -0
  57. package/dist/stewards/pages/StewardNewPage.js.map +1 -0
  58. package/dist/stewards/pages/StewardOverviewPage.d.ts +1 -0
  59. package/dist/stewards/pages/StewardOverviewPage.js +59 -0
  60. package/dist/stewards/pages/StewardOverviewPage.js.map +1 -0
  61. package/dist/stewards/pages/StewardRunPage.d.ts +1 -0
  62. package/dist/stewards/pages/StewardRunPage.js +499 -0
  63. package/dist/stewards/pages/StewardRunPage.js.map +1 -0
  64. package/dist/stewards/pages/StewardsListPage.js +97 -50
  65. package/dist/stewards/pages/StewardsListPage.js.map +1 -1
  66. package/dist/stewards/permissions/useStewardPermissions.d.ts +14 -0
  67. package/dist/stewards/permissions/useStewardPermissions.js +16 -0
  68. package/dist/stewards/permissions/useStewardPermissions.js.map +1 -0
  69. package/dist/stewards/providers/StewardsProvider.d.ts +2 -0
  70. package/dist/stewards/providers/StewardsProvider.js +29 -19
  71. package/dist/stewards/providers/StewardsProvider.js.map +1 -1
  72. package/dist/stewards/utils/charterForm.d.ts +92 -0
  73. package/dist/stewards/utils/charterForm.js +156 -0
  74. package/dist/stewards/utils/charterForm.js.map +1 -0
  75. package/dist/stewards/utils/dates.d.ts +15 -0
  76. package/dist/stewards/utils/dates.js +73 -0
  77. package/dist/stewards/utils/dates.js.map +1 -0
  78. package/dist/stewards/utils/daybook.d.ts +15 -0
  79. package/dist/stewards/utils/daybook.js +24 -0
  80. package/dist/stewards/utils/daybook.js.map +1 -0
  81. package/dist/stewards/utils/errors.d.ts +4 -0
  82. package/dist/stewards/utils/errors.js +14 -0
  83. package/dist/stewards/utils/errors.js.map +1 -0
  84. package/dist/stewards/utils/wizard.d.ts +34 -0
  85. package/dist/stewards/utils/wizard.js +58 -0
  86. package/dist/stewards/utils/wizard.js.map +1 -0
  87. package/package.json +4 -1
@@ -0,0 +1,402 @@
1
+ // src/stewards/i18n/en.ts
2
+ var e = { stewards: {
3
+ nav: { label: "Stewards" },
4
+ common: {
5
+ back: "Back",
6
+ cancel: "Cancel",
7
+ loading: "Loading…",
8
+ retry: "Try again",
9
+ none: "None",
10
+ noCap: "No cap",
11
+ never: "Never",
12
+ credits: "credits",
13
+ unknown: "Unknown",
14
+ forbiddenTitle: "You do not have access",
15
+ forbiddenBody: "Your role does not allow you to view Stewards in this workspace.",
16
+ disabledTitle: "Stewards are not enabled",
17
+ disabledBody: "Stewards are not turned on for this workspace yet.",
18
+ errorTitle: "Something went wrong",
19
+ notFoundTitle: "Not found",
20
+ notFoundBody: "This steward or run does not exist, or you cannot see it."
21
+ },
22
+ enums: {
23
+ status: {
24
+ DRAFT: "Draft",
25
+ ACTIVE: "Active",
26
+ PAUSED: "Paused",
27
+ ARCHIVED: "Archived"
28
+ },
29
+ autonomy: {
30
+ OBSERVE: "Observe",
31
+ ASK: "Ask",
32
+ GUIDED: "Guided",
33
+ TRUSTED: "Trusted"
34
+ },
35
+ autonomyHelp: {
36
+ OBSERVE: "Read only, by construction. Can look, summarise and report; no outward actions exist.",
37
+ ASK: "Every outward action asks a person first.",
38
+ GUIDED: "A reviewer model decides each outward action against the charter; when unsure it asks you.",
39
+ TRUSTED: "Your standing rules apply first, then the reviewer model. Still bounded by budgets."
40
+ },
41
+ desk: {
42
+ NONE: "No desk",
43
+ BROWSER: "Browser only",
44
+ CLOUD: "Cloud desk",
45
+ OWN_MACHINE: "Own machine"
46
+ },
47
+ deskHelp: {
48
+ NONE: "Works through connectors and tools only.",
49
+ BROWSER: "A managed browser. The agent needs the Web browsing capability.",
50
+ CLOUD: "A cloud desktop. The agent needs the Computer use capability.",
51
+ OWN_MACHINE: "A machine you connect. The agent needs the Computer use capability."
52
+ },
53
+ egress: {
54
+ PUBLIC: "Any public site",
55
+ ALLOW_LIST: "Only the sites I list",
56
+ BLOCKED: "No web access"
57
+ },
58
+ runStatus: {
59
+ PROPOSED: "Proposed",
60
+ QUEUED: "Queued",
61
+ RUNNING: "Running",
62
+ WAITING_APPROVAL: "Waiting for approval",
63
+ WAITING_TAKEOVER: "Waiting for a person",
64
+ PAUSED_BUDGET: "Paused — budget",
65
+ COMPLETED: "Completed",
66
+ FAILED: "Failed",
67
+ CANCELLED: "Cancelled",
68
+ STOPPED: "Stopped"
69
+ },
70
+ trigger: {
71
+ OWNER_CHAT: "Owner chat",
72
+ SCHEDULE: "Schedule",
73
+ WEBHOOK: "Webhook",
74
+ APP_EVENT: "App event",
75
+ PLATFORM_EVENT: "Platform event",
76
+ CHANNEL_MESSAGE: "Channel message",
77
+ WATCH: "Watch",
78
+ PROACTIVE: "Proactive",
79
+ API: "API",
80
+ WORKFLOW: "Workflow",
81
+ A2A: "Agent to agent"
82
+ },
83
+ trust: {
84
+ OWNER: "Owner",
85
+ MEMBER: "Member",
86
+ SYSTEM: "System",
87
+ EXTERNAL: "External content",
88
+ UNTRUSTED: "Untrusted content"
89
+ },
90
+ stepKind: {
91
+ MODEL_CALL: "Model call",
92
+ TOOL_CALL: "Connector tool",
93
+ DESK_ACTION: "Desk action",
94
+ APPROVAL_WAIT: "Approval wait",
95
+ TAKEOVER: "Takeover",
96
+ SUB_RUN: "Sub-run",
97
+ MEMORY_WRITE: "Memory write",
98
+ NOTE: "Note"
99
+ },
100
+ verdict: {
101
+ ALLOWED: "Allowed",
102
+ ASKED: "Asked",
103
+ APPROVED: "Approved",
104
+ DENIED: "Denied",
105
+ BLOCKED_DRY_RUN: "Dry run",
106
+ FAILED: "Failed",
107
+ SKIPPED: "Skipped"
108
+ },
109
+ approvalStatus: {
110
+ PENDING: "Pending",
111
+ APPROVED: "Approved",
112
+ DENIED: "Denied",
113
+ EXPIRED: "Expired",
114
+ CANCELLED: "Cancelled"
115
+ },
116
+ scope: {
117
+ ONCE: "Once",
118
+ RUN: "This run",
119
+ DUTY: "This duty",
120
+ TIME_LIMITED: "Time-limited",
121
+ STANDING: "Standing"
122
+ }
123
+ },
124
+ tools: {
125
+ "desk:screenshot": "Screenshot",
126
+ "desk:snapshot": "Read the screen structure",
127
+ "desk:click": "Click",
128
+ "desk:type": "Type",
129
+ "desk:key": "Press keys",
130
+ "desk:scroll": "Scroll",
131
+ "desk:navigate": "Open a URL",
132
+ "desk:focus_window": "Switch window",
133
+ "desk:secret_fill": "Fill a stored secret",
134
+ "desk:shell": "Run shell commands",
135
+ "desk:read_file": "Read files",
136
+ "desk:write_file": "Write files",
137
+ "platform:current_time": "Check the time",
138
+ "platform:notify_owner": "Notify the owner"
139
+ },
140
+ budget: {
141
+ credits: "AI credits",
142
+ deskMinutes: "Desk minutes",
143
+ steps: "Steps",
144
+ wallSeconds: "Wall-clock seconds",
145
+ connectorSpendMinor: "Connector spend (minor units)",
146
+ perRun: "Per run",
147
+ perDay: "Per day",
148
+ total: "Total",
149
+ limit: "Limit",
150
+ invalid: "Enter a number of 0 or more for {name} (whole numbers, except credits).",
151
+ hint: "Run stops when any limit is hit. Leave a box empty for no cap at that level."
152
+ },
153
+ fixed: {
154
+ title: "Always asks a person — can’t be loosened",
155
+ badge: "Fixed",
156
+ password: "Password and security-setting changes",
157
+ payment: "Entering payment details",
158
+ otp: "Reading one-time codes",
159
+ external: "Messages to people outside the workspace"
160
+ },
161
+ list: {
162
+ title: "Stewards",
163
+ subtitle: "Agents with a charter, duties and a desk — they work on a schedule or on events, inside the limits you set.",
164
+ newSteward: "New steward",
165
+ statusFilter: "Status",
166
+ allStatuses: "All",
167
+ tableLabel: "Stewards",
168
+ colSteward: "Steward",
169
+ colStatus: "Status",
170
+ colAutonomy: "Autonomy",
171
+ colDesk: "Desk",
172
+ colLastRun: "Last run",
173
+ colToday: "Today · spend / daily cap",
174
+ colWaiting: "Waiting",
175
+ neverRun: "Never run",
176
+ tileActive: "Active stewards",
177
+ tileWaiting: "Waiting for approval",
178
+ tileWaitingHint: "Approval requests across stewards",
179
+ tileSpend: "Credits used today",
180
+ empty: "No stewards yet.",
181
+ emptyFiltered: "No stewards match this status.",
182
+ emptyHint: "Make one of your agents a steward to give it a charter and a desk.",
183
+ loadError: "Could not load stewards."
184
+ },
185
+ wizard: {
186
+ title: "New steward",
187
+ stepOf: "Step {step} of {total}",
188
+ steps: {
189
+ agent: "Agent",
190
+ charter: "Charter",
191
+ desk: "Desk",
192
+ review: "Review"
193
+ },
194
+ next: "Continue",
195
+ create: "Create steward",
196
+ creating: "Creating…",
197
+ agentTitle: "Base agent",
198
+ agentHelp: "A steward is an existing agent plus a charter, duties and a desk.",
199
+ pickExisting: "Use an existing agent",
200
+ createNew: "Create a new agent",
201
+ noAgents: "No active agents available. Create one here.",
202
+ agentSearch: "Search agents",
203
+ agentName: "Agent name",
204
+ agentPrompt: "What is this agent for?",
205
+ agentPromptHelp: "Becomes the agent’s system prompt. You can refine it later.",
206
+ capabilities: "Capabilities",
207
+ capabilityHelp: "Capabilities decide which desks the agent can use.",
208
+ capWeb: "Web browsing",
209
+ capComputer: "Computer use",
210
+ charterTitle: "Charter",
211
+ charterHelp: "Plain-language rules, one per line. The reviewer model checks them on every outward action.",
212
+ charterLabel: "Charter rules",
213
+ charterPlaceholder: "Only summarise ledgers from the Finance folder; never edit source sheets.\nSend the weekly summary only to finance@example.com.",
214
+ charterRequired: "Write at least one rule.",
215
+ autonomyTitle: "Autonomy level",
216
+ autonomyHint: "Can be lowered at any time; raising it is logged.",
217
+ autonomyLockedByAdmin: "A workspace admin limits stewards to {level}.",
218
+ toolsTitle: "Allowed tools & connectors",
219
+ toolsCount: "{count} selected",
220
+ deskTitle: "Desk",
221
+ deskHelp: "Where the steward may work on a screen.",
222
+ deskNeeds: "This agent does not have the {capability} capability, so this desk may be refused.",
223
+ egressTitle: "Web access from the desk",
224
+ allowedHosts: "Allowed sites",
225
+ allowedHostsHelp: "One per line: example.com, or *.example.com for its subdomains.",
226
+ reviewTitle: "Review",
227
+ reviewBody: "The steward starts as a draft. Activate it from its page when you are ready.",
228
+ reviewAgent: "Agent",
229
+ reviewAutonomy: "Autonomy",
230
+ reviewDesk: "Desk",
231
+ reviewTools: "Tools",
232
+ reviewBudget: "Daily AI credits",
233
+ createError: "Could not create the steward.",
234
+ newAgentError: "Could not create the agent."
235
+ },
236
+ detail: {
237
+ owner: "Base agent",
238
+ tabs: {
239
+ overview: "Overview",
240
+ charter: "Charter",
241
+ daybook: "Daybook"
242
+ },
243
+ version: "Charter v{version}, edited {when}",
244
+ pause: "Pause steward",
245
+ resume: "Resume",
246
+ activate: "Activate",
247
+ archive: "Archive",
248
+ runNow: "Run now",
249
+ running: "Starting…",
250
+ runTitle: "Run now",
251
+ runPrompt: "What should the steward do?",
252
+ runPromptPlaceholder: "Check the shared inbox and summarise what needs me today.",
253
+ runDry: "Dry run — record what it would do, without doing it",
254
+ runStart: "Start run",
255
+ runError: "Could not start the run.",
256
+ statusError: "Could not change the status.",
257
+ overviewToday: "Today",
258
+ overviewRecent: "Recent runs",
259
+ noRuns: "No runs yet.",
260
+ openApprovals: "Open approvals ({count})",
261
+ archived: "This steward is archived and cannot be changed.",
262
+ colRun: "Run",
263
+ colStarted: "Started",
264
+ colTrigger: "Trigger"
265
+ },
266
+ charter: {
267
+ rulesTitle: "Rules",
268
+ rulesHint: "Plain language — checked by the reviewer model on every outward action",
269
+ rulesLabel: "Charter rules",
270
+ autonomyTitle: "Autonomy & budgets",
271
+ usage: "Today",
272
+ toolsTitle: "Allowed tools",
273
+ toolsHint: "An empty list means the steward has no tools.",
274
+ groupLook: "Look at the screen",
275
+ groupAct: "Act on the screen",
276
+ groupFiles: "Files and shell",
277
+ groupPlatform: "BotManor tools",
278
+ customTitle: "Connectors and workflows",
279
+ customHint: "One key per line: mcp:<connection>:<tool>, node:<provider>:<operation>, workflow:<id>.",
280
+ customInvalid: "Not a valid tool key: {key}",
281
+ connectionsLabel: "Allowed connection ids",
282
+ connectionsHint: "One id per line.",
283
+ dryRun: "Dry-run mode",
284
+ dryRunHelp: "Plan and record actions without executing outward ones.",
285
+ deskTitle: "Desk web access",
286
+ timezone: "Time zone",
287
+ timezoneHelp: "Daily budgets and the daybook count days in this time zone.",
288
+ rulesSection: "Standing approval rules",
289
+ rulesSectionHint: "Apply at the Trusted level. Revoke one and the steward asks again.",
290
+ rulesEmpty: "No standing rules. Approving a request with a duty, time-limited or standing scope creates one.",
291
+ colTool: "Tool",
292
+ colDestination: "Destination",
293
+ colPurpose: "Purpose",
294
+ colLimit: "Limit",
295
+ colExpires: "Expires",
296
+ revoke: "Revoke",
297
+ save: "Save charter",
298
+ saving: "Saving…",
299
+ saved: "Charter saved as version {version}.",
300
+ saveError: "Could not save the charter.",
301
+ unsaved: "You have unsaved changes.",
302
+ discard: "Discard changes",
303
+ historyTitle: "Version history",
304
+ historyCurrent: "Version {version} — current",
305
+ historyEdited: "Last edited {when}",
306
+ historySession: "Saved in this session",
307
+ historyNote: "Every save bumps the version and is recorded on each step it governs. Earlier versions are not listed yet.",
308
+ archivedLocked: "Archived stewards cannot be edited.",
309
+ forbiddenSave: "You can read this charter but not change it."
310
+ },
311
+ daybook: {
312
+ title: "Daybook",
313
+ prev: "Previous day",
314
+ next: "Next day",
315
+ today: "Today",
316
+ allTriggers: "All triggers",
317
+ allStatuses: "All statuses",
318
+ colTime: "Time",
319
+ colTrigger: "Trigger",
320
+ colRun: "Run",
321
+ colStatus: "Status",
322
+ colSteps: "Steps",
323
+ colCredits: "Credits",
324
+ colDuration: "Duration",
325
+ empty: "No runs on this day.",
326
+ summary: "Day summary",
327
+ runs: "Runs",
328
+ runsBreakdown: "{completed} completed · {failed} failed",
329
+ approvals: "Approvals",
330
+ approvalsBreakdown: "asked / granted · {pending} pending",
331
+ spendVsCap: "Spend vs daily cap",
332
+ stepsVsCap: "Steps vs daily cap",
333
+ attention: "Needs attention",
334
+ attentionEmpty: "Nothing needs attention.",
335
+ dryRun: "Dry run",
336
+ loadError: "Could not load the daybook.",
337
+ running: "running"
338
+ },
339
+ run: {
340
+ title: "Run",
341
+ steward: "Steward",
342
+ trigger: "Trigger",
343
+ autonomy: "Autonomy",
344
+ started: "Started",
345
+ stopRun: "Stop run",
346
+ stopping: "Stopping…",
347
+ retry: "Retry",
348
+ retryDry: "Run again as dry run",
349
+ retryLive: "Run again live",
350
+ retryLiveConfirm: "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.",
351
+ retryLiveConfirmAction: "Run live",
352
+ retryBlockedActive: "Another run of this steward is still in progress.",
353
+ retryBlockedStatus: "Activate the steward before running it again.",
354
+ retrying: "Starting…",
355
+ retryError: "Could not start the new run.",
356
+ cancelError: "Could not stop the run.",
357
+ dryBadge: "Dry run",
358
+ trustTitle: "Trust level",
359
+ trustDegraded: "Lowered during the run",
360
+ trustSame: "Unchanged during the run",
361
+ budgetTitle: "Run budget — credits",
362
+ stepsTitle: "Steps",
363
+ verdictsTitle: "Policy verdicts",
364
+ verdictsLegend: "allowed · asked · denied",
365
+ stepsHeading: "Execution steps",
366
+ stepsOrdered: "ordered",
367
+ noSteps: "No steps recorded yet.",
368
+ colNumber: "#",
369
+ colStep: "Step",
370
+ colVerdict: "Verdict",
371
+ colCredits: "Credits",
372
+ colTime: "Time",
373
+ stepDetail: "Step {seq} · {tool}",
374
+ pickStep: "Select a step to see its details.",
375
+ arguments: "Arguments (redacted)",
376
+ noArguments: "No arguments.",
377
+ result: "Result",
378
+ screenshot: "Desk screenshot",
379
+ screenshotNone: "No desk for this step.",
380
+ screenshotRef: "Screenshot file {id}",
381
+ screenshotError: "The screenshot could not be loaded.",
382
+ screenshotAlt: "Desk screenshot for this step",
383
+ trail: "Policy decision",
384
+ trailVerdict: "Verdict",
385
+ trailReasons: "Reasons",
386
+ trailClassification: "Classification",
387
+ trailTrust: "Trust",
388
+ trailApproval: "Approval request {id}",
389
+ trailRule: "Standing rule {id}",
390
+ trailDryRun: "Recorded in dry-run mode; nothing was executed.",
391
+ cost: "Cost",
392
+ deskSeconds: "Desk time",
393
+ approvalsTitle: "Approvals this run asked for",
394
+ stopReason: "Stopped: {reason}",
395
+ live: "Live updates on",
396
+ polling: "Live updates unavailable — refreshing every few seconds.",
397
+ loadError: "Could not load the run."
398
+ }
399
+ } };
400
+ export { e as enTranslations };
401
+
402
+ //# sourceMappingURL=en.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.js","names":["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 */\nexport const enTranslations = {\n stewards: {\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 disabledTitle: 'Stewards are not enabled',\n disabledBody: 'Stewards are not turned on for this workspace yet.',\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 createError: 'Could not create the steward.',\n newAgentError: 'Could not create the agent.',\n },\n detail: {\n owner: 'Base agent',\n tabs: { overview: 'Overview', charter: 'Charter', daybook: 'Daybook' },\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 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":"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"}
@@ -0,0 +1,5 @@
1
+ export type StewardsT = (key: string, params?: Record<string, string | number>) => string;
2
+ /** Translate through the host when it has the key, else the bundled English. */
3
+ export declare function translate(hostT: StewardsT | null, key: string, params?: Record<string, string | number>): string;
4
+ /** `t(key, params)` for Stewards strings; works with no I18nProvider mounted. */
5
+ export declare function useStewardsT(): StewardsT;
@@ -0,0 +1,32 @@
1
+ import { enTranslations as e } from "./en.js";
2
+ import { useCallback as t } from "react";
3
+ import { useOptionalI18n as n } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
4
+ // src/stewards/i18n/useStewardsT.ts
5
+ function r(t) {
6
+ let n = e;
7
+ for (let e of t.split(".")) {
8
+ if (typeof n != "object" || !n) return;
9
+ n = Object.getOwnPropertyDescriptor(n, e)?.value;
10
+ }
11
+ return typeof n == "string" ? n : void 0;
12
+ }
13
+ function i(e, t) {
14
+ return t ? e.replace(/\{(\w+)\}/g, (e, n) => {
15
+ let r = t[n];
16
+ return r === void 0 ? e : String(r);
17
+ }) : e;
18
+ }
19
+ function a(e, t, n) {
20
+ if (e) {
21
+ let r = e(t, n);
22
+ if (r !== t) return r;
23
+ }
24
+ return i(r(t) ?? t, n);
25
+ }
26
+ function o() {
27
+ let e = n(), r = e ? e.t : null;
28
+ return t((e, t) => a(r, e, t), [r]);
29
+ }
30
+ export { a as translate, o as useStewardsT };
31
+
32
+ //# sourceMappingURL=useStewardsT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStewardsT.js","names":["lookup","node","enTranslations","part","key","interpolate","params","text","value","name","match","translate","hostT","translated","useStewardsT","i18n","useOptionalI18n","useCallback"],"sources":["../../../src/stewards/i18n/useStewardsT.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useOptionalI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { enTranslations } from './en';\n\nexport type StewardsT = (key: string, params?: Record<string, string | number>) => string;\n\nfunction lookup(key: string): string | undefined {\n let node: unknown = enTranslations;\n for (const part of key.split('.')) {\n if (typeof node !== 'object' || node === null) return undefined;\n node = Object.getOwnPropertyDescriptor(node, part)?.value;\n }\n return typeof node === 'string' ? node : undefined;\n}\n\n/** Replaces `{name}` placeholders; an unknown name is left as written. */\nfunction interpolate(text: string, params?: Record<string, string | number>): string {\n if (!params) return text;\n return text.replace(/\\{(\\w+)\\}/g, (match, name: string) => {\n const value = params[name];\n return value === undefined ? match : String(value);\n });\n}\n\n/** Translate through the host when it has the key, else the bundled English. */\nexport function translate(\n hostT: StewardsT | null,\n key: string,\n params?: Record<string, string | number>\n): string {\n if (hostT) {\n const translated = hostT(key, params);\n if (translated !== key) return translated;\n }\n return interpolate(lookup(key) ?? key, params);\n}\n\n/** `t(key, params)` for Stewards strings; works with no I18nProvider mounted. */\nexport function useStewardsT(): StewardsT {\n const i18n = useOptionalI18n();\n const hostT = i18n ? i18n.t : null;\n return useCallback((key, params) => translate(hostT, key, params), [hostT]);\n}\n"],"mappings":";;;;AAMA,SAASA,EAAO,GAAiC;CAC/C,IAAIC,IAAgBC;CACpB,KAAK,IAAMC,KAAQC,EAAI,MAAM,GAAG,GAAG;EACjC,IAAI,OAAOH,KAAS,aAAYA,GAAe;EAC/C,IAAO,OAAO,yBAAyBA,GAAME,CAAI,CAAC,EAAE;CACtD;CACA,OAAO,OAAOF,KAAS,WAAWA,IAAO,KAAA;AAC3C;AAGA,SAASI,EAAY,GAAc,GAAkD;CAEnF,OADKC,IACEC,EAAK,QAAQ,eAAe,GAAO,MAAiB;EACzD,IAAMC,IAAQF,EAAOG;EACrB,OAAOD,MAAU,KAAA,IAAYE,IAAQ,OAAOF,CAAK;CACnD,CAAC,IAJmBD;AAKtB;AAGA,SAAgBI,EACd,GACA,GACA,GACQ;CACR,IAAIC,GAAO;EACT,IAAMC,IAAaD,EAAMR,GAAKE,CAAM;EACpC,IAAIO,MAAeT,GAAK,OAAOS;CACjC;CACA,OAAOR,EAAYL,EAAOI,CAAG,KAAKA,GAAKE,CAAM;AAC/C;AAGA,SAAgBQ,IAA0B;CACxC,IAAMC,IAAOC,EAAgB,GACvBJ,IAAQG,IAAOA,EAAK,IAAI;CAC9B,OAAOE,GAAa,GAAK,MAAWN,EAAUC,GAAOR,GAAKE,CAAM,GAAG,CAACM,CAAK,CAAC;AAC5E"}
@@ -1,3 +1,4 @@
1
- export { StewardsRoot } from './StewardsRoot';
1
+ export { StewardsRoot, STEWARDS_FLAG } from './StewardsRoot';
2
2
  export { STEWARD_PERMISSIONS, type StewardPermission } from './permissions/stewardPermissions';
3
+ export { enTranslations } from './i18n/en';
3
4
  export type { StewardsRootProps, StewardListItem } from './types';
@@ -1,3 +1,4 @@
1
- import { STEWARD_PERMISSIONS as e } from "./permissions/stewardPermissions.js";
2
- import { StewardsRoot as t } from "./StewardsRoot.js";
3
- export { e as STEWARD_PERMISSIONS, t as StewardsRoot };
1
+ import { enTranslations as e } from "./i18n/en.js";
2
+ import { STEWARD_PERMISSIONS as t } from "./permissions/stewardPermissions.js";
3
+ import { STEWARDS_FLAG as n, StewardsRoot as r } from "./StewardsRoot.js";
4
+ export { n as STEWARDS_FLAG, t as STEWARD_PERMISSIONS, r as StewardsRoot, e as enTranslations };
@@ -0,0 +1 @@
1
+ export declare function StewardCharterPage(): import('react').JSX.Element;