@portel/photon 1.4.1 → 1.5.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.
- package/README.md +287 -1160
- package/dist/auto-ui/beam.d.ts +9 -0
- package/dist/auto-ui/beam.d.ts.map +1 -0
- package/dist/auto-ui/beam.js +2381 -0
- package/dist/auto-ui/beam.js.map +1 -0
- package/dist/auto-ui/components/card.d.ts +13 -0
- package/dist/auto-ui/components/card.d.ts.map +1 -0
- package/dist/auto-ui/components/card.js +64 -0
- package/dist/auto-ui/components/card.js.map +1 -0
- package/dist/auto-ui/components/form.d.ts +15 -0
- package/dist/auto-ui/components/form.d.ts.map +1 -0
- package/dist/auto-ui/components/form.js +72 -0
- package/dist/auto-ui/components/form.js.map +1 -0
- package/dist/auto-ui/components/list.d.ts +13 -0
- package/dist/auto-ui/components/list.d.ts.map +1 -0
- package/dist/auto-ui/components/list.js +58 -0
- package/dist/auto-ui/components/list.js.map +1 -0
- package/dist/auto-ui/components/progress.d.ts +18 -0
- package/dist/auto-ui/components/progress.d.ts.map +1 -0
- package/dist/auto-ui/components/progress.js +125 -0
- package/dist/auto-ui/components/progress.js.map +1 -0
- package/dist/auto-ui/components/table.d.ts +13 -0
- package/dist/auto-ui/components/table.d.ts.map +1 -0
- package/dist/auto-ui/components/table.js +82 -0
- package/dist/auto-ui/components/table.js.map +1 -0
- package/dist/auto-ui/components/tree.d.ts +13 -0
- package/dist/auto-ui/components/tree.d.ts.map +1 -0
- package/dist/auto-ui/components/tree.js +61 -0
- package/dist/auto-ui/components/tree.js.map +1 -0
- package/dist/auto-ui/daemon-tools.d.ts +45 -0
- package/dist/auto-ui/daemon-tools.d.ts.map +1 -0
- package/dist/auto-ui/daemon-tools.js +580 -0
- package/dist/auto-ui/daemon-tools.js.map +1 -0
- package/dist/auto-ui/design-system/index.d.ts +21 -0
- package/dist/auto-ui/design-system/index.d.ts.map +1 -0
- package/dist/auto-ui/design-system/index.js +27 -0
- package/dist/auto-ui/design-system/index.js.map +1 -0
- package/dist/auto-ui/design-system/tokens.d.ts +9 -0
- package/dist/auto-ui/design-system/tokens.d.ts.map +1 -0
- package/dist/auto-ui/design-system/tokens.js +27 -0
- package/dist/auto-ui/design-system/tokens.js.map +1 -0
- package/dist/auto-ui/design-system/transaction-ui.d.ts +70 -0
- package/dist/auto-ui/design-system/transaction-ui.d.ts.map +1 -0
- package/dist/auto-ui/design-system/transaction-ui.js +982 -0
- package/dist/auto-ui/design-system/transaction-ui.js.map +1 -0
- package/dist/auto-ui/frontend/index.html +84 -0
- package/dist/auto-ui/index.d.ts +21 -0
- package/dist/auto-ui/index.d.ts.map +1 -0
- package/dist/auto-ui/index.js +25 -0
- package/dist/auto-ui/index.js.map +1 -0
- package/dist/auto-ui/openapi-generator.d.ts +71 -0
- package/dist/auto-ui/openapi-generator.d.ts.map +1 -0
- package/dist/auto-ui/openapi-generator.js +223 -0
- package/dist/auto-ui/openapi-generator.js.map +1 -0
- package/dist/auto-ui/photon-bridge.d.ts +159 -0
- package/dist/auto-ui/photon-bridge.d.ts.map +1 -0
- package/dist/auto-ui/photon-bridge.js +262 -0
- package/dist/auto-ui/photon-bridge.js.map +1 -0
- package/dist/auto-ui/photon-host.d.ts +113 -0
- package/dist/auto-ui/photon-host.d.ts.map +1 -0
- package/dist/auto-ui/photon-host.js +284 -0
- package/dist/auto-ui/photon-host.js.map +1 -0
- package/dist/auto-ui/platform-compat.d.ts +71 -0
- package/dist/auto-ui/platform-compat.d.ts.map +1 -0
- package/dist/auto-ui/platform-compat.js +574 -0
- package/dist/auto-ui/platform-compat.js.map +1 -0
- package/dist/auto-ui/playground-html.d.ts +15 -0
- package/dist/auto-ui/playground-html.d.ts.map +1 -0
- package/dist/auto-ui/playground-html.js +1113 -0
- package/dist/auto-ui/playground-html.js.map +1 -0
- package/dist/auto-ui/playground-server.d.ts +7 -0
- package/dist/auto-ui/playground-server.d.ts.map +1 -0
- package/dist/auto-ui/playground-server.js +840 -0
- package/dist/auto-ui/playground-server.js.map +1 -0
- package/dist/auto-ui/registry.d.ts +13 -0
- package/dist/auto-ui/registry.d.ts.map +1 -0
- package/dist/auto-ui/registry.js +62 -0
- package/dist/auto-ui/registry.js.map +1 -0
- package/dist/auto-ui/renderer.d.ts +14 -0
- package/dist/auto-ui/renderer.d.ts.map +1 -0
- package/dist/auto-ui/renderer.js +88 -0
- package/dist/auto-ui/renderer.js.map +1 -0
- package/dist/auto-ui/rendering/components.d.ts +29 -0
- package/dist/auto-ui/rendering/components.d.ts.map +1 -0
- package/dist/auto-ui/rendering/components.js +773 -0
- package/dist/auto-ui/rendering/components.js.map +1 -0
- package/dist/auto-ui/rendering/field-analyzer.d.ts +48 -0
- package/dist/auto-ui/rendering/field-analyzer.d.ts.map +1 -0
- package/dist/auto-ui/rendering/field-analyzer.js +270 -0
- package/dist/auto-ui/rendering/field-analyzer.js.map +1 -0
- package/dist/auto-ui/rendering/field-renderers.d.ts +64 -0
- package/dist/auto-ui/rendering/field-renderers.d.ts.map +1 -0
- package/dist/auto-ui/rendering/field-renderers.js +317 -0
- package/dist/auto-ui/rendering/field-renderers.js.map +1 -0
- package/dist/auto-ui/rendering/index.d.ts +28 -0
- package/dist/auto-ui/rendering/index.d.ts.map +1 -0
- package/dist/auto-ui/rendering/index.js +60 -0
- package/dist/auto-ui/rendering/index.js.map +1 -0
- package/dist/auto-ui/rendering/layout-selector.d.ts +48 -0
- package/dist/auto-ui/rendering/layout-selector.d.ts.map +1 -0
- package/dist/auto-ui/rendering/layout-selector.js +352 -0
- package/dist/auto-ui/rendering/layout-selector.js.map +1 -0
- package/dist/auto-ui/rendering/template-engine.d.ts +41 -0
- package/dist/auto-ui/rendering/template-engine.d.ts.map +1 -0
- package/dist/auto-ui/rendering/template-engine.js +238 -0
- package/dist/auto-ui/rendering/template-engine.js.map +1 -0
- package/dist/auto-ui/streamable-http-transport.d.ts +79 -0
- package/dist/auto-ui/streamable-http-transport.d.ts.map +1 -0
- package/dist/auto-ui/streamable-http-transport.js +1314 -0
- package/dist/auto-ui/streamable-http-transport.js.map +1 -0
- package/dist/auto-ui/types.d.ts +310 -0
- package/dist/auto-ui/types.d.ts.map +1 -0
- package/dist/auto-ui/types.js +71 -0
- package/dist/auto-ui/types.js.map +1 -0
- package/dist/beam.bundle.js +13506 -0
- package/dist/beam.bundle.js.map +7 -0
- package/dist/claude-code-plugin.d.ts.map +1 -1
- package/dist/claude-code-plugin.js +30 -30
- package/dist/claude-code-plugin.js.map +1 -1
- package/dist/cli/commands/info.d.ts +11 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +313 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/marketplace.d.ts +11 -0
- package/dist/cli/commands/marketplace.d.ts.map +1 -0
- package/dist/cli/commands/marketplace.js +198 -0
- package/dist/cli/commands/marketplace.js.map +1 -0
- package/dist/cli/commands/package-app.d.ts +9 -0
- package/dist/cli/commands/package-app.d.ts.map +1 -0
- package/dist/cli/commands/package-app.js +191 -0
- package/dist/cli/commands/package-app.js.map +1 -0
- package/dist/cli/commands/package.d.ts +11 -0
- package/dist/cli/commands/package.d.ts.map +1 -0
- package/dist/cli/commands/package.js +573 -0
- package/dist/cli/commands/package.js.map +1 -0
- package/dist/cli-alias.d.ts.map +1 -1
- package/dist/cli-alias.js +30 -28
- package/dist/cli-alias.js.map +1 -1
- package/dist/cli-formatter.d.ts +8 -24
- package/dist/cli-formatter.d.ts.map +1 -1
- package/dist/cli-formatter.js +8 -325
- package/dist/cli-formatter.js.map +1 -1
- package/dist/cli.d.ts +15 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1157 -1132
- package/dist/cli.js.map +1 -1
- package/dist/daemon/client.d.ts +79 -0
- package/dist/daemon/client.d.ts.map +1 -1
- package/dist/daemon/client.js +532 -8
- package/dist/daemon/client.js.map +1 -1
- package/dist/daemon/manager.d.ts +46 -12
- package/dist/daemon/manager.d.ts.map +1 -1
- package/dist/daemon/manager.js +102 -61
- package/dist/daemon/manager.js.map +1 -1
- package/dist/daemon/protocol.d.ts +62 -6
- package/dist/daemon/protocol.d.ts.map +1 -1
- package/dist/daemon/protocol.js +76 -1
- package/dist/daemon/protocol.js.map +1 -1
- package/dist/daemon/server.d.ts +6 -6
- package/dist/daemon/server.js +743 -133
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/session-manager.d.ts +8 -1
- package/dist/daemon/session-manager.d.ts.map +1 -1
- package/dist/daemon/session-manager.js +32 -9
- package/dist/daemon/session-manager.js.map +1 -1
- package/dist/deploy/cloudflare.d.ts +12 -0
- package/dist/deploy/cloudflare.d.ts.map +1 -0
- package/dist/deploy/cloudflare.js +216 -0
- package/dist/deploy/cloudflare.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +168 -21
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +1120 -318
- package/dist/loader.js.map +1 -1
- package/dist/markdown-utils.d.ts +8 -0
- package/dist/markdown-utils.d.ts.map +1 -0
- package/dist/markdown-utils.js +63 -0
- package/dist/markdown-utils.js.map +1 -0
- package/dist/marketplace-manager.d.ts +10 -0
- package/dist/marketplace-manager.d.ts.map +1 -1
- package/dist/marketplace-manager.js +112 -28
- package/dist/marketplace-manager.js.map +1 -1
- package/dist/mcp-client.d.ts +9 -0
- package/dist/mcp-client.d.ts.map +1 -0
- package/dist/mcp-client.js +11 -0
- package/dist/mcp-client.js.map +1 -0
- package/dist/mcp-elicitation.d.ts +32 -0
- package/dist/mcp-elicitation.d.ts.map +1 -0
- package/dist/mcp-elicitation.js +26 -0
- package/dist/mcp-elicitation.js.map +1 -0
- package/dist/path-resolver.d.ts +9 -12
- package/dist/path-resolver.d.ts.map +1 -1
- package/dist/path-resolver.js +13 -43
- package/dist/path-resolver.js.map +1 -1
- package/dist/photon-cli-runner.d.ts.map +1 -1
- package/dist/photon-cli-runner.js +202 -77
- package/dist/photon-cli-runner.js.map +1 -1
- package/dist/photon-doc-extractor.d.ts +88 -0
- package/dist/photon-doc-extractor.d.ts.map +1 -1
- package/dist/photon-doc-extractor.js +536 -27
- package/dist/photon-doc-extractor.js.map +1 -1
- package/dist/photons/maker.photon.d.ts +182 -0
- package/dist/photons/maker.photon.d.ts.map +1 -0
- package/dist/photons/maker.photon.js +504 -0
- package/dist/photons/maker.photon.js.map +1 -0
- package/dist/photons/maker.photon.ts +626 -0
- package/dist/photons/marketplace.photon.d.ts +110 -0
- package/dist/photons/marketplace.photon.d.ts.map +1 -0
- package/dist/photons/marketplace.photon.js +260 -0
- package/dist/photons/marketplace.photon.js.map +1 -0
- package/dist/photons/marketplace.photon.ts +378 -0
- package/dist/photons/tunnel.photon.d.ts +80 -0
- package/dist/photons/tunnel.photon.d.ts.map +1 -0
- package/dist/photons/tunnel.photon.js +269 -0
- package/dist/photons/tunnel.photon.js.map +1 -0
- package/dist/photons/tunnel.photon.ts +345 -0
- package/dist/security-scanner.d.ts.map +1 -1
- package/dist/security-scanner.js +18 -15
- package/dist/security-scanner.js.map +1 -1
- package/dist/serv/auth/jwt.d.ts +89 -0
- package/dist/serv/auth/jwt.d.ts.map +1 -0
- package/dist/serv/auth/jwt.js +239 -0
- package/dist/serv/auth/jwt.js.map +1 -0
- package/dist/serv/auth/oauth.d.ts +117 -0
- package/dist/serv/auth/oauth.d.ts.map +1 -0
- package/dist/serv/auth/oauth.js +395 -0
- package/dist/serv/auth/oauth.js.map +1 -0
- package/dist/serv/auth/well-known.d.ts +60 -0
- package/dist/serv/auth/well-known.d.ts.map +1 -0
- package/dist/serv/auth/well-known.js +154 -0
- package/dist/serv/auth/well-known.js.map +1 -0
- package/dist/serv/db/d1-client.d.ts +65 -0
- package/dist/serv/db/d1-client.d.ts.map +1 -0
- package/dist/serv/db/d1-client.js +137 -0
- package/dist/serv/db/d1-client.js.map +1 -0
- package/dist/serv/db/d1-stores.d.ts +62 -0
- package/dist/serv/db/d1-stores.d.ts.map +1 -0
- package/dist/serv/db/d1-stores.js +307 -0
- package/dist/serv/db/d1-stores.js.map +1 -0
- package/dist/serv/index.d.ts +114 -0
- package/dist/serv/index.d.ts.map +1 -0
- package/dist/serv/index.js +172 -0
- package/dist/serv/index.js.map +1 -0
- package/dist/serv/local.d.ts +118 -0
- package/dist/serv/local.d.ts.map +1 -0
- package/dist/serv/local.js +392 -0
- package/dist/serv/local.js.map +1 -0
- package/dist/serv/middleware/auth.d.ts +66 -0
- package/dist/serv/middleware/auth.d.ts.map +1 -0
- package/dist/serv/middleware/auth.js +178 -0
- package/dist/serv/middleware/auth.js.map +1 -0
- package/dist/serv/middleware/tenant.d.ts +94 -0
- package/dist/serv/middleware/tenant.d.ts.map +1 -0
- package/dist/serv/middleware/tenant.js +152 -0
- package/dist/serv/middleware/tenant.js.map +1 -0
- package/dist/serv/runtime/executor.d.ts +76 -0
- package/dist/serv/runtime/executor.d.ts.map +1 -0
- package/dist/serv/runtime/executor.js +105 -0
- package/dist/serv/runtime/executor.js.map +1 -0
- package/dist/serv/runtime/index.d.ts +8 -0
- package/dist/serv/runtime/index.d.ts.map +1 -0
- package/dist/serv/runtime/index.js +10 -0
- package/dist/serv/runtime/index.js.map +1 -0
- package/dist/serv/runtime/oauth-context.d.ts +121 -0
- package/dist/serv/runtime/oauth-context.d.ts.map +1 -0
- package/dist/serv/runtime/oauth-context.js +153 -0
- package/dist/serv/runtime/oauth-context.js.map +1 -0
- package/dist/serv/session/kv-store.d.ts +54 -0
- package/dist/serv/session/kv-store.d.ts.map +1 -0
- package/dist/serv/session/kv-store.js +149 -0
- package/dist/serv/session/kv-store.js.map +1 -0
- package/dist/serv/session/store.d.ts +113 -0
- package/dist/serv/session/store.d.ts.map +1 -0
- package/dist/serv/session/store.js +284 -0
- package/dist/serv/session/store.js.map +1 -0
- package/dist/serv/types/index.d.ts +147 -0
- package/dist/serv/types/index.d.ts.map +1 -0
- package/dist/serv/types/index.js +8 -0
- package/dist/serv/types/index.js.map +1 -0
- package/dist/serv/vault/token-vault.d.ts +102 -0
- package/dist/serv/vault/token-vault.d.ts.map +1 -0
- package/dist/serv/vault/token-vault.js +177 -0
- package/dist/serv/vault/token-vault.js.map +1 -0
- package/dist/server.d.ts +173 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1622 -86
- package/dist/server.js.map +1 -1
- package/dist/shared/cli-sections.d.ts +6 -0
- package/dist/shared/cli-sections.d.ts.map +1 -0
- package/dist/shared/cli-sections.js +16 -0
- package/dist/shared/cli-sections.js.map +1 -0
- package/dist/shared/cli-utils.d.ts +81 -0
- package/dist/shared/cli-utils.d.ts.map +1 -0
- package/dist/shared/cli-utils.js +174 -0
- package/dist/shared/cli-utils.js.map +1 -0
- package/dist/shared/config-docs.d.ts +6 -0
- package/dist/shared/config-docs.d.ts.map +1 -0
- package/dist/shared/config-docs.js +6 -0
- package/dist/shared/config-docs.js.map +1 -0
- package/dist/shared/error-handler.d.ts +128 -0
- package/dist/shared/error-handler.d.ts.map +1 -0
- package/dist/shared/error-handler.js +342 -0
- package/dist/shared/error-handler.js.map +1 -0
- package/dist/shared/logger.d.ts +42 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/logger.js +123 -0
- package/dist/shared/logger.js.map +1 -0
- package/dist/shared/performance.d.ts +65 -0
- package/dist/shared/performance.d.ts.map +1 -0
- package/dist/shared/performance.js +136 -0
- package/dist/shared/performance.js.map +1 -0
- package/dist/shared/task-runner.d.ts +2 -0
- package/dist/shared/task-runner.d.ts.map +1 -0
- package/dist/shared/task-runner.js +16 -0
- package/dist/shared/task-runner.js.map +1 -0
- package/dist/shared/validation.d.ts +6 -0
- package/dist/shared/validation.d.ts.map +1 -0
- package/dist/shared/validation.js +6 -0
- package/dist/shared/validation.js.map +1 -0
- package/dist/shared-utils.d.ts +63 -0
- package/dist/shared-utils.d.ts.map +1 -0
- package/dist/shared-utils.js +123 -0
- package/dist/shared-utils.js.map +1 -0
- package/dist/template-manager.d.ts +23 -2
- package/dist/template-manager.d.ts.map +1 -1
- package/dist/template-manager.js +175 -86
- package/dist/template-manager.js.map +1 -1
- package/dist/test-client.d.ts.map +1 -1
- package/dist/test-client.js +10 -8
- package/dist/test-client.js.map +1 -1
- package/dist/test-runner.d.ts +52 -0
- package/dist/test-runner.d.ts.map +1 -0
- package/dist/test-runner.js +785 -0
- package/dist/test-runner.js.map +1 -0
- package/dist/testing.d.ts +103 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +163 -0
- package/dist/testing.js.map +1 -0
- package/dist/version-checker.d.ts.map +1 -1
- package/dist/version-checker.js +2 -2
- package/dist/version-checker.js.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/dist/watcher.d.ts +6 -3
- package/dist/watcher.d.ts.map +1 -1
- package/dist/watcher.js +49 -10
- package/dist/watcher.js.map +1 -1
- package/package.json +47 -7
- package/templates/cloudflare/worker.ts.template +381 -0
- package/templates/cloudflare/wrangler.toml.template +9 -0
- package/dist/base.d.ts +0 -58
- package/dist/base.d.ts.map +0 -1
- package/dist/base.js +0 -92
- package/dist/base.js.map +0 -1
- package/dist/dependency-manager.d.ts +0 -49
- package/dist/dependency-manager.d.ts.map +0 -1
- package/dist/dependency-manager.js +0 -165
- package/dist/dependency-manager.js.map +0 -1
- package/dist/registry-manager.d.ts +0 -76
- package/dist/registry-manager.d.ts.map +0 -1
- package/dist/registry-manager.js +0 -220
- package/dist/registry-manager.js.map +0 -1
- package/dist/schema-extractor.d.ts +0 -110
- package/dist/schema-extractor.d.ts.map +0 -1
- package/dist/schema-extractor.js +0 -727
- package/dist/schema-extractor.js.map +0 -1
- package/dist/test-marketplace-sources.d.ts +0 -5
- package/dist/test-marketplace-sources.d.ts.map +0 -1
- package/dist/test-marketplace-sources.js +0 -53
- package/dist/test-marketplace-sources.js.map +0 -1
- package/dist/types.d.ts +0 -109
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -12
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-ui.js","sourceRoot":"","sources":["../../../src/auto-ui/design-system/transaction-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAuDH,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,UAAU,sBAAsB;IACpC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAooBR,CAAC;AACF,CAAC;AAED,gFAAgF;AAChF,4CAA4C;AAC5C,gFAAgF;AAEhF,MAAM,UAAU,qBAAqB;IACnC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0TR,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Photon Beam</title>
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
+
<link
|
|
11
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap"
|
|
12
|
+
rel="stylesheet">
|
|
13
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
|
|
14
|
+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
15
|
+
<!-- Prism.js for syntax highlighting -->
|
|
16
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.min.js"></script>
|
|
17
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-typescript.min.js"></script>
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-javascript.min.js"></script>
|
|
19
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-json.min.js"></script>
|
|
20
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-python.min.js"></script>
|
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.min.js"></script>
|
|
22
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-css.min.js"></script>
|
|
23
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-sql.min.js"></script>
|
|
24
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-yaml.min.js"></script>
|
|
25
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markdown.min.js"></script>
|
|
26
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-rust.min.js"></script>
|
|
27
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-go.min.js"></script>
|
|
28
|
+
<style>
|
|
29
|
+
body,
|
|
30
|
+
html {
|
|
31
|
+
margin: 0;
|
|
32
|
+
padding: 0;
|
|
33
|
+
height: 100%;
|
|
34
|
+
width: 100%;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
background: #1a1b26;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Prism.js Dark Theme (One Dark inspired) */
|
|
40
|
+
code[class*="language-"],
|
|
41
|
+
pre[class*="language-"] {
|
|
42
|
+
color: #abb2bf;
|
|
43
|
+
text-shadow: none;
|
|
44
|
+
}
|
|
45
|
+
.token.comment,
|
|
46
|
+
.token.prolog,
|
|
47
|
+
.token.doctype,
|
|
48
|
+
.token.cdata { color: #5c6370; font-style: italic; }
|
|
49
|
+
.token.punctuation { color: #abb2bf; }
|
|
50
|
+
.token.property,
|
|
51
|
+
.token.tag,
|
|
52
|
+
.token.boolean,
|
|
53
|
+
.token.number,
|
|
54
|
+
.token.constant,
|
|
55
|
+
.token.symbol,
|
|
56
|
+
.token.deleted { color: #e06c75; }
|
|
57
|
+
.token.selector,
|
|
58
|
+
.token.attr-name,
|
|
59
|
+
.token.string,
|
|
60
|
+
.token.char,
|
|
61
|
+
.token.builtin,
|
|
62
|
+
.token.inserted { color: #98c379; }
|
|
63
|
+
.token.operator,
|
|
64
|
+
.token.entity,
|
|
65
|
+
.token.url,
|
|
66
|
+
.language-css .token.string,
|
|
67
|
+
.style .token.string { color: #56b6c2; }
|
|
68
|
+
.token.atrule,
|
|
69
|
+
.token.attr-value,
|
|
70
|
+
.token.keyword { color: #c678dd; }
|
|
71
|
+
.token.function,
|
|
72
|
+
.token.class-name { color: #61afef; }
|
|
73
|
+
.token.regex,
|
|
74
|
+
.token.important,
|
|
75
|
+
.token.variable { color: #d19a66; }
|
|
76
|
+
</style>
|
|
77
|
+
</head>
|
|
78
|
+
|
|
79
|
+
<body>
|
|
80
|
+
<beam-app></beam-app>
|
|
81
|
+
<script src="/beam.bundle.js" type="module"></script>
|
|
82
|
+
</body>
|
|
83
|
+
|
|
84
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-UI System for Photon Runtime
|
|
3
|
+
*
|
|
4
|
+
* Automatically generates UI components based on method return types and docblock hints.
|
|
5
|
+
* Supports MCP, ChatGPT Actions, and custom rendering.
|
|
6
|
+
*/
|
|
7
|
+
export { AutoUIRenderer } from './renderer';
|
|
8
|
+
export { ComponentRegistry } from './registry';
|
|
9
|
+
export { ProgressIndicator } from './components/progress';
|
|
10
|
+
export { TableComponent } from './components/table';
|
|
11
|
+
export { TreeComponent } from './components/tree';
|
|
12
|
+
export { FormComponent } from './components/form';
|
|
13
|
+
export { CardComponent } from './components/card';
|
|
14
|
+
export { ListComponent } from './components/list';
|
|
15
|
+
export { startBeam } from './beam';
|
|
16
|
+
export * from './types';
|
|
17
|
+
export { createPhotonBridge, generateBridgeLoaderScript, type PhotonBridge, type EmitEvent, type ProgressEvent, type StatusEvent, type StreamEvent, type AskEvent, type AskTextEvent, type AskConfirmEvent, type AskSelectEvent, type AskNumberEvent, type PhotonContext, type HostToUIMessage, type UIToHostMessage, } from './photon-bridge';
|
|
18
|
+
export { PhotonHost, createHostOutputHandler, createHostInputProvider, type PhotonHostOptions, } from './photon-host';
|
|
19
|
+
export { generatePlatformBridgeScript, createMcpAppsInitialize, createThemeChangeMessages, type PlatformContext, type McpAppsInitialize, type McpAppsToolInput, type McpAppsToolResult, type OpenAiApi, type OpenAiContext, } from './platform-compat';
|
|
20
|
+
export { getThemeTokens, getThemeColors, generateTokensCSS, colorsDark, colorsLight, type ThemeMode, } from './design-system/tokens';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auto-ui/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,cAAc,SAAS,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,KAAK,SAAS,GACf,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-UI System for Photon Runtime
|
|
3
|
+
*
|
|
4
|
+
* Automatically generates UI components based on method return types and docblock hints.
|
|
5
|
+
* Supports MCP, ChatGPT Actions, and custom rendering.
|
|
6
|
+
*/
|
|
7
|
+
export { AutoUIRenderer } from './renderer';
|
|
8
|
+
export { ComponentRegistry } from './registry';
|
|
9
|
+
export { ProgressIndicator } from './components/progress';
|
|
10
|
+
export { TableComponent } from './components/table';
|
|
11
|
+
export { TreeComponent } from './components/tree';
|
|
12
|
+
export { FormComponent } from './components/form';
|
|
13
|
+
export { CardComponent } from './components/card';
|
|
14
|
+
export { ListComponent } from './components/list';
|
|
15
|
+
export { startBeam } from './beam';
|
|
16
|
+
export * from './types';
|
|
17
|
+
// PhotonBridge - unified UI communication layer
|
|
18
|
+
export { createPhotonBridge, generateBridgeLoaderScript, } from './photon-bridge';
|
|
19
|
+
// PhotonHost - host-side manager for custom UI iframes
|
|
20
|
+
export { PhotonHost, createHostOutputHandler, createHostInputProvider, } from './photon-host';
|
|
21
|
+
// Platform Compatibility Layer - MCP Apps, ChatGPT Apps SDK, Claude Artifacts
|
|
22
|
+
export { generatePlatformBridgeScript, createMcpAppsInitialize, createThemeChangeMessages, } from './platform-compat';
|
|
23
|
+
// Design System with theming
|
|
24
|
+
export { getThemeTokens, getThemeColors, generateTokensCSS, colorsDark, colorsLight, } from './design-system/tokens';
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auto-ui/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,cAAc,SAAS,CAAC;AAExB,gDAAgD;AAChD,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAc3B,MAAM,iBAAiB,CAAC;AAEzB,uDAAuD;AACvD,OAAO,EACL,UAAU,EACV,uBAAuB,EACvB,uBAAuB,GAExB,MAAM,eAAe,CAAC;AAEvB,8EAA8E;AAC9E,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,GAO1B,MAAM,mBAAmB,CAAC;AAE3B,6BAA6B;AAC7B,OAAO,EACL,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,WAAW,GAEZ,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI 3.1 Spec Generator for Photon Beam
|
|
3
|
+
*
|
|
4
|
+
* Generates OpenAPI specification from Photon schemas.
|
|
5
|
+
* Uses standard OpenAPI/JSON Schema where possible,
|
|
6
|
+
* extends with x-* properties for UI-specific features.
|
|
7
|
+
*
|
|
8
|
+
* Standard Mappings:
|
|
9
|
+
* - type, minimum, maximum, enum, format, description → native JSON Schema
|
|
10
|
+
*
|
|
11
|
+
* Extensions (x-*):
|
|
12
|
+
* - x-accept: File type filter for file picker
|
|
13
|
+
* - x-output-format: Rendering format (table, list, card, tree, etc.)
|
|
14
|
+
* - x-layout-hints: Field mapping for smart rendering
|
|
15
|
+
* - x-button-label: Custom submit button text
|
|
16
|
+
* - x-icon: Method/field icon
|
|
17
|
+
* - x-autorun: Auto-execute on selection
|
|
18
|
+
*/
|
|
19
|
+
interface OpenAPIDocument {
|
|
20
|
+
openapi: '3.1.0';
|
|
21
|
+
info: {
|
|
22
|
+
title: string;
|
|
23
|
+
version: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
};
|
|
26
|
+
servers?: Array<{
|
|
27
|
+
url: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
}>;
|
|
30
|
+
tags?: Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}>;
|
|
35
|
+
paths: Record<string, any>;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
38
|
+
interface MethodInfo {
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
icon?: string;
|
|
42
|
+
params: any;
|
|
43
|
+
returns: any;
|
|
44
|
+
autorun?: boolean;
|
|
45
|
+
outputFormat?: string;
|
|
46
|
+
layoutHints?: Record<string, string>;
|
|
47
|
+
buttonLabel?: string;
|
|
48
|
+
linkedUi?: string;
|
|
49
|
+
}
|
|
50
|
+
interface PhotonInfo {
|
|
51
|
+
name: string;
|
|
52
|
+
path: string;
|
|
53
|
+
configured: boolean;
|
|
54
|
+
methods?: MethodInfo[];
|
|
55
|
+
isApp?: boolean;
|
|
56
|
+
requiredParams?: Array<{
|
|
57
|
+
name: string;
|
|
58
|
+
envVar: string;
|
|
59
|
+
type: string;
|
|
60
|
+
isOptional: boolean;
|
|
61
|
+
hasDefault: boolean;
|
|
62
|
+
defaultValue?: any;
|
|
63
|
+
}>;
|
|
64
|
+
errorMessage?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Generate OpenAPI 3.1 specification from Photon schemas
|
|
68
|
+
*/
|
|
69
|
+
export declare function generateOpenAPISpec(photons: PhotonInfo[], serverUrl?: string): OpenAPIDocument;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=openapi-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-generator.d.ts","sourceRoot":"","sources":["../../src/auto-ui/openapi-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAC;IACzE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,KAAK,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,OAAO,CAAC;QACpB,YAAY,CAAC,EAAE,GAAG,CAAC;KACpB,CAAC,CAAC;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,UAAU,EAAE,EACrB,SAAS,GAAE,MAAgC,GAC1C,eAAe,CA2HjB"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI 3.1 Spec Generator for Photon Beam
|
|
3
|
+
*
|
|
4
|
+
* Generates OpenAPI specification from Photon schemas.
|
|
5
|
+
* Uses standard OpenAPI/JSON Schema where possible,
|
|
6
|
+
* extends with x-* properties for UI-specific features.
|
|
7
|
+
*
|
|
8
|
+
* Standard Mappings:
|
|
9
|
+
* - type, minimum, maximum, enum, format, description → native JSON Schema
|
|
10
|
+
*
|
|
11
|
+
* Extensions (x-*):
|
|
12
|
+
* - x-accept: File type filter for file picker
|
|
13
|
+
* - x-output-format: Rendering format (table, list, card, tree, etc.)
|
|
14
|
+
* - x-layout-hints: Field mapping for smart rendering
|
|
15
|
+
* - x-button-label: Custom submit button text
|
|
16
|
+
* - x-icon: Method/field icon
|
|
17
|
+
* - x-autorun: Auto-execute on selection
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Generate OpenAPI 3.1 specification from Photon schemas
|
|
21
|
+
*/
|
|
22
|
+
export function generateOpenAPISpec(photons, serverUrl = 'http://localhost:3000' // dev-only default, caller provides actual URL
|
|
23
|
+
) {
|
|
24
|
+
const paths = {};
|
|
25
|
+
const tags = [];
|
|
26
|
+
// Only include configured photons with methods
|
|
27
|
+
const configuredPhotons = photons.filter((p) => p.configured && Array.isArray(p.methods) && p.methods.length > 0);
|
|
28
|
+
for (const photon of configuredPhotons) {
|
|
29
|
+
// Add tag for photon
|
|
30
|
+
tags.push({
|
|
31
|
+
name: photon.name,
|
|
32
|
+
description: `Methods from ${photon.name} photon`,
|
|
33
|
+
...(photon.isApp && { 'x-app': true }),
|
|
34
|
+
});
|
|
35
|
+
for (const method of photon.methods) {
|
|
36
|
+
const operationId = `${photon.name}_${method.name}`;
|
|
37
|
+
const path = `/photon/${photon.name}/${method.name}`;
|
|
38
|
+
// Convert params schema to OpenAPI request body
|
|
39
|
+
const requestSchema = convertToOpenAPISchema(method.params);
|
|
40
|
+
// Build operation object
|
|
41
|
+
const operation = {
|
|
42
|
+
operationId,
|
|
43
|
+
summary: method.description || `Execute ${method.name}`,
|
|
44
|
+
tags: [photon.name],
|
|
45
|
+
requestBody: hasProperties(method.params)
|
|
46
|
+
? {
|
|
47
|
+
required: true,
|
|
48
|
+
content: {
|
|
49
|
+
'application/json': {
|
|
50
|
+
schema: requestSchema,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
: undefined,
|
|
55
|
+
responses: {
|
|
56
|
+
'200': {
|
|
57
|
+
description: 'Successful execution',
|
|
58
|
+
content: {
|
|
59
|
+
'application/json': {
|
|
60
|
+
schema: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
result: method.returns || { type: 'object' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
'400': {
|
|
70
|
+
description: 'Invalid parameters',
|
|
71
|
+
content: {
|
|
72
|
+
'application/json': {
|
|
73
|
+
schema: {
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
error: { type: 'string' },
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
// Add extensions for UI features
|
|
85
|
+
if (method.icon) {
|
|
86
|
+
operation['x-icon'] = method.icon;
|
|
87
|
+
}
|
|
88
|
+
if (method.autorun) {
|
|
89
|
+
operation['x-autorun'] = true;
|
|
90
|
+
}
|
|
91
|
+
if (method.outputFormat) {
|
|
92
|
+
operation['x-output-format'] = method.outputFormat;
|
|
93
|
+
}
|
|
94
|
+
if (method.layoutHints && Object.keys(method.layoutHints).length > 0) {
|
|
95
|
+
operation['x-layout-hints'] = method.layoutHints;
|
|
96
|
+
}
|
|
97
|
+
if (method.buttonLabel) {
|
|
98
|
+
operation['x-button-label'] = method.buttonLabel;
|
|
99
|
+
}
|
|
100
|
+
paths[path] = {
|
|
101
|
+
post: operation,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Add unconfigured photons as x-unconfigured extension
|
|
106
|
+
const unconfiguredPhotons = photons.filter((p) => !p.configured);
|
|
107
|
+
const spec = {
|
|
108
|
+
openapi: '3.1.0',
|
|
109
|
+
info: {
|
|
110
|
+
title: 'Photon Beam API',
|
|
111
|
+
version: '1.0.0',
|
|
112
|
+
description: 'Auto-generated OpenAPI specification for Photon methods. Supports standard JSON Schema with UI extensions.',
|
|
113
|
+
},
|
|
114
|
+
servers: [
|
|
115
|
+
{
|
|
116
|
+
url: serverUrl,
|
|
117
|
+
description: 'Local Beam server',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
tags,
|
|
121
|
+
paths,
|
|
122
|
+
};
|
|
123
|
+
// Add unconfigured photons info as extension
|
|
124
|
+
if (unconfiguredPhotons.length > 0) {
|
|
125
|
+
spec['x-unconfigured-photons'] = unconfiguredPhotons.map((p) => ({
|
|
126
|
+
name: p.name,
|
|
127
|
+
requiredParams: p.requiredParams,
|
|
128
|
+
errorMessage: p.errorMessage,
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
return spec;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Convert internal JSON Schema to OpenAPI 3.1 compatible schema
|
|
135
|
+
* Maps custom properties to standard or x-* extensions
|
|
136
|
+
*/
|
|
137
|
+
function convertToOpenAPISchema(schema) {
|
|
138
|
+
if (!schema || typeof schema !== 'object') {
|
|
139
|
+
return { type: 'object' };
|
|
140
|
+
}
|
|
141
|
+
const result = {};
|
|
142
|
+
// Copy standard JSON Schema properties
|
|
143
|
+
const standardProps = [
|
|
144
|
+
'type',
|
|
145
|
+
'properties',
|
|
146
|
+
'required',
|
|
147
|
+
'items',
|
|
148
|
+
'enum',
|
|
149
|
+
'const',
|
|
150
|
+
'default',
|
|
151
|
+
'description',
|
|
152
|
+
'minimum',
|
|
153
|
+
'maximum',
|
|
154
|
+
'minLength',
|
|
155
|
+
'maxLength',
|
|
156
|
+
'minItems',
|
|
157
|
+
'maxItems',
|
|
158
|
+
'pattern',
|
|
159
|
+
'format',
|
|
160
|
+
'allOf',
|
|
161
|
+
'anyOf',
|
|
162
|
+
'oneOf',
|
|
163
|
+
'not',
|
|
164
|
+
'$ref',
|
|
165
|
+
'title',
|
|
166
|
+
'examples',
|
|
167
|
+
'deprecated',
|
|
168
|
+
'readOnly',
|
|
169
|
+
'writeOnly',
|
|
170
|
+
'nullable',
|
|
171
|
+
'multipleOf',
|
|
172
|
+
'exclusiveMinimum',
|
|
173
|
+
'exclusiveMaximum',
|
|
174
|
+
'uniqueItems',
|
|
175
|
+
'additionalProperties',
|
|
176
|
+
];
|
|
177
|
+
for (const prop of standardProps) {
|
|
178
|
+
if (schema[prop] !== undefined) {
|
|
179
|
+
result[prop] = schema[prop];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// Map custom Photon properties to x-* extensions
|
|
183
|
+
const extensionMap = {
|
|
184
|
+
accept: 'x-accept',
|
|
185
|
+
field: 'x-field',
|
|
186
|
+
hint: 'x-hint',
|
|
187
|
+
placeholder: 'x-placeholder',
|
|
188
|
+
hidden: 'x-hidden',
|
|
189
|
+
};
|
|
190
|
+
for (const [internal, extension] of Object.entries(extensionMap)) {
|
|
191
|
+
if (schema[internal] !== undefined) {
|
|
192
|
+
result[extension] = schema[internal];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Recursively process nested properties
|
|
196
|
+
if (result.properties) {
|
|
197
|
+
result.properties = Object.fromEntries(Object.entries(result.properties).map(([key, value]) => [
|
|
198
|
+
key,
|
|
199
|
+
convertToOpenAPISchema(value),
|
|
200
|
+
]));
|
|
201
|
+
}
|
|
202
|
+
// Process array items
|
|
203
|
+
if (result.items) {
|
|
204
|
+
result.items = convertToOpenAPISchema(result.items);
|
|
205
|
+
}
|
|
206
|
+
// Process allOf/anyOf/oneOf
|
|
207
|
+
for (const combinator of ['allOf', 'anyOf', 'oneOf']) {
|
|
208
|
+
if (result[combinator]) {
|
|
209
|
+
result[combinator] = result[combinator].map((s) => convertToOpenAPISchema(s));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Check if schema has properties (i.e., expects request body)
|
|
216
|
+
*/
|
|
217
|
+
function hasProperties(schema) {
|
|
218
|
+
return (schema &&
|
|
219
|
+
typeof schema === 'object' &&
|
|
220
|
+
schema.properties &&
|
|
221
|
+
Object.keys(schema.properties).length > 0);
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=openapi-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-generator.js","sourceRoot":"","sources":["../../src/auto-ui/openapi-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA8CH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAAqB,EACrB,YAAoB,uBAAuB,CAAC,+CAA+C;;IAE3F,MAAM,KAAK,GAAwB,EAAE,CAAC;IACtC,MAAM,IAAI,GAAsE,EAAE,CAAC;IAEnF,+CAA+C;IAC/C,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CACtC,CAAC,CAAC,EAA+C,EAAE,CACjD,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CACnE,CAAC;IAEF,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE,CAAC;QACvC,qBAAqB;QACrB,IAAI,CAAC,IAAI,CAAC;YACR,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,gBAAgB,MAAM,CAAC,IAAI,SAAS;YACjD,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;SACvC,CAAC,CAAC;QAEH,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpC,MAAM,WAAW,GAAG,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YACpD,MAAM,IAAI,GAAG,WAAW,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAErD,gDAAgD;YAChD,MAAM,aAAa,GAAG,sBAAsB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAE5D,yBAAyB;YACzB,MAAM,SAA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tB,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,WAAW,CACpC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;YACtD,GAAG;YACH,sBAAsB,CAAC,KAAY,CAAC;SACrC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,sBAAsB;IACtB,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,CAAC,KAAK,GAAG,sBAAsB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,4BAA4B;IAC5B,KAAK,MAAM,UAAU,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;QACrD,IAAI,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YACvB,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;QACrF,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,MAAW;IAChC,OAAO,CACL,MAAM;QACN,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,CAAC,UAAU;QACjB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PhotonBridge - Unified UI Communication Layer
|
|
3
|
+
*
|
|
4
|
+
* Provides a standardized API for custom UIs to communicate with Photon servers.
|
|
5
|
+
* Compatible with OpenAI Apps SDK patterns and MCP Apps (SEP-1865) proposal.
|
|
6
|
+
*
|
|
7
|
+
* Usage in custom UI (iframe):
|
|
8
|
+
* window.photon.onProgress((data) => updateProgressBar(data.value));
|
|
9
|
+
* window.photon.onElicitation(async (ask) => showMyDialog(ask));
|
|
10
|
+
*
|
|
11
|
+
* @see https://developers.openai.com/apps-sdk/build/chatgpt-ui/
|
|
12
|
+
* @see https://blog.modelcontextprotocol.io/posts/2025-11-21-mcp-apps/
|
|
13
|
+
*/
|
|
14
|
+
export interface ProgressEvent {
|
|
15
|
+
emit: 'progress';
|
|
16
|
+
value: number;
|
|
17
|
+
message?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface StatusEvent {
|
|
20
|
+
emit: 'status';
|
|
21
|
+
message: string;
|
|
22
|
+
}
|
|
23
|
+
export interface StreamEvent {
|
|
24
|
+
emit: 'stream';
|
|
25
|
+
data: any;
|
|
26
|
+
}
|
|
27
|
+
export type EmitEvent = ProgressEvent | StatusEvent | StreamEvent;
|
|
28
|
+
export interface AskTextEvent {
|
|
29
|
+
ask: 'text' | 'password';
|
|
30
|
+
message: string;
|
|
31
|
+
default?: string;
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface AskConfirmEvent {
|
|
35
|
+
ask: 'confirm';
|
|
36
|
+
message: string;
|
|
37
|
+
default?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface AskSelectEvent {
|
|
40
|
+
ask: 'select';
|
|
41
|
+
message: string;
|
|
42
|
+
options: Array<string | {
|
|
43
|
+
value: string;
|
|
44
|
+
label: string;
|
|
45
|
+
}>;
|
|
46
|
+
default?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AskNumberEvent {
|
|
49
|
+
ask: 'number';
|
|
50
|
+
message: string;
|
|
51
|
+
min?: number;
|
|
52
|
+
max?: number;
|
|
53
|
+
step?: number;
|
|
54
|
+
default?: number;
|
|
55
|
+
}
|
|
56
|
+
export type AskEvent = AskTextEvent | AskConfirmEvent | AskSelectEvent | AskNumberEvent;
|
|
57
|
+
export interface PhotonContext {
|
|
58
|
+
theme: 'light' | 'dark';
|
|
59
|
+
locale: string;
|
|
60
|
+
photon: string;
|
|
61
|
+
method: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* PhotonBridge API - injected as window.photon in custom UI iframes
|
|
65
|
+
*/
|
|
66
|
+
export interface PhotonBridge {
|
|
67
|
+
/** Arguments supplied when the tool was invoked */
|
|
68
|
+
toolInput: Record<string, any>;
|
|
69
|
+
/** Structured content returned by the tool (available after completion) */
|
|
70
|
+
toolOutput: any;
|
|
71
|
+
/** Snapshot of UI state persisted between renders */
|
|
72
|
+
widgetState: any;
|
|
73
|
+
/** Synchronously store state snapshot after UI interactions */
|
|
74
|
+
setWidgetState(state: any): void;
|
|
75
|
+
/** Subscribe to progress updates (0-1 value with optional message) */
|
|
76
|
+
onProgress(callback: (event: ProgressEvent) => void): () => void;
|
|
77
|
+
/** Subscribe to status messages (spinner/indeterminate progress) */
|
|
78
|
+
onStatus(callback: (event: StatusEvent) => void): () => void;
|
|
79
|
+
/** Subscribe to stream data chunks */
|
|
80
|
+
onStream(callback: (event: StreamEvent) => void): () => void;
|
|
81
|
+
/** Subscribe to any emit event */
|
|
82
|
+
onEmit(callback: (event: EmitEvent) => void): () => void;
|
|
83
|
+
/**
|
|
84
|
+
* Handle elicitation requests from the server
|
|
85
|
+
* Return a promise that resolves with the user's response
|
|
86
|
+
*/
|
|
87
|
+
onElicitation(handler: (ask: AskEvent) => Promise<any>): () => void;
|
|
88
|
+
/** Subscribe to result (tool completion) */
|
|
89
|
+
onResult(callback: (result: any) => void): () => void;
|
|
90
|
+
/** Subscribe to errors */
|
|
91
|
+
onError(callback: (error: {
|
|
92
|
+
message: string;
|
|
93
|
+
code?: string;
|
|
94
|
+
}) => void): () => void;
|
|
95
|
+
/** Invoke another tool on the same photon */
|
|
96
|
+
callTool(toolName: string, args: Record<string, any>): Promise<any>;
|
|
97
|
+
/** Alias for callTool - invoke another tool on the same photon */
|
|
98
|
+
invoke(toolName: string, args: Record<string, any>): Promise<any>;
|
|
99
|
+
/** Send a follow-up message (for conversational UIs) */
|
|
100
|
+
sendFollowUpMessage(message: string): Promise<void>;
|
|
101
|
+
/** Current theme */
|
|
102
|
+
theme: 'light' | 'dark';
|
|
103
|
+
/** User locale */
|
|
104
|
+
locale: string;
|
|
105
|
+
/** Current photon name */
|
|
106
|
+
photon: string;
|
|
107
|
+
/** Current method being executed */
|
|
108
|
+
method: string;
|
|
109
|
+
/** Check if running inside ChatGPT (has window.openai) */
|
|
110
|
+
isChatGPT: boolean;
|
|
111
|
+
}
|
|
112
|
+
export type HostToUIMessage = {
|
|
113
|
+
type: 'photon:init';
|
|
114
|
+
context: PhotonContext;
|
|
115
|
+
toolInput: Record<string, any>;
|
|
116
|
+
} | {
|
|
117
|
+
type: 'photon:emit';
|
|
118
|
+
event: EmitEvent;
|
|
119
|
+
} | {
|
|
120
|
+
type: 'photon:ask';
|
|
121
|
+
id: string;
|
|
122
|
+
event: AskEvent;
|
|
123
|
+
} | {
|
|
124
|
+
type: 'photon:result';
|
|
125
|
+
data: any;
|
|
126
|
+
} | {
|
|
127
|
+
type: 'photon:error';
|
|
128
|
+
error: {
|
|
129
|
+
message: string;
|
|
130
|
+
code?: string;
|
|
131
|
+
};
|
|
132
|
+
} | {
|
|
133
|
+
type: 'photon:context';
|
|
134
|
+
context: Partial<PhotonContext>;
|
|
135
|
+
};
|
|
136
|
+
export type UIToHostMessage = {
|
|
137
|
+
type: 'photon:ready';
|
|
138
|
+
} | {
|
|
139
|
+
type: 'photon:ask-response';
|
|
140
|
+
id: string;
|
|
141
|
+
value: any;
|
|
142
|
+
} | {
|
|
143
|
+
type: 'photon:set-state';
|
|
144
|
+
state: any;
|
|
145
|
+
} | {
|
|
146
|
+
type: 'photon:follow-up';
|
|
147
|
+
message: string;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Create the PhotonBridge instance for use in custom UI iframes.
|
|
151
|
+
* This is injected as window.photon by the PhotonBridgeLoader script.
|
|
152
|
+
*/
|
|
153
|
+
export declare function createPhotonBridge(): PhotonBridge;
|
|
154
|
+
/**
|
|
155
|
+
* Generate the script that should be injected into custom UI HTML.
|
|
156
|
+
* This creates window.photon with the full bridge API.
|
|
157
|
+
*/
|
|
158
|
+
export declare function generateBridgeLoaderScript(): string;
|
|
159
|
+
//# sourceMappingURL=photon-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photon-bridge.d.ts","sourceRoot":"","sources":["../../src/auto-ui/photon-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgBH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,SAAS,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,EAAE,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