@tangle-network/chatgpt-agents-kit 0.1.0 → 0.1.2

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/CARDS.md ADDED
@@ -0,0 +1,135 @@
1
+ # Optional agent cards
2
+
3
+ Cards let people open an existing agent, submit a prompt, check the same task, and read its retained result.
4
+ They use the kit’s existing tools and OAuth scopes.
5
+ No browser token, task store, native client, or extra backend is introduced.
6
+
7
+ The optional cards entry is available in the published kit.
8
+ This revision adds named discovery and a new versioned UI resource; release it before updating hosted consumers.
9
+
10
+ ```ts
11
+ import { createAgentsHandler } from '@tangle-network/chatgpt-agents-kit'
12
+ import { createAgentCards } from '@tangle-network/chatgpt-agents-kit/cards'
13
+
14
+ const handler = createAgentsHandler({
15
+ metadata,
16
+ oauth,
17
+ nativeMcp: createMcpToolHandler,
18
+ bind,
19
+ cards: createAgentCards({ domain: 'https://your-dedicated-widget-origin.example' }),
20
+ })
21
+ ```
22
+
23
+ Use your actual dedicated HTTPS widget origin for a hosted ChatGPT submission.
24
+ Omit `domain` for local compatible-host development.
25
+ Omit `cards` to retain the existing tools-only protocol.
26
+ The main package entry does not import React, UI components, or the embedded HTML.
27
+ The optional entry bundles all JavaScript and CSS; the widget makes no direct network requests.
28
+
29
+ ## Contract
30
+
31
+ The existing agent and task tools receive `_meta.ui.resourceUri` when cards are enabled.
32
+ The renderer uses `ui://tangle-agents/cards-v2.html` so hosts do not reuse the earlier cached interface.
33
+ Optional `list_my_threads` and `list_my_tasks` tools use the same resource.
34
+ The same authenticated handler serves `resources/list` and `resources/read` with `text/html;profile=mcp-app`.
35
+ Resource CSP declares no network or external asset domains.
36
+ Text and structured tool results remain available to clients that do not render UI.
37
+ Native actions, OAuth, scope checks, and workspace authorization run through the existing dispatcher.
38
+
39
+ The widget uses the official MCP Apps `App` bridge, with host theme and resize support.
40
+ It reuses Tangle Brand tokens and the maintained Tangle UI Button, Input, and Textarea components.
41
+ Only tools granted in the current native binding are offered as actions.
42
+ A read-only grant does not expose a prompt form, even when the model can discover a consent-upgrade tool.
43
+ Hosts without tool-call support display results and direct users back to chat.
44
+
45
+ Hosts can supply `NativeServices.listThreads` and `listTasks` to expose named conversations and recent work.
46
+ Thread discovery requires the existing list and connect grants; task discovery requires list and task grants.
47
+ The kit checks visible workspaces, each returned target, and the live grant before returning bounded summaries.
48
+ Task discovery supports optional workspace and conversation filters, search, cursors, and pages of at most ten results.
49
+ Cards search and paginate actual native results without creating or restarting work.
50
+ Hosts without discovery retain an advanced reference field and an app link when the host supports opening links.
51
+ No conversation title, target, or app route is invented.
52
+
53
+ Submission requires an explicit click and includes the connected agent’s native `contextVersion` and a fresh `turnId`.
54
+ A lost response offers a read of that same task; it never automatically resubmits.
55
+ A failed recovery read retains that original task identity.
56
+ When ChatGPT supports widget state, the card saves only the app/account identity, native target, task ID, and phase before admission.
57
+ After iframe recreation it checks the current authenticated identity and rereads the native task.
58
+ A restored card ignores host-replayed results; it renders only the fresh authorized native read.
59
+ A different account cannot use the saved handle; an unverified task remains unavailable until its native read succeeds.
60
+ The card also consumes complete host tool input when the host initiated a prompt call.
61
+ Widget state holds no prompt, output, token, or authoritative task data and is not cross-session storage.
62
+ An explicit task lookup failure keeps an editable task ID and a route back to the agent list.
63
+ Kit validation and context checks mark pre-admission rejection with `error.admission: not-started`; cards then offer reconnect and preserve the prompt draft.
64
+ Refresh always reads the original workspace, conversation, and task.
65
+ When supported, the widget updates model context for task, directory, agent, loading, and failure transitions.
66
+ The context describes the current selection and retained identity without output text.
67
+ It never sends output text as instructions or starts a follow-up model turn.
68
+
69
+ The UI displays native states without fabricated percentages.
70
+ “Completed” requires `completionVerified: true` from the kit.
71
+ Unverified outputs stay unavailable, and failed refreshes clear previously displayed results.
72
+ Markdown results use the maintained Tangle UI sanitizer; other text retains whitespace.
73
+ Images make no external requests, and supported external links open through the host bridge.
74
+ File revisions and SHA-256 evidence remain in collapsed source details.
75
+ Downloads appear only when the host advertises `downloadFile` and export the exact retained bytes through that bridge.
76
+ The card does not implement a direct iframe download fallback.
77
+ “Revise result” reconnects the same native target and opens an editable request; only explicit submission starts another task.
78
+ The revision includes the original execution and response hash or file revisions, preserving the reviewed result.
79
+ Settled failed or input-required responses remain readable when verified, without claiming completion.
80
+ A missing or changed partial file does not discard that verified non-completion response.
81
+ Cancellation, approval, provisioning, and messaging remain in the existing conversational tools; cards add no automatic actions.
82
+
83
+ ## Installed example and verification
84
+
85
+ From the repository root:
86
+
87
+ ```sh
88
+ npm ci --no-audit --no-fund
89
+ npm run build --workspace @tangle-network/chatgpt-agents-kit
90
+ npm run test:cards --workspace @tangle-network/chatgpt-agents-kit
91
+ npx playwright install chromium
92
+ npm run proof:cards --workspace @tangle-network/chatgpt-agents-kit
93
+ npm run proof:cards:lifecycle --workspace @tangle-network/chatgpt-agents-kit
94
+ node plugins/agents/cards/proof-ux.mjs
95
+ ```
96
+
97
+ The browser proof packs the compiled kit and installs it outside the checkout.
98
+ A consumer module imports the public package and `./cards` entry through ordinary Node resolution.
99
+ Both GTM and Workspace configurations use that same installed renderer and the maintained Agent App MCP dispatcher.
100
+ Their distinct workspace, thread, turn, and execution IDs are checked against the existing deterministic SQLite test host.
101
+ The same task is refreshed and reopened without another admission.
102
+ The lifecycle proof recreates the iframe after an accepted admission with a lost response.
103
+ It checks the same task UUID, one native admission, renewed-account recovery, different-account denial, context changes, and partial theme updates.
104
+ The installed package test imports both the root and `/cards` exports with install scripts disabled.
105
+
106
+ The proof captures tool-only and rendered desktop/mobile images, light/dark themes, original interaction videos, keyboard use, and accessibility checks.
107
+ It also checks an empty list, a read-only grant, changed output revisions, and revoked access after a successful result.
108
+ Artifacts are written under `plugins/agents/receipts/cards/` and excluded from the published package.
109
+
110
+ The document proof checks initial host-driven directory search, pagination, exact download bytes, an explicit revision, and reopening the original result.
111
+ Its document is deterministic fixture content, not model output or customer research.
112
+
113
+ To keep the example running for manual inspection:
114
+
115
+ ```sh
116
+ CARDS_PORT=4399 node plugins/agents/cards/example.mjs
117
+ ```
118
+
119
+ Open the printed GTM and Workspace URLs.
120
+ The example uses deterministic test data and test credentials confined to the local server.
121
+ It does not connect to a hosted Tangle account or execute a model.
122
+ Do not deploy this test host.
123
+
124
+ Hosted OAuth, live native execution, and an actual ChatGPT installation remain separate acceptance steps owned by each adopting application.
125
+ Install the released kit, enable cards on its existing authenticated endpoint, refresh tool discovery in ChatGPT, and repeat the same native identity/result checks.
126
+ The local example is not evidence that those hosted steps passed.
127
+
128
+ ## Maintained contracts consulted
129
+
130
+ - [OpenAI: Add UI to your MCP server](https://developers.openai.com/plugins/build/chatgpt-ui)
131
+ - [OpenAI: Plugin UI reference](https://developers.openai.com/plugins/reference)
132
+
133
+ Checked October 2, 2026.
134
+ OpenAI recommends separate rendering tools when repeated iframe refreshes hurt a workflow.
135
+ These compact cards attach to the existing tools to avoid duplicate public operations; their authenticated native results already contain the required data.
package/README.md CHANGED
@@ -81,26 +81,25 @@ engine, provider connection or billing ledger is implemented here.
81
81
  direct GTM route exposes file handoff or every generic action.
82
82
  The chat config follows a GTM source lane and is not hosted acceptance.
83
83
 
84
- ## Readiness: what this PR does and does not prove
85
-
86
- The generator produces portable plugin packages. The adapter authenticates every
87
- protected request, discovers only available/permitted native operations, retains
88
- native target IDs, and refuses to verify success without execution-linked output
89
- revisions and retrieved bytes. The GTM adapter implements the reviewed
90
- workspace/thread/vault mappings, including create-only/update preconditions and
91
- partial creation receipts. Text files are supported; binary upload is not.
92
-
93
- **GTM is not yet a usable hosted OAuth plugin at the inspected revision.**
94
- `gtm-agent/src/lib/.server/auth-utils.ts` routes every Authorization header to
95
- `authenticateOperatorApi`; that verifier accepts the native `gak_` store, not
96
- resource-bound OAuth. Its current Hub OAuth scopes also do not grant GTM's
97
- `operator:*` scopes. Pointing ChatGPT at these endpoints or forwarding a Hub
98
- access token would be wrong. This PR does neither. A real GTM mount still needs
99
- an existing-identity OAuth/native authorization binding and persisted turn
100
- admission/observation ports. These are explicit host inputs, **not implemented
101
- backend services hidden behind stubs**. The second configuration likewise needs
102
- its real host binding. No hosted endpoint, OAuth login, ChatGPT installation,
103
- native GTM task, second product task, or provider delivery was executed.
84
+ ## Verified release and remaining acceptance
85
+
86
+ On October 2, 2026, `@tangle-network/chatgpt-agents-kit@0.1.1` was publicly available from npm.
87
+ A fresh external consumer installed that release, used its compiled CLI, and generated a plugin with the registered app connection.
88
+ The generated GTM plugin was installed in ChatGPT and completed one authorized task in an existing workspace and conversation.
89
+ After reload and reconnect, it returned the same retained output and native execution references.
90
+ That fixed-response task establishes transport and continuity, not the quality of useful customer work.
91
+
92
+ This evidence applies to that GTM connection and release.
93
+ It does not establish Creative activation, ordinary Builder agents, phone continuity, or hosted result-card behavior.
94
+ Those flows need their own acceptance through the deployed app.
95
+ The current source skills guide discovery by name, useful deliverables, revision, and returning later.
96
+ Install the release containing those changes before evaluating their hosted behavior.
97
+ Their meaningful-work acceptance remains separate from source, package, and fixture checks.
98
+
99
+ Every adopting app still owns its OAuth binding, native admission, authorization, and retained outputs.
100
+ The generator creates a package; it neither implements missing host services nor grants capabilities.
101
+ The adapter requires execution-linked output evidence before verifying completion.
102
+ Text file support, when exposed by the host, handles UTF-8 content rather than binary uploads.
104
103
 
105
104
  The tests use the **unmodified, hash-verified maintained agent-app MCP envelope**
106
105
  and a test-only SQLite contract fixture. That fixture genuinely reads randomized
@@ -116,15 +115,15 @@ OAuth MCP endpoint; the app keeps its native account, agent profile, workspace,
116
115
  thread, task state, permissions and execution evidence. Package generation does
117
116
  not provision an agent or add capabilities to the endpoint.
118
117
 
119
- Before the first approved npm release, install an actual built kit tarball in
120
- your app directory. No checkout or TypeScript loader is needed by the adopter:
118
+ Install this release in your app directory:
121
119
 
122
120
  ```sh
123
- npm install --ignore-scripts /absolute/path/tangle-network-chatgpt-agents-kit-0.1.0.tgz
121
+ npm install --save-exact --ignore-scripts @tangle-network/chatgpt-agents-kit@0.1.2
124
122
  ```
125
123
 
126
- After publication, an approved exact registry version can replace the tarball.
127
- Neither this command nor the generator publishes anything.
124
+ Use the approved exact version when adopting a later release.
125
+ No repository checkout or TypeScript loader is required.
126
+ Neither installation nor package generation publishes anything.
128
127
  Create `app.json` using your own application origin and display metadata (the
129
128
  `.example` origin below is a placeholder, not a deployed service):
130
129
 
@@ -184,33 +183,13 @@ import { createAgentsHandler, type NativeBinding } from '@tangle-network/chatgpt
184
183
  import { createGtmBinding } from '@tangle-network/chatgpt-agents-kit/gtm'
185
184
  ```
186
185
 
187
- The source repository remains private. Packaging and a local install do not
188
- publish the kit or make a hosted ChatGPT connection available. After an approved
189
- release, consumers can pin `@tangle-network/chatgpt-agents-kit@0.1.0` from npmjs.
190
- A Tangle npm organization owner must bootstrap `0.1.0` from the reviewed merged
191
- source. They must authenticate to npmjs, inspect the full organization package
192
- inventory with owner access, and stop if the name already exists as restricted.
193
- These CLI checks help confirm the account and status:
186
+ The public npm package is available independently of source repository access.
187
+ Installing it does not deploy the app's endpoint or register a ChatGPT connection.
188
+ Follow [installed-kit setup](./SETUP.md) for registration, generation, and the customer journey.
194
189
 
195
- ```sh
196
- npm whoami --registry=https://registry.npmjs.org/
197
- npm view @tangle-network/chatgpt-agents-kit name version --json --registry=https://registry.npmjs.org/
198
- npm access get status @tangle-network/chatgpt-agents-kit --json --registry=https://registry.npmjs.org/
199
- ```
200
-
201
- An `E404` from `npm view` can mean absent or inaccessible. `npm access get status`
202
- reports `private` even for an absent name. Neither result proves absence. Once
203
- the owner confirms the name is absent, they can run this from the merged source:
204
-
205
- ```sh
206
- npm publish --workspace @tangle-network/chatgpt-agents-kit --ignore-scripts --access public --registry=https://registry.npmjs.org/
207
- ```
208
-
209
- The manual `Publish Agents kit` workflow handles later versions only after the
210
- package is public. It requires a repository-owned `NPM_PUBLISH_TOKEN` with
211
- publish access to the Tangle npm scope. The workflow passes no access override
212
- and stops unless the package is already public. It does not deploy an MCP
213
- endpoint or install a ChatGPT plugin.
190
+ Maintainers publish a reviewed version through the repository's `Publish Agents kit` workflow or its authorized release path.
191
+ The workflow requires an existing public package and repository-owned npm publication credentials.
192
+ Publication does not establish hosted app acceptance.
214
193
 
215
194
  For development, a GTM pnpm consumer can also install a commit-pinned Git
216
195
  subdirectory without copying this package:
@@ -274,8 +253,9 @@ No process-global inspection credential is retained.
274
253
 
275
254
  `createGtmBinding` in `src/gtm.ts` maps normal native routes. It has **no API-key
276
255
  parameter**. Its `request` callback must already be authorized as the resolved
277
- native identity; the current GTM source does not provide a turnkey OAuth-native
278
- request dispatcher. The `turns` ports must use the persisted agent-app chat
256
+ native identity through the app's existing authorization path.
257
+ The adapter does not supply an OAuth-native request dispatcher.
258
+ The `turns` ports must use the persisted agent-app chat
279
259
  vertical, saved profile, native turn UUID admission/deduplication, retained
280
260
  terminal state and execution-linked file revisions. HTTP 200 or an open stream
281
261
  is not an admission or completion implementation. Missing ports hide delegation
@@ -299,12 +279,12 @@ substitute for `hosted-agent/application` continuation of the existing agent.
299
279
 
300
280
  ## Consumer workflow and receipts
301
281
 
302
- The skill offers **Connect my agent**, and offers **Create an agent** only when
303
- native discovery advertises it. It requires review of the exact brief/files,
304
- preserves workspace/thread/profile, treats files as data rather than new
305
- instructions, handles pending native decisions as delegated responses, and
306
- requires explicit review before messaging. No `approved: true` field is treated
307
- as proof that a human approved an operation.
282
+ The skills find existing work by name through discovered tools and present its actual result.
283
+ They retain native references internally for review, revisions, and returning later.
284
+ Creation is offered only when requested and supported.
285
+ Clear user instructions authorize their stated effects; ambiguous or new effects need clarification.
286
+ File contents remain data, and native permission and approval controls still apply.
287
+ No `approved: true` field proves that a human approved an operation.
308
288
 
309
289
  Handoff receipts distinguish the input hash from stored-byte verification.
310
290
  Acceptance rereads the stored input. Completion receipts require the retained
@@ -414,3 +394,9 @@ Root foundation owns the repository marketplace, lockfile and shared tooling.
414
394
  Official specifications reviewed on 2026-09-30:
415
395
  - https://developers.openai.com/plugins/build/plugins
416
396
  - https://developers.openai.com/plugins/build/auth
397
+
398
+ ## Optional agent cards
399
+
400
+ Enable the separate `@tangle-network/chatgpt-agents-kit/cards` entry to render agents and verified task results through MCP Apps.
401
+ See [CARDS.md](./CARDS.md) for setup, installed examples, and the hosted acceptance boundary.
402
+ Omitting the option preserves tools-only clients.
package/SETUP.md CHANGED
@@ -8,16 +8,16 @@ missing. Start with the app's reviewed endpoint, not a GTM connection ID.
8
8
 
9
9
  ## 1. Install the reviewed kit
10
10
 
11
- Use Node >=22.16 and npm >=10. Until an approved public release is available, get
12
- the built tarball from the release owner and install it in your own app project:
11
+ Use Node >=22.16 and npm >=10.
12
+ Install this release in your own app project:
13
13
 
14
14
  ```sh
15
- npm install --ignore-scripts --no-audit --no-fund /absolute/path/tangle-network-chatgpt-agents-kit-0.1.0.tgz
15
+ npm install --save-exact --ignore-scripts --no-audit --no-fund @tangle-network/chatgpt-agents-kit@0.1.2
16
16
  npm ci --ignore-scripts --strict-peer-deps --no-audit --no-fund
17
17
  npm exec --no -- tangle-agents-plugin --help
18
18
  ```
19
19
 
20
- Use the approved exact version after publication, not an assumed npm release.
20
+ Use the approved exact version when adopting a later release.
21
21
  `npm exec --no` uses the installed binary without fetching a replacement. Neither
22
22
  these commands nor the generator publishes anything. No repository checkout,
23
23
  workspace link, TypeScript loader or install hook is required by the consumer.
@@ -149,7 +149,43 @@ test in a new chat. A package import is separate from hosted tool calls. A local
149
149
  marketplace is optional and is not written into your home directory by this CLI.
150
150
  Public directory submission/review is a separate release-owner operation.
151
151
 
152
- ## 5. Prove continuation, not just import
152
+ ## Refresh tools and update skills
153
+
154
+ The registered app connection and generated plugin package have separate update paths.
155
+ After deploying changed server tools, refresh the registered app's tool catalog.
156
+ In the ChatGPT plugin UI checked on October 3, 2026 UTC:
157
+
158
+ 1. Open the registered app, such as Tangle GTM Agent.
159
+ 2. Choose **More actions → Manage → Manage app → Refresh tools**.
160
+ 3. Wait for refresh to finish, then reload the app details and inspect its tools.
161
+ 4. Open a new chat and make a read-only request using the changed tools.
162
+ Confirm the expected tools appear in the tool activity.
163
+
164
+ A live `agent_capabilities` response can describe new tools while ChatGPT still holds the previous callable catalog.
165
+ After refreshing, verify the callable tools in a new chat while keeping the same agent and workspace.
166
+
167
+ For changed skills or package metadata, generate a new archive with the same plugin name.
168
+ On the generated plugin, choose **More actions → Upload new version** and upload that archive.
169
+ Then test the updated skills in a new chat.
170
+ Uploading the package and refreshing server tools are distinct checks; neither proves task execution or completed work.
171
+
172
+ ## 5. Prove a useful customer journey
173
+
174
+ Start with ordinary requests in the installed plugin:
175
+
176
+ 1. “Show my agents and help me choose what to work on.”
177
+ 2. “In [existing project], draft [a concrete useful deliverable] using [selected context].”
178
+ 3. “Change [a specific part] and keep [the correct facts or constraints].”
179
+ 4. In a new conversation, “Find my work on [project or task name] and show where we left off.”
180
+
181
+ The customer should choose recognizable names and receive the actual work.
182
+ Use supported discovery to resolve technical references internally.
183
+ When discovery is unavailable or ambiguous, state what is missing and ask for a recognizable choice or existing-work link.
184
+ Keep identifiers, hashes, and revisions in the acceptance receipt instead of the default customer response.
185
+ Evaluate usefulness, preserved facts, requested changes, and whether the customer can return without operator assistance.
186
+ A fixed response proves transport, not this journey's value.
187
+
188
+ For the technical acceptance receipt:
153
189
 
154
190
  In the actual installed plugin, call `agent_profile` and `agent_capabilities` and
155
191
  inspect the real available tools. Connect to the same existing agent, workspace
@@ -207,5 +243,5 @@ to `receipts/agents-packaged-generator.json` by the existing harness.
207
243
  This is **installed package and local anonymous HTTP proof**, not hosted OAuth,
208
244
  ChatGPT import/calls, native task execution, output retrieval, reconnect,
209
245
  messaging delivery or authenticated foreign-customer denial. Publication,
210
- Native50 OAuth, Native60 admission, Builder/ADC release changes and Creative
211
- feature flags remain their owners' work; this flow changes none of them.
246
+ OAuth, native admission, app deployments, and feature activation remain each host's responsibility.
247
+ This setup flow changes none of them.
@@ -0,0 +1,6 @@
1
+ import type { AgentCardsResource } from '../src/cards.ts';
2
+ /** Bundled at release build time; compatible with Workers and Node, without filesystem access. */
3
+ export declare function createAgentCards(options?: {
4
+ domain?: string;
5
+ }): AgentCardsResource;
6
+ export type { AgentCardsResource } from '../src/cards.ts';