930a4b968e
4-tier ladder customer<internal<dev<bcos. Re-tagged Architect/Testing/Claude + platform/technical from internal->dev; Processes stays bcos. Backend visible() enforces a per-instance served-audiences cap at the API. bcos.dev/DLX serve all; production sets GUIDE_SERVED_AUDIENCES=customer,internal so dev/bcos never leave dev. Verified: capped instance returns only Customer+Internal, 404s dev/bcos. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.9 KiB
2.9 KiB
module, title, tab, order, audience
| module | title | tab | order | audience |
|---|---|---|---|---|
| devices.agent-scripts | Agent Scripts | Claude | 40 | dev |
Act-without-guessing reference. Only confirmed facts (hiveops-devices source, 2026-07-01).
Owner
- Service:
hiveops-devices(Spring Boot, port8096, DBhiveiq_devices). - Served under
/api/fleet/scriptsbut owned by devices, NOT hiveops-fleet. - SPA:
hiveops-devices/frontend→components/Settings/AgentScripts.svelte,lib/api.ts→agentScriptAPIondevicesApi(basewindow.__APP_CONFIG__.apiUrlelsehttp://localhost:8096).
Endpoints (all hasAnyRole('MSP_ADMIN','BCOS_ADMIN'))
| Method | Path | Result |
|---|---|---|
| GET | /api/fleet/scripts |
list; optional ?institutionKey= |
| POST | /api/fleet/scripts |
400 if name/content blank, else 201 |
| PUT | /api/fleet/scripts/{id} |
404 if missing |
| DELETE | /api/fleet/scripts/{id} |
204 (hard delete) |
| POST | /api/fleet/scripts/{id}/push |
STUB → 200 + [], does nothing |
Data
- Table:
agent_scripts(FlywayV15). Cols:id,nameVARCHAR(200),descriptionTEXT,contentTEXT,institution_keyVARCHAR(50),created_at,updated_at. Index:idx_agent_scripts_institution_key. - Entity/Repo/Service/Controller:
AgentScript/AgentScriptRepository/AgentScriptService/AgentScriptController(pkgcom.hiveops.devices.*). - Repo methods:
findAllByOrderByNameAsc,findByInstitutionKeyOrderByNameAsc.
Kafka / topics
- None. This module produces/consumes nothing.
Signed delivery (lives elsewhere, NOT wired here)
- hiveops-fleet:
FleetTaskKind.UPDATE_SCRIPT+ScriptSigningService(SHA256withRSA, keyscript.signing.private-key/ envSCRIPT_SIGNING_PRIVATE_KEY). - agent:
com.hiveops.filemgmt.ProcessScriptUpdateverifiesSHA256withRSA, needs patch keysscriptName+scriptContent(base64) +scriptSignature.
Gotchas
- Devices Push button is a no-op; SPA still shows a success toast. Never treat a push as delivered.
- Path says
fleetbut the backend is devices — route toapi.bcos.cloud/devices, not/fleet. - Name extension check (
.cmd/.sh/.ps1) is client-side only; backend accepts any non-blank name. - SPA
getAll()never sendsinstitutionKey→ lists ALL institutions;create()never sends it → rows saved withinstitution_key = NULL. - Edit locks
name(SPA sends only{description, content}on PUT). - Fleet signer writes patch key
signatureover rawscript; agent readsscriptSignature+ base64scriptContent— key/format mismatch (see uncertainties).
Do NOT
- Do NOT claim scripts reach ATMs via this module's Push endpoint — it's a stub.
- Do NOT look for a Kafka topic or
device_summarymirror for scripts — none exist. - Do NOT expect institution scoping from the UI — it lists/creates unscoped.
- Do NOT search hiveops-fleet for
/api/fleet/scripts— that path is a devices controller. - Do NOT rely on backend name-extension validation.