@opengeni/runtime 3.0.1 → 4.0.0

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 (99) hide show
  1. package/dist/assets/codemode-client.json +1 -0
  2. package/dist/chunk-4A4XTKKX.js +1 -0
  3. package/dist/{chunk-RIJ6DCYS.js → chunk-5HJEVOMJ.js} +9817 -9494
  4. package/dist/chunk-5HJEVOMJ.js.map +1 -0
  5. package/dist/{chunk-FHGLYLBL.js → chunk-SPT3PLMX.js} +1 -87
  6. package/dist/chunk-SPT3PLMX.js.map +1 -0
  7. package/dist/{chunk-GB763TSV.js → chunk-TE27J65Q.js} +1 -1
  8. package/dist/chunk-TE27J65Q.js.map +1 -0
  9. package/dist/{chunk-46BFUGFL.js → chunk-WIHICNWS.js} +1660 -388
  10. package/dist/chunk-WIHICNWS.js.map +1 -0
  11. package/dist/{chunk-UU6EJR52.js → chunk-YU4VRTR4.js} +2 -2
  12. package/dist/chunk-YU4VRTR4.js.map +1 -0
  13. package/dist/chunk-ZG2YH25H.js +94 -0
  14. package/dist/chunk-ZG2YH25H.js.map +1 -0
  15. package/dist/codex-tool-search.d.ts +5 -4
  16. package/dist/context-compaction.d.ts +19 -0
  17. package/dist/gmail-rest-mcp.js +1 -1
  18. package/dist/index.d.ts +30 -22
  19. package/dist/index.js +25 -5
  20. package/dist/lazy-manifest-OEYEHNVY.js +45 -0
  21. package/dist/lazy-manifest-OEYEHNVY.js.map +1 -0
  22. package/dist/lazy-manifest.d.ts +6 -0
  23. package/dist/lazy-tool-transport.d.ts +3 -2
  24. package/dist/{localSources-PVFCAPN2.js → localSources-TWHTEKGO.js} +3 -2
  25. package/dist/localSources-TWHTEKGO.js.map +1 -0
  26. package/dist/metrics.d.ts +6 -0
  27. package/dist/operational-instructions.d.ts +1 -1
  28. package/dist/prepared-compaction-request.d.ts +8 -0
  29. package/dist/provider-history-adapter.d.ts +2 -2
  30. package/dist/runtime-skills.d.ts +3 -10
  31. package/dist/sandbox/codemode-client.d.ts +17 -0
  32. package/dist/sandbox/codemode-token.d.ts +3 -3
  33. package/dist/sandbox/index.d.ts +2 -1
  34. package/dist/sandbox/index.js +8 -2
  35. package/dist/sandbox/materialization-verification-error.d.ts +27 -0
  36. package/dist/sandbox/provider-command-session.d.ts +44 -2
  37. package/dist/sandbox/providers/modal-command-control.d.ts +32 -29
  38. package/dist/sandbox/providers/modal-command-router-wire.d.ts +49 -0
  39. package/dist/sandbox/providers/modal-command-session.d.ts +2 -1
  40. package/dist/sandbox/providers/modal-legacy-command-control.d.ts +50 -0
  41. package/dist/sandbox/providers/modal-materialization-verification.d.ts +7 -0
  42. package/dist/sandbox/providers/modal.d.ts +0 -8
  43. package/dist/sandbox/routing/routing-session.d.ts +21 -0
  44. package/dist/sandbox/turn-tool-cancellation.d.ts +1 -0
  45. package/dist/skill-library.d.ts +0 -6
  46. package/dist/skill-library.js +1 -1
  47. package/dist/workspace-tool-gateway.js +7 -5
  48. package/package.json +9 -7
  49. package/src/bundled_artifact_skills/opengeni-documents/SKILL.md +19 -0
  50. package/src/bundled_artifact_skills/opengeni-documents/references/api.md +22 -0
  51. package/src/bundled_default_skills/opengeni-client/SKILL.md +349 -0
  52. package/src/bundled_default_skills/opengeni-client/agents/openai.yaml +4 -0
  53. package/src/bundled_default_skills/opengeni-client/references/api-workflows.md +256 -0
  54. package/src/bundled_default_skills/opengeni-client/references/compatibility-and-troubleshooting.md +84 -0
  55. package/src/bundled_default_skills/opengeni-client/references/customer-skill-template.md +96 -0
  56. package/src/bundled_default_skills/opengeni-client/references/data-tools-and-credentials.md +99 -0
  57. package/src/bundled_default_skills/opengeni-client/references/discovery-and-autonomy.md +81 -0
  58. package/src/bundled_default_skills/opengeni-client/references/external-users-and-connect.md +457 -0
  59. package/src/bundled_default_skills/opengeni-client/references/isolation-and-authorization.md +77 -0
  60. package/src/bundled_default_skills/opengeni-client/references/product-integration-shapes.md +232 -0
  61. package/src/bundled_default_skills/opengeni-client/references/product-shapes-and-ui.md +116 -0
  62. package/src/bundled_default_skills/opengeni-client/references/runtime-profile-and-verification.md +157 -0
  63. package/src/bundled_default_skills/opengeni-help/SKILL.md +101 -0
  64. package/src/bundled_management_skills/opengeni-skills/SKILL.md +33 -3
  65. package/src/codex-tool-search.ts +13 -5
  66. package/src/context-compaction.ts +87 -4
  67. package/src/gmail-rest-mcp.ts +1 -2
  68. package/src/index.ts +363 -131
  69. package/src/lazy-manifest.ts +55 -0
  70. package/src/lazy-tool-transport.ts +15 -2
  71. package/src/metrics.ts +6 -0
  72. package/src/model-request-capture.ts +3 -0
  73. package/src/operational-instructions.ts +11 -2
  74. package/src/prepared-compaction-request.ts +51 -0
  75. package/src/provider-history-adapter.ts +12 -3
  76. package/src/runtime-skills.ts +3 -17
  77. package/src/sandbox/codemode-client.ts +204 -0
  78. package/src/sandbox/codemode-token.ts +7 -2
  79. package/src/sandbox/index.ts +7 -0
  80. package/src/sandbox/materialization-verification-error.ts +65 -0
  81. package/src/sandbox/provider-command-session.ts +70 -2
  82. package/src/sandbox/providers/modal-command-control.ts +386 -242
  83. package/src/sandbox/providers/modal-command-router-wire.ts +248 -0
  84. package/src/sandbox/providers/modal-command-session.ts +177 -4
  85. package/src/sandbox/providers/modal-legacy-command-control.ts +351 -0
  86. package/src/sandbox/providers/modal-materialization-verification.ts +122 -0
  87. package/src/sandbox/providers/modal.ts +1 -9
  88. package/src/sandbox/routing/routing-session.ts +417 -79
  89. package/src/sandbox/turn-tool-cancellation.ts +38 -2
  90. package/src/skill-catalog.ts +1 -0
  91. package/src/skill-library.ts +0 -6
  92. package/src/workspace-governance.ts +0 -1
  93. package/src/workspace-skills.ts +114 -74
  94. package/dist/chunk-46BFUGFL.js.map +0 -1
  95. package/dist/chunk-FHGLYLBL.js.map +0 -1
  96. package/dist/chunk-GB763TSV.js.map +0 -1
  97. package/dist/chunk-RIJ6DCYS.js.map +0 -1
  98. package/dist/chunk-UU6EJR52.js.map +0 -1
  99. /package/dist/{localSources-PVFCAPN2.js.map → chunk-4A4XTKKX.js.map} +0 -0
@@ -0,0 +1,232 @@
1
+ # Product Integration Shapes
2
+
3
+ This reference helps a customer-side agent decide how a product should use a
4
+ standalone OpenGeni deployment. It is intentionally architecture-level. Verify
5
+ exact methods and props against the installed `@opengeni/sdk` and
6
+ `@opengeni/react` versions.
7
+
8
+ When the OpenGeni repository is available, read `docs/product-integration.md`
9
+ first. It is the canonical contract for organization API keys, organization
10
+ workspaces, Personal-workspace exclusion, and external Skill ownership.
11
+
12
+ ## The Common Architecture
13
+
14
+ ```text
15
+ customer browser / mobile app
16
+ |
17
+ | customer session, same-origin product API
18
+ v
19
+ customer backend / tenant boundary
20
+ - stores one organization API key
21
+ - maps the chosen product sharing boundary -> organization workspace
22
+ - stores/version-controls product Skills
23
+ |
24
+ | @opengeni/sdk, server-held OpenGeni credential
25
+ v
26
+ standalone OpenGeni API -> sessions, workers, tools, storage, compute
27
+ ```
28
+
29
+ The customer does not need to embed OpenGeni's database, workers, router, event
30
+ bus, or sandbox runtime. "Embedded agent" usually means the product presents an
31
+ OpenGeni-backed agent in its own experience while OpenGeni remains a service.
32
+
33
+ This integration skill belongs to the customer's development agent. Runtime
34
+ skills selected in `CreateSessionRequest.skills` belong to the OpenGeni session
35
+ it creates. Keep those layers separate: integration knowledge should not be
36
+ copied into every runtime agent prompt, and runtime skills should not redefine
37
+ the product's trust boundary.
38
+
39
+ The external product is the runtime Skill source of truth. There is no
40
+ organization-wide Skill registry or Skill inheritance in the product
41
+ integration contract; selected Skills are sent inline for each product-created
42
+ session.
43
+
44
+ ## Choose The Isolation Unit
45
+
46
+ One workspace per product tenant is correct only when that tenant may share
47
+ workspace-scoped agent authority and resources. Default to:
48
+
49
+ | Sharing requirement | Workspace mapping |
50
+ | --- | --- |
51
+ | Tenant/team chats may collaborate | Per tenant/team |
52
+ | Chats are private between end users | Per end user |
53
+ | Every chat is a hard boundary, including within one user | Per chat |
54
+ | Data is shared but chats are private | Per user/chat, with equivalent scoped data access |
55
+
56
+ A live agent with the relevant first-party session tools can reach unrelated
57
+ sessions in the same workspace. Turning Knowledge authoring off does not change
58
+ that. Removing all unnecessary cross-session and workspace-wide tools is useful
59
+ defense in depth for an explicitly softer design, but a hard requirement needs
60
+ separate workspaces.
61
+
62
+ An organization API key creates workspace-visible top-level sessions. It does
63
+ not impersonate the customer's end user as an OpenGeni managed human and cannot
64
+ use Only-me visibility as a substitute for the mapping above.
65
+
66
+ ## Decision Matrix
67
+
68
+ | Need | Recommended surface | Product renders | OpenGeni package |
69
+ | --- | --- | --- | --- |
70
+ | Send users to the complete stock experience | Link/deep-link | Product entry point only | None |
71
+ | Custom UI in any framework, mobile, CLI, or automation | Headless SDK | Everything user-facing | `@opengeni/sdk` |
72
+ | Custom React UI using canonical session behavior | Headless React session hooks | Product timeline/composer/layout | `@opengeni/react/session` |
73
+ | Packaged OpenGeni chat/session controls | Styled React surfaces | Product shell and domain UI | `@opengeni/react/session-ui`, `/composer`, `/realtime` |
74
+ | Agent workspace with files, changes, terminal, or desktop | Workbench | Product shell plus chosen tabs | `@opengeni/react` |
75
+ | OpenGeni runtime inside the host process | Advanced in-process embedding | Host owns infrastructure seams | Repo-level packages; see `docs/embedding.md` |
76
+
77
+ Start with the headless SDK. Add React surfaces rather than designing a larger
78
+ boundary up front. The packages are composable; using one hook does not require
79
+ mounting the stock OpenGeni application.
80
+
81
+ ## Server And Browser Responsibilities
82
+
83
+ ### Product server
84
+
85
+ - Authenticates its own user and enforces its own tenant/business permissions.
86
+ - Maps that principal to one allowed OpenGeni organization workspace and
87
+ allowed sessions. Personal workspaces are excluded.
88
+ - Holds the organization API key or delegated credentials.
89
+ - Calls `ensureWorkspace` with the product tenant's stable external identity and
90
+ stores `result.workspace.id`; `result.created` distinguishes create from
91
+ idempotent replay.
92
+ - Loads product-owned Skills and passes the selected definitions inline in
93
+ `CreateSessionRequest.skills` for each product-created session.
94
+ - Sends explicit minimal `tools` and `firstPartyMcpTools` selections. Omission
95
+ inherits workspace/deployment defaults; an explicit empty array suppresses
96
+ that category.
97
+ - Calls `OpenGeniClient` and returns product-shaped responses.
98
+ - Re-streams session SSE with `proxySessionEventStream` when the browser needs a
99
+ live timeline.
100
+ - Rejects caller-supplied workspace/session IDs that are not already authorized
101
+ by the product relationship.
102
+
103
+ ### Product browser
104
+
105
+ - Talks to the product's same-origin routes or the deployment's normal browser
106
+ auth boundary.
107
+ - May use the SDK with a custom `fetch`/same-origin base URL.
108
+ - May mount React hooks/components against a structural proxy client.
109
+ - Never receives an organization API key just because it renders an agent.
110
+
111
+ The browser may PUT file bytes directly to a short-lived signed object-storage
112
+ URL returned by the SDK flow. That URL is scoped upload authority, not the
113
+ OpenGeni API credential. The SDK omits ambient cookies and auth on the storage
114
+ request. The deployment must configure storage CORS for intended browser
115
+ origins when browser uploads are enabled.
116
+
117
+ ## UI Composition
118
+
119
+ ### Headless session semantics
120
+
121
+ Use `@opengeni/react/session` when the product owns every visual decision but
122
+ wants canonical event, queue, composer, goal, approval, human-input, and timeline
123
+ behavior. The exported client contracts are structural and intentionally
124
+ narrow. Implement the exact client refinement required by each mounted hook;
125
+ do not stub billing, workspace administration, machines, or workbench methods.
126
+
127
+ ### Packaged visuals
128
+
129
+ Use the styled subpaths for only the features the product wants:
130
+
131
+ - `@opengeni/react/session-ui` for timeline/session chrome surfaces.
132
+ - `@opengeni/react/composer` for the standard composer or its controller and
133
+ compound primitives.
134
+ - `@opengeni/react/realtime` for realtime session controls.
135
+ - `@opengeni/react/machines` for Connected Machine management.
136
+ - the root package for the optional workspace/workbench graph.
137
+
138
+ Import `@opengeni/react/compiled.css` once for the default styled experience.
139
+ It is package-compiled, scoped under `.og-root`, and does not require the host to
140
+ run Tailwind or scan package source. Theme and density are `--og-*` runtime
141
+ tokens. Tailwind v4 hosts may deliberately compile the additive `styles.css`
142
+ source bridge instead, but must use one styling path, not both.
143
+
144
+ Responsive behavior should be container-based inside sidebars, drawers, and
145
+ split panes. Prefer package density/responsive props over host CSS selectors
146
+ that reach into SDK internals.
147
+
148
+ ## Context And Instructions
149
+
150
+ The product should send four different kinds of information through their
151
+ matching contracts:
152
+
153
+ | Information | Contract | Lifetime | Visible in timeline |
154
+ | --- | --- | --- | --- |
155
+ | Stable workspace persona | workspace `agentInstructions` | every session in workspace | No |
156
+ | Agent role/persona refinement | session `instructions` | one session | No, but session metadata is org-visible |
157
+ | Current route/selection/viewport snapshot | `modelContext` | one accepted message | No in the standard timeline; yes in full audit data |
158
+ | What the user said | message text / `initialMessage` | durable conversation | Yes |
159
+
160
+ Use `requestedSessionId` plus a stable `idempotencyKey` when the product must
161
+ persist its own link before the first OpenGeni turn can run. The ID is
162
+ correlation, not authorization.
163
+
164
+ `modelContext` is ordinary user-role model content, not a system instruction or secret. It is a snapshot, not a substitute for tools. If the agent needs
165
+ current product state or must mutate product data, expose a tenant-scoped
166
+ OpenAPI/GraphQL Integration or MCP server. Keep tool outputs machine-useful;
167
+ the product may render a separate, more concise user-facing projection.
168
+
169
+ ## Ownership Of Product Data
170
+
171
+ Keep customer domain records in the customer product. Give the agent authorized
172
+ MCP tools to read or change them. Store only OpenGeni-native facts in OpenGeni:
173
+ sessions, events, selected resources/tools/skills, files used by sessions,
174
+ approvals, goals, schedules, and execution state.
175
+
176
+ Do not duplicate the customer's project/contact/document model into OpenGeni
177
+ only to make it available to the agent. Conversely, do not treat OpenGeni's
178
+ event stream as the customer's domain audit log. Each system remains canonical
179
+ for the state it owns.
180
+
181
+ ## Files And Artifacts
182
+
183
+ - One-off user attachments use `OpenGeniClient.uploadFile`, then a file resource
184
+ on session create or message send.
185
+ - Indexed reusable knowledge uses the document/knowledge APIs when enabled.
186
+ - Product-domain documents may stay in the product and be exposed through the
187
+ product's MCP server when OpenGeni should not own a second copy.
188
+ - Agent-produced durable product records should be written through product MCP
189
+ tools. Do not infer a generic write-back/artifact path that the live service
190
+ does not expose.
191
+
192
+ ## Realtime And Compute
193
+
194
+ Realtime is an optional session transport, not a second agent. Use the public
195
+ SDK/React realtime subpaths so negotiation, lifecycle, recovery, and durable
196
+ session context stay server-owned.
197
+
198
+ Managed Sandboxes and Connected Machines are compute choices for a session.
199
+ They do not change the product integration boundary. A customer product should
200
+ only expose machine selection/enrollment when its users need to run on their own
201
+ computers; ordinary embedded agents should use the deployment default.
202
+
203
+ ## Delivery Autonomy
204
+
205
+ Infer the delivery workflow from the user's request, repository guidance, CI,
206
+ and environment documentation. Implement and test when asked to implement, but
207
+ do not treat available repository or cloud credentials as authorization to
208
+ push, open a pull request, merge, deploy, or mutate production. Perform a named
209
+ external step when it was authorized clearly. Otherwise finish the safe work
210
+ and ask at the actual boundary, naming the target and impact, or provide the
211
+ customer-owned runbook when they retain deployment authority.
212
+
213
+ ## Delivery Checklist
214
+
215
+ Before calling an integration complete, verify:
216
+
217
+ 1. Credentials never reach browser bundles, logs, prompts, or generated skills.
218
+ 2. The selected tenant/user/chat sharing boundary maps to distinct or shared
219
+ workspaces exactly as intended.
220
+ 3. Product authorization is checked before every workspace/session proxy call.
221
+ 4. The effective first-party and external tool allowlists contain only required
222
+ capabilities.
223
+ 5. Session creation retries reuse one idempotency key.
224
+ 6. SSE reconnect resumes by sequence and does not duplicate timeline effects.
225
+ 7. Unknown additive event types do not crash the client.
226
+ 8. File upload works from every intended browser origin, including signed PUT
227
+ CORS and completion.
228
+ 9. Prompt scopes are used correctly; visible text is not carrying hidden policy.
229
+ 10. API/MCP tools enforce the same tenant/user boundary as the product API.
230
+ 11. Narrow and wide layouts work without host CSS reaching into SDK internals.
231
+ 12. The integration pins compatible SDK/server major versions and checks the
232
+ live client config rather than hard-coding volatile catalogs.
@@ -0,0 +1,116 @@
1
+ # Opening host-owned workbench tabs
2
+
3
+ Use `SandboxWorkspace.openTabRequest={{ tab, requestId }}` to open a built-in or
4
+ host-injected tab from the host's UI. Increment `requestId` for each intentional
5
+ open, including repeated clicks on the same item. Keep artifact selection and
6
+ internal-link recognition in the host; the workbench only selects an available
7
+ tab and expands the dock. Preserve modified clicks and external navigation.
8
+ When handing off to a full-page artifact route, retain an explicit originating
9
+ session return path rather than relying on browser history.
10
+
11
+ # Product shapes and UI
12
+
13
+ ## Choose the smallest suitable surface
14
+
15
+ OpenGeni supports several product shapes. Select from the product experience and host stack rather than assuming every integration needs a custom chat:
16
+
17
+ | Need | Likely surface | Product owns |
18
+ | --- | --- | --- |
19
+ | The complete OpenGeni experience is acceptable | Link or deep-link to stock OpenGeni | Entry point and product navigation |
20
+ | Custom UI in any framework, mobile app, CLI, or automation | OpenGeni SDK or public API behind product backend | All user-facing presentation |
21
+ | React product wants canonical session state without packaged visuals | Headless React session hooks and projections | Components, layout, and styling |
22
+ | React product wants packaged chat/session controls | Focused styled React subpaths | Shell, domain UI, and theming |
23
+ | Product exposes files, changes, terminal, or desktop compute | Optional workbench surfaces | Product shell and selected tabs |
24
+
25
+ Start with the narrowest surface that preserves the desired experience. Do not mount the full workbench for an ordinary analytics chat. Do not rebuild session streaming, replay, queueing, approval, or timeline projection when a compatible package already supplies the needed behavior.
26
+
27
+ ## Evaluate reuse before writing chat UI
28
+
29
+ For React hosts, inspect the installed OpenGeni React package before creating replacement components. Its subpaths are composable, and the styled surfaces use scoped compiled CSS plus runtime theme and density tokens. Compare:
30
+
31
+ - packaged components with customer theme tokens;
32
+ - headless hooks with customer-native components; and
33
+ - a fully custom SDK-driven UI.
34
+
35
+ Choose based on UX requirements and dependency compatibility, then record why. Styling differences alone are not a reason to skip reusable components if their structure fits. Conversely, do not force a packaged component when the product needs a materially different interaction model.
36
+
37
+ For Svelte, SvelteKit, Vue, native mobile, or another non-React frontend, use the product's native component system. Keep the privileged OpenGeni client on a compatible backend boundary. A SvelteKit server route may use the TypeScript SDK directly; a non-JavaScript backend may use the public HTTP contract or a small compatible adapter. The browser still speaks to authenticated product routes.
38
+
39
+ ## Optional artifact library
40
+
41
+ Use `client.listArtifactCatalog(workspaceId, options)` for a workspace output
42
+ library; supply `sourceSessionId` for a session panel. It returns bounded native
43
+ artifact summaries and `nextCursor`, with `q`, `kind`, `status`, and `sort` filters.
44
+ Use `kind:id` as a UI key, preserve existing type-specific open/edit APIs, and
45
+ never reconstruct a library by scanning chat history or a sandbox filesystem.
46
+ The catalog is discovery, not new content access authority: preserve the current
47
+ viewer's file/artifact permissions and authorize the host's workspace mapping.
48
+
49
+ Render retained images with the existing artifact loader and lightbox rather
50
+ than compute file links. `@opengeni/react/artifacts` exports
51
+ `isRetainedImageContentType` and `useRetainedImageObjectUrl`; the host supplies
52
+ authenticated loading and presentation. Keep image bytes and signed download
53
+ URLs out of durable Markdown. Standard image references use `artifact:<id>`.
54
+ Use static tiles with a useful fallback for types without a preview; do not
55
+ execute every Site or invoke tools just to display a library grid. Inline HTML
56
+ and saved Sites keep the existing explicit Markdown host callbacks and isolated
57
+ frame; ordinary HTML file downloads do not become executable previews.
58
+
59
+ ## Optional conversation search
60
+
61
+ Check the installed SDK/React exports before offering full-history Find. With
62
+ compatible versions, `client.searchSessionMessages(workspaceId, { query,
63
+ sessionId, limit, cursor }, { signal })` searches literal, case-insensitive text
64
+ in saved user and completed assistant messages. Omit `sessionId` and set
65
+ `groupBy: "session"` for one representative hit per session in workspace search;
66
+ do not combine those two options. Preserve authenticated host/workspace scope.
67
+ Tools, reasoning, model context, and assistant output with only unfinished
68
+ deltas are not searched. Do not silently fall back to title-only or loaded-DOM
69
+ search when this endpoint is unavailable.
70
+
71
+ Each request is bounded. An empty page with `hasMore: true` is still searching,
72
+ not “no matches”: follow `nextCursor`, cancel obsolete requests, and expose
73
+ provisional counts until `countIsExact`. Counts describe the live traversal,
74
+ not a snapshot; grouped counts represent sessions, not per-session message
75
+ totals. Retain a bounded hit batch and cursor history rather than downloading
76
+ every message into the browser.
77
+
78
+ Use a result's durable `sequence` and original-text UTF-16
79
+ `messageMatchOffset` to navigate. React's `useSessionEvents().jumpToSequence`
80
+ loads a bounded target window; pass `{ sequence, eventId, query,
81
+ offset: messageMatchOffset }` as `MessageTimeline.searchTarget` after a
82
+ successful jump. Preserve query and selection in host state, and clear the
83
+ target without scrolling when Find closes. A custom virtualized message
84
+ renderer must consume its search-target render context to reveal the selected
85
+ text. For contextual previews, read bounded events before/after the target,
86
+ render only `payload.text` for user/completed-assistant messages, and keep the
87
+ returned snippet for a large target. Never stringify forensic payloads: they
88
+ may include fields deliberately omitted from the visible conversation.
89
+
90
+ ## Browser/backend split
91
+
92
+ The product browser normally sends product-shaped requests to its own same-origin backend. The backend authenticates, resolves the allowed mapping, and calls OpenGeni. Never bundle an organization key into frontend code.
93
+
94
+ For live sessions, preserve event sequence, reconnect, replay, and duplicate suppression. The SDK's stream and proxy helpers are preferred where compatible. Treat unknown additive event types as forward-compatible data rather than crashing the UI.
95
+
96
+ Uploads may send bytes directly to a short-lived signed storage URL returned by the trusted flow. That URL is narrow transfer authority, not the OpenGeni API key. Verify storage CORS for every intended browser origin.
97
+
98
+ ## Decide what the user sees
99
+
100
+ OpenGeni's durable event stream can support different product projections:
101
+
102
+ - final answer only;
103
+ - assistant messages plus progress and status;
104
+ - selected tool-call summaries;
105
+ - approvals and structured human-input cards; or
106
+ - a detailed operational timeline.
107
+
108
+ The customer frontend chooses which event types and fields to render. Hiding an event from the chat view does not remove it from OpenGeni's durable history or from authorized audit readers. Do not promise data erasure or secrecy from presentation filtering.
109
+
110
+ Even a final-answer-only UI should surface states the user must act on: failure, cancellation, credit or policy denial, approval requests, human-input requests, reconnect status, and a way to retry safely. Avoid presenting tool failures as ordinary assistant prose when product state can represent them more clearly.
111
+
112
+ ## Fit the host product
113
+
114
+ Follow existing navigation, accessibility, responsive, loading, error, observability, localization, and design-system conventions. Keep OpenGeni IDs behind product-native identifiers. Make the smallest dependency addition that improves correctness.
115
+
116
+ The integration should feel native to the customer product while retaining OpenGeni's session semantics. Framework adaptation is expected; protocol reimplementation is not a goal.
@@ -0,0 +1,157 @@
1
+ # Runtime profile and verification
2
+
3
+ ## Generate customer-specific runtime behavior
4
+
5
+ This Skill guides the implementation agent, not end-user runtime chats. The implementation agent should derive the customer-facing agent's runtime profile from the customer's product intent and system, then store that profile with the customer's integration code or configuration. Do not attach this generic implementation Skill to end-user runtime chats.
6
+
7
+ A runtime profile may contain:
8
+
9
+ - stable workspace instructions or persona;
10
+ - one session role and its instructions;
11
+ - selected, versioned runtime Skills;
12
+ - model and reasoning defaults or per-session overrides;
13
+ - exact first-party tools, MCP or API Integration servers, and resources;
14
+ - memory, approvals, human-input, and autonomy behavior;
15
+ - product context mapping; and
16
+ - the event projection the frontend renders.
17
+
18
+ Use only the pieces the product needs. A simple chat may need concise session instructions and one data Integration, not a new Skill hierarchy.
19
+
20
+ ## Shape behavior around the product
21
+
22
+ Infer the audience, tasks and expected interaction from the product and user.
23
+ Recommend a fitting initial response style, depth and progress presentation;
24
+ ask about unresolved choices when they materially change the experience.
25
+ A brief answer with optional detail may suit a dashboard, while an investigation
26
+ or automation may need a different pattern. Do not impose a universal word
27
+ limit, fixed answer format, tool-call budget, or mandatory questionnaire.
28
+
29
+ Try a representative first question and show the resulting experience when
30
+ practical. Explain where the owner can tune instructions, model/reasoning,
31
+ selected tools and domain Skills, including whether changes affect existing or
32
+ only new sessions. Avoid scattering one behavior across multiple prompt layers.
33
+
34
+ ## Put behavior in the right lifetime
35
+
36
+ | Concern | OpenGeni surface | Update behavior |
37
+ | --- | --- | --- |
38
+ | Stable behavior for every session in one workspace | Workspace agent instructions | Reconciled as workspace configuration |
39
+ | One agent role or one conversation's system behavior | Session instructions | Fixed for that session |
40
+ | Conditional procedure, domain method, or tool-use guidance | Runtime Skill | Installed at workspace scope or sent inline at create |
41
+ | Current route, selected dashboard, filters, or viewport | modelContext on the exact message | Updated per accepted message when relevant |
42
+ | User-visible request | Initial or follow-up message text | Durable conversation content |
43
+ | Default model and reasoning | Workspace session defaults | Applies to newly created sessions |
44
+ | Exact model or reasoning for one session or turn | Session create or message options | Explicit request wins, subject to policy |
45
+ | Models a workspace may use | Workspace model access policy | Hard allowlist, managed separately |
46
+ | Default tool catalog | Workspace session tool defaults | Applies when a create request omits a selection |
47
+ | Customer-facing headless tool set | Explicit session tool selections | Fixed onto session; follow-up policy changes use supported session controls |
48
+
49
+ Do not duplicate the same instruction across workspace instructions, session instructions, Skills, and every user message. Keep stable policy out of modelContext, and keep volatile dashboard state out of the persistent instruction prefix.
50
+
51
+ Inline Skills are sent once in createSession and stored with that session; they are not retransmitted on every turn. Existing sessions retain their selected Skill content. To update behavior, version the customer profile and use the new Skill definitions for new sessions, with an explicit migration or new-session policy if old conversations must change. Workspace-installed Skills are resolved through their own installation lifecycle and should not also be copied inline.
52
+
53
+ Model IDs and provider availability are deployment facts. Inspect the live client configuration and model policy. Use workspace session defaults when many sessions share the same choice; use a per-session model or reasoning override when the product or user chooses. Never hard-code a remembered catalog into a reusable integration.
54
+
55
+ OpenGeni credits are held and admitted at the organization account, so organization workspaces using the OpenGeni-credits model path draw from the same account balance. Workspace count does not create separate credit wallets. Connected subscriptions and workspace-owned provider credentials can use their separately reported external billing path instead. Preserve workspace and product-boundary identifiers in usage attribution so a shared organization balance does not obscure who consumed it.
56
+
57
+ ## Provision and reconcile deliberately
58
+
59
+ Separate hot-path chat handling from control-plane setup:
60
+
61
+ - Workspace ensure is idempotent and may run lazily, but persist the result and avoid name-based lookup.
62
+ - Apply workspace settings, tool defaults, Connections, API Integrations, and profile versions through a versioned reconciliation step at provisioning, startup, deployment, or a controlled migration.
63
+ - Do not patch the same workspace settings, preview the same API, or reinstall the same Integration on every message unless drift was detected.
64
+ - Use stable idempotency keys for workspace/session creation and external mutations that support them.
65
+ - Store non-secret mapping metadata: product boundary ID, OpenGeni workspace ID, runtime profile version, Integration instance/server ID, Connection ID, and relevant optimistic versions.
66
+ - Define lifecycle handling for user disablement, tenant deletion, credential revocation, retention, and workspace cleanup.
67
+
68
+ For a large existing customer population, choose lazy creation, a bounded backfill, or both. New product users can trigger the same idempotent provisioning path through the customer's normal lifecycle event. Do not require an OpenGeni human signup per product end user for service-backed sessions.
69
+
70
+ ## Verification matrix
71
+
72
+ Adapt tests to the product, but cover the behaviors that can fail across the boundary:
73
+
74
+ **Contract and configuration**
75
+
76
+ - installed SDK types agree with the deployed service and client configuration;
77
+ - desired model, reasoning, sandbox, capabilities, and API Integration server exist;
78
+ - the intended OpenGeni-credit or externally billed model path is visible and attributed to the product boundary;
79
+ - workspace settings and runtime profile reconciliation are idempotent; and
80
+ - session creation retries converge on one session.
81
+
82
+ **Identity and isolation**
83
+
84
+ - product authentication is required for every proxy route;
85
+ - product boundary IDs map to the intended distinct or shared workspaces;
86
+ - cross-user and cross-tenant workspace/session ID substitution fails;
87
+ - effective first-party and external tool policies contain only intended capabilities; and
88
+ - provider endpoints enforce token tenant/user scope independently of prompts.
89
+
90
+ **Session experience**
91
+
92
+ - initial and follow-up messages reach the correct session;
93
+ - SSE reconnect backfills by sequence without duplicated UI effects;
94
+ - unknown additive events do not crash the client;
95
+ - the chosen final-only, progress, or detailed projection behaves as intended;
96
+ - approvals, human input, cancellation, failures, credit limits, and reconnection are actionable; and
97
+ - accessibility and narrow/wide layouts match the host product.
98
+
99
+ **Data and credentials**
100
+
101
+ - happy-path tools return bounded structured data;
102
+ - expired, revoked, wrong-scope, wrong-audience, and wrong-tenant credentials fail closed;
103
+ - credential values do not appear in responses, events, logs, Skills, prompts, or browser bundles;
104
+ - rotation succeeds without recreating unrelated state; and
105
+ - unsafe or ambiguous writes are not replayed.
106
+
107
+ Run the existing product test and build commands appropriate to the changed layers. Do not demand a live deployment test when the user retained deployment authority; provide the exact smoke test they can run instead. Do not deploy merely to make local tests pass.
108
+
109
+ ## Check the experience, not only the wiring
110
+
111
+ Use ordinary product questions as well as directed tool smoke tests. Check that
112
+ answers preserve important definitions and limitations, and that the agent admits
113
+ when an analysis or action is unavailable. Prefer representative failure cases
114
+ over a large checklist unrelated to the product.
115
+
116
+ Include cases drawn from the actual product: misleading or instruction-like text
117
+ inside retrieved data, an unavailable breakdown, a filter that affects only some
118
+ metrics, or a request outside the allowed capabilities. Check that untrusted data
119
+ stays evidence, not instructions, and that uncertainty is visible in the answer.
120
+ Select relevant cases rather than imposing an analytics evaluation on every product.
121
+
122
+ Inspect the effective executable tool surface and exercise the intended data tool.
123
+ Attaching MCP definitions and selecting their server are separate; a reachable
124
+ server does not prove the session selected it. Do not infer the absence of
125
+ provider-native tools from the MCP or first-party allowlist alone. Report any
126
+ capability the live deployment cannot constrain; prompts are not enforcement.
127
+
128
+ For interactive experiences, observe formatting, progress, errors, follow-ups,
129
+ reload/reconnect and stopping behavior. Measure time to useful output separately
130
+ from total completion. Use the trace to distinguish startup, model work, tool
131
+ latency and frontend buffering before changing models or transport. Mocks prove
132
+ local behavior; record live checks that remain unavailable rather than claiming
133
+ end-to-end success from mocks.
134
+
135
+ ## Handoff
136
+
137
+ Report the implemented shape in product language:
138
+
139
+ - what experience was added;
140
+ - what product identity maps to a workspace and why;
141
+ - where the organization key and provider credentials live;
142
+ - how customer data becomes tools and how those tools authorize requests;
143
+ - which runtime profile version, model, Skills, memory, approvals, and tools are selected;
144
+ - what was tested, including negative isolation tests;
145
+ - what was not executed because it remains customer-owned; and
146
+ - exact remaining setup, review, deployment, monitoring, or rollback steps.
147
+
148
+ Make any remaining setup executable by a fresh agent with the customer repository,
149
+ public documentation, and ordinary customer access. Record verified non-secret
150
+ origin and organization/workspace IDs, identity mapping, package/configuration
151
+ versions, secret names and storage locations, plus runnable probes with expected
152
+ results. Explain how an authorized owner can manage the created workspace without
153
+ silently linking identities or widening membership. Complete discoverable setup
154
+ before handoff; identify operator-only blockers separately and do not depend on
155
+ internal source, cluster access, prior chat memory, or undocumented local helpers.
156
+
157
+ If a durable customer integration Skill would reduce future rediscovery, generate one beside the integration code containing only stable, non-secret project facts and smoke probes. Do not turn the generic implementation Skill into the customer's analytics prompt, and do not make generated runtime behavior depend on the implementation workspace retaining this implementation Skill.
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: opengeni-help
3
+ description: Answer questions about OpenGeni setup, product integration, SDK/API behavior, billing, GitHub access, and development setup. Read the official product docs before making product-specific claims or replacing an application's AI provider. No installation is needed for this bundled guide.
4
+ ---
5
+
6
+ # OpenGeni product help
7
+
8
+ Use this guide when the user asks about OpenGeni itself. Answer their latest
9
+ question first, using the deployed service and installed SDK as contract evidence.
10
+ This is product reference guidance, not the persona of a customer support bot.
11
+
12
+ ## Fetch the official documentation
13
+
14
+ The public documentation index is **https://docs.opengeni.ai/llms.txt**. Fetch
15
+ it with the available web or HTTP tool, then read the relevant pages. Markdown
16
+ pages are available by adding `.md`, for example:
17
+
18
+ - Product integration: https://docs.opengeni.ai/guides/integrate-your-product.md
19
+ - Authentication: https://docs.opengeni.ai/reference/authentication.md
20
+ - SDK: https://docs.opengeni.ai/reference/sdk.md
21
+
22
+ Docs describe supported behavior; they do not prove that a particular deployment
23
+ or installed package includes a feature. Check `/v1/config/client`, installed
24
+ SDK exports/types, and authorized live configuration or probes. Report a failed
25
+ documentation fetch explicitly and use another authoritative source. Do not
26
+ ask the customer to supply OpenGeni's own API contract before trying these sources.
27
+
28
+ For implementation, read the bundled `opengeni-client` Skill with `skill_read`
29
+ and follow its relevant references. It is available by default without a Pack,
30
+ installation, or repository clone. If an embedding host excludes it, respect
31
+ that selection; the public product-integration guide remains reference material.
32
+
33
+ ## Integration and account setup
34
+
35
+ OpenGeni's service API owns workspaces, sessions, turns, and events. A compatible
36
+ `@opengeni/sdk/chat` package can provide a handler in the customer's backend for
37
+ native, Vercel UI streams, or supported OpenAI-shaped chat formats. This does
38
+ not make OpenGeni's service URL a universal OpenAI inference endpoint.
39
+
40
+ Before replacing a provider, establish the customer's actual API usage:
41
+ server-side generation/provider calls versus a frontend UI stream, streaming,
42
+ tools, embeddings, authentication, history, and usage reporting. Generic client
43
+ documentation cannot prove OpenGeni server compatibility. Do not invent SDK
44
+ methods or routes. Verify embedding support independently; chat-format support
45
+ does not imply `/embeddings`. Preserve an existing embedding provider unless a
46
+ supported replacement is established.
47
+
48
+ If the user wants account configuration and will update secrets themselves,
49
+ resolve that account-side request before offering more application wiring.
50
+ Inspect authorized configuration and setup tools. A product backend normally
51
+ holds an organization API key; the browser never receives it. Separate an
52
+ unavailable administrative action from an unknown protocol. State any exact
53
+ human setup step that remains, rather than claiming the account is configured.
54
+
55
+ ## Discovery and integrations
56
+
57
+ Tool search is ranked, not exhaustive. Recover a miss through `tool_list` and
58
+ exact-name schema loading where available. Use `capability_catalog_search` for
59
+ reviewed integration candidates and `skill_read` for available guidance. Missing
60
+ `ogtool` is a local executable problem, not proof that a capability is absent.
61
+
62
+ For connection setup, follow the shared Integration setup guidance and the
63
+ catalog's returned next action. Account-management permissions and the ability
64
+ to request human setup are separate.
65
+
66
+ ## Cost questions
67
+
68
+ Read the installed SDK's reply types and formatter, then the relevant accounting
69
+ contract. Model-picker labels show a billing category, not per-request cost.
70
+ The current chat facade and Vercel/OpenAI formatters do not define a first-class
71
+ monetary cost field. Recheck that statement against the installed version.
72
+
73
+ `getBillingUsage` is a separate permissioned accounting read. Its presence does
74
+ not mean the current credential may use it, that its bounded result covers the
75
+ whole conversation, or that it adds cost to an AI SDK response. Distinguish
76
+ charged OpenGeni credits, estimated provider cost, and externally billed usage.
77
+ Zero OpenGeni charge does not establish zero upstream expense. A turn can contain
78
+ multiple model responses. When response fields cannot be verified, say exactly
79
+ what is unknown rather than answering “probably.”
80
+
81
+ ## Development dependency recovery
82
+
83
+ Inspect the repository's runtime/version files, package manager, lockfile, and
84
+ test commands before implementation. Probe the actual selected compute for the
85
+ required versions. If dependencies are missing, install the declared versions
86
+ within the authorized disposable sandbox, then rerun the checks. On a Connected
87
+ Machine, respect its existing configuration and the user's authority over
88
+ machine changes.
89
+
90
+ Do not stop at `node: not found` or `pnpm: not found` when safe in-scope recovery
91
+ is available. Keep dependency-install errors, report the exact remaining blocker,
92
+ and distinguish code written, local commit, executed tests, verified integration,
93
+ and publication. A diff/whitespace check does not validate execution.
94
+
95
+ ## Embedded agents choose their guidance
96
+
97
+ The host can pass `bundledSkillIds: []` to exclude all bundled guides, or list
98
+ only supported capability guides. This includes opting out of this guide.
99
+ Workspace Skills, inline Skills, tool permissions, and ordinary runtime rules
100
+ remain separate. Do not copy OpenGeni product or implementation guidance into
101
+ the embedded agent's persona. Follow the product's explicit selections.