@modularizer/plat 0.16.1 → 0.17.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 (108) hide show
  1. package/README.md +28 -0
  2. package/dist/args/index.d.ts +2 -1
  3. package/dist/args/index.d.ts.map +1 -1
  4. package/dist/args/index.js +1 -0
  5. package/dist/args/index.js.map +1 -1
  6. package/dist/args/method_name.d.ts +27 -0
  7. package/dist/args/method_name.d.ts.map +1 -0
  8. package/dist/args/method_name.js +52 -0
  9. package/dist/args/method_name.js.map +1 -0
  10. package/dist/args/validate.d.ts +1 -1
  11. package/dist/args/z2.d.ts +2 -2
  12. package/dist/bridge/http-forwarder.d.ts +2 -2
  13. package/dist/bridge/index.d.ts +3 -3
  14. package/dist/cli/commands/api-proxy.d.ts.map +1 -1
  15. package/dist/cli/commands/api-proxy.js +23 -2
  16. package/dist/cli/commands/api-proxy.js.map +1 -1
  17. package/dist/cli/core.d.ts +103 -0
  18. package/dist/cli/core.d.ts.map +1 -0
  19. package/dist/cli/core.js +177 -0
  20. package/dist/cli/core.js.map +1 -0
  21. package/dist/cli/format.d.ts +13 -0
  22. package/dist/cli/format.d.ts.map +1 -0
  23. package/dist/cli/format.js +160 -0
  24. package/dist/cli/format.js.map +1 -0
  25. package/dist/cli/http.d.ts +25 -0
  26. package/dist/cli/http.d.ts.map +1 -0
  27. package/dist/cli/http.js +56 -0
  28. package/dist/cli/http.js.map +1 -0
  29. package/dist/cli/index.d.ts +10 -10
  30. package/dist/cli/proxy.d.ts +2 -2
  31. package/dist/cli/runtime.d.ts +9 -2
  32. package/dist/cli/runtime.d.ts.map +1 -1
  33. package/dist/cli/runtime.js +24 -275
  34. package/dist/cli/runtime.js.map +1 -1
  35. package/dist/cli-bin.d.ts +3 -0
  36. package/dist/cli-bin.d.ts.map +1 -0
  37. package/dist/cli-bin.js +21 -0
  38. package/dist/cli-bin.js.map +1 -0
  39. package/dist/cli-entry.d.ts +5 -0
  40. package/dist/cli-entry.d.ts.map +1 -0
  41. package/dist/cli-entry.js +6 -0
  42. package/dist/cli-entry.js.map +1 -0
  43. package/dist/client/css-transport-plugin.d.ts +4 -4
  44. package/dist/client/file-transport-plugin.d.ts +1 -1
  45. package/dist/client/http-transport-plugin.d.ts +3 -3
  46. package/dist/client/index.d.ts +6 -6
  47. package/dist/client/openapi-client.d.ts +7 -7
  48. package/dist/client/proxy.d.ts +2 -2
  49. package/dist/client/request-builder.d.ts +2 -2
  50. package/dist/client/rpc-transport-plugin.d.ts +2 -2
  51. package/dist/client/tools.d.ts +1 -1
  52. package/dist/client/transport-plugin.d.ts +4 -4
  53. package/dist/client-entry.d.ts +29 -29
  54. package/dist/client-server-entry.d.ts +19 -19
  55. package/dist/client-side-python/runtime.d.ts +3 -3
  56. package/dist/client-side-server/bootstrap.d.ts +1 -1
  57. package/dist/client-side-server/channel.d.ts +1 -1
  58. package/dist/client-side-server/mqtt-webrtc.d.ts +5 -5
  59. package/dist/client-side-server/plat-bridge.d.ts +1 -1
  60. package/dist/client-side-server/plat-fetch.d.ts +2 -2
  61. package/dist/client-side-server/plat-service-worker-client.d.ts +1 -1
  62. package/dist/client-side-server/plat-service-worker.d.ts +1 -1
  63. package/dist/client-side-server/protocol.d.ts +2 -2
  64. package/dist/client-side-server/runtime.d.ts +5 -5
  65. package/dist/client-side-server/server.d.ts +8 -8
  66. package/dist/client-side-server/server.js +1 -1
  67. package/dist/client-side-server/worker-pool.d.ts +3 -3
  68. package/dist/index.d.ts +7 -7
  69. package/dist/python-browser-entry.d.ts +1 -1
  70. package/dist/server/auth/index.d.ts +1 -1
  71. package/dist/server/auth/jwt.d.ts +1 -1
  72. package/dist/server/authority-server.d.ts +1 -1
  73. package/dist/server/cache/index.d.ts +1 -1
  74. package/dist/server/cache/utils.d.ts +1 -1
  75. package/dist/server/config/bucket.d.ts +1 -1
  76. package/dist/server/config/defaults.d.ts +1 -1
  77. package/dist/server/config/index.d.ts +4 -4
  78. package/dist/server/config/logger.d.ts +1 -1
  79. package/dist/server/config/types.d.ts +6 -6
  80. package/dist/server/core.d.ts +3 -3
  81. package/dist/server/file-queue-protocol-plugin.d.ts +2 -2
  82. package/dist/server/help.d.ts +1 -1
  83. package/dist/server/index.d.ts +17 -17
  84. package/dist/server/operation-registry.d.ts +1 -1
  85. package/dist/server/protocol-plugin.d.ts +3 -3
  86. package/dist/server/rate-limit/index.d.ts +1 -1
  87. package/dist/server/rate-limit/utils.d.ts +1 -1
  88. package/dist/server/rpc-protocol-plugin.d.ts +1 -1
  89. package/dist/server/server.d.ts +2 -2
  90. package/dist/server/server.js +1 -1
  91. package/dist/server/token-limit/index.d.ts +1 -1
  92. package/dist/server/token-limit/utils.d.ts +1 -1
  93. package/dist/server/tools.d.ts +2 -2
  94. package/dist/server/transports.d.ts +1 -1
  95. package/dist/server/webrtc-plugin.d.ts +3 -3
  96. package/dist/server/websocket-plugin.d.ts +1 -1
  97. package/dist/shared/tools.d.ts +1 -1
  98. package/dist/spec/decorators.d.ts +3 -3
  99. package/dist/spec/index.d.ts +2 -2
  100. package/dist/spec/metadata.d.ts +1 -1
  101. package/dist/static/index.d.ts +5 -5
  102. package/dist/static/plat-static-folders.d.ts +1 -1
  103. package/dist/static/static-folder.d.ts +2 -2
  104. package/dist/types/client.d.ts +3 -3
  105. package/dist/types/endpoints.d.ts +2 -2
  106. package/dist/types/errors.d.ts +1 -1
  107. package/dist/types/index.d.ts +8 -8
  108. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import type { RouteMeta } from '../types';
2
+ import type { RouteMeta } from '../types/index.js';
3
3
  /**
4
4
  * Check if a query parameter should trigger help mode
5
5
  * Returns true if help parameter is present with a truthy value or without a value
@@ -11,21 +11,21 @@
11
11
  * - Auth decorator system with pluggable handlers
12
12
  * - Rate limiting, token limiting, and caching plugins
13
13
  */
14
- export * from './server';
15
- export * from './core';
16
- export * from './operation-registry';
17
- export * from './transports';
18
- export * from './protocol-plugin';
19
- export * from './websocket-plugin';
20
- export * from './param-aliases';
21
- export * from './routing';
22
- export * from './tools';
23
- export * from './cache';
24
- export * from './rate-limit';
25
- export * from './token-limit';
26
- export * from './auth';
27
- export * from './authority-server';
28
- export * from './help';
29
- export * from './env';
30
- export * from './config/bucket';
14
+ export * from './server.js';
15
+ export * from './core.js';
16
+ export * from './operation-registry.js';
17
+ export * from './transports.js';
18
+ export * from './protocol-plugin.js';
19
+ export * from './websocket-plugin.js';
20
+ export * from './param-aliases.js';
21
+ export * from './routing.js';
22
+ export * from './tools.js';
23
+ export * from './cache/index.js';
24
+ export * from './rate-limit/index.js';
25
+ export * from './token-limit/index.js';
26
+ export * from './auth/index.js';
27
+ export * from './authority-server.js';
28
+ export * from './help.js';
29
+ export * from './env.js';
30
+ export * from './config/bucket.js';
31
31
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { PLATServerCallEnvelope, PLATServerResolvedOperation } from './transports';
1
+ import type { PLATServerCallEnvelope, PLATServerResolvedOperation } from './transports.js';
2
2
  export declare class PLATOperationRegistry {
3
3
  private operationsById;
4
4
  private operationsByRoute;
@@ -1,6 +1,6 @@
1
- import type { Logger } from './config/logger';
2
- import type { PLATServerCallEnvelope, PLATServerResolvedOperation } from './transports';
3
- import type { RouteContext } from '../types';
1
+ import type { Logger } from './config/logger.js';
2
+ import type { PLATServerCallEnvelope, PLATServerResolvedOperation } from './transports.js';
3
+ import type { RouteContext } from '../types/index.js';
4
4
  export interface PLATServerConnectionRequest {
5
5
  protocol: string;
6
6
  meta?: Record<string, unknown>;
@@ -1,2 +1,2 @@
1
- export * from './utils';
1
+ export * from './utils.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { RateLimitController, RateLimitMeta, RateLimitConfigs, ResolvedRateLimitEntry } from '../../types/plugins';
1
+ import { RateLimitController, RateLimitMeta, RateLimitConfigs, ResolvedRateLimitEntry } from '../../types/plugins.js';
2
2
  /**
3
3
  * Resolve rate limit key with substitutions:
4
4
  * - :route → methodName
@@ -1,4 +1,4 @@
1
- import type { PLATServerHostContext, PLATServerProtocolPlugin } from './protocol-plugin';
1
+ import type { PLATServerHostContext, PLATServerProtocolPlugin } from './protocol-plugin.js';
2
2
  export interface RpcProtocolPluginOptions {
3
3
  /** true, false, or a custom path like '/ws' */
4
4
  enabled: boolean | string;
@@ -1,6 +1,6 @@
1
1
  import { Express } from "express";
2
- import { PLATServerOptions } from "./config";
3
- import type { PLATServerTransportRuntime } from './protocol-plugin';
2
+ import { PLATServerOptions } from "./config/index.js";
3
+ import type { PLATServerTransportRuntime } from './protocol-plugin.js';
4
4
  export declare class PLATServer {
5
5
  private app;
6
6
  private options;
@@ -1201,7 +1201,7 @@ export class PLATServer {
1201
1201
  openapi: '3.1.0',
1202
1202
  info: {
1203
1203
  title: 'plat API',
1204
- version: '0.16.1',
1204
+ version: '0.17.0',
1205
1205
  },
1206
1206
  paths,
1207
1207
  };
@@ -1,2 +1,2 @@
1
- export * from './utils';
1
+ export * from './utils.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { TokenLimitController, TokenLimitEntry, TokenLimitMeta, TokenLimitTiming, TokenLimitConfigs, ResolvedTokenLimitEntry } from '../../types/plugins';
1
+ import { TokenLimitController, TokenLimitEntry, TokenLimitMeta, TokenLimitTiming, TokenLimitConfigs, ResolvedTokenLimitEntry } from '../../types/plugins.js';
2
2
  /**
3
3
  * Resolve token limit key with substitutions:
4
4
  * - :route → methodName
@@ -5,8 +5,8 @@
5
5
  * Supports multiple formats: Anthropic (Claude), OpenAI, generic JSON Schema
6
6
  */
7
7
  import { ZodSchema } from 'zod';
8
- import type { ToolDefinition, ToolFormat, AnthropicTool, OpenAITool } from '../types/tools';
9
- import { buildInputSchemaFromOpenAPIOperation, buildResponseSchemaFromOpenAPIOperation, emptyInputSchema, normalizeInputSchema, toolDefinitionFromOpenAPIOperation, type ToolDefinitionInit } from '../shared/tools';
8
+ import type { ToolDefinition, ToolFormat, AnthropicTool, OpenAITool } from '../types/tools.js';
9
+ import { buildInputSchemaFromOpenAPIOperation, buildResponseSchemaFromOpenAPIOperation, emptyInputSchema, normalizeInputSchema, toolDefinitionFromOpenAPIOperation, type ToolDefinitionInit } from '../shared/tools.js';
10
10
  /**
11
11
  * Convert a Zod schema to JSON Schema
12
12
  */
@@ -1,4 +1,4 @@
1
- import type { RouteContext } from '../types';
1
+ import type { RouteContext } from '../types/index.js';
2
2
  export interface PLATServerResolvedOperation {
3
3
  method: string;
4
4
  path: string;
@@ -1,6 +1,6 @@
1
- import { type ClientSideServerMQTTWebRTCOptions, type ClientSideServerWorkerInfo } from '../client-side-server/mqtt-webrtc';
2
- import { type ClientSideServerInstanceInfo } from '../client-side-server/protocol';
3
- import type { PLATServerProtocolPlugin } from './protocol-plugin';
1
+ import { type ClientSideServerMQTTWebRTCOptions, type ClientSideServerWorkerInfo } from '../client-side-server/mqtt-webrtc.js';
2
+ import { type ClientSideServerInstanceInfo } from '../client-side-server/protocol.js';
3
+ import type { PLATServerProtocolPlugin } from './protocol-plugin.js';
4
4
  export interface PLATServerWebRTCOptions extends ClientSideServerMQTTWebRTCOptions {
5
5
  /** css:// name this server is reachable at (e.g. "dmz/my-api" or "authority.com/my-api"). */
6
6
  name: string;
@@ -1,5 +1,5 @@
1
1
  import { WebSocket } from 'ws';
2
- import type { PLATServerProtocolPlugin } from './protocol-plugin';
2
+ import type { PLATServerProtocolPlugin } from './protocol-plugin.js';
3
3
  export interface WebSocketSession {
4
4
  ws: WebSocket;
5
5
  path: string;
@@ -1,4 +1,4 @@
1
- import type { ToolDefinition } from '../types/tools';
1
+ import type { ToolDefinition } from '../types/tools.js';
2
2
  export interface ToolDefinitionInit {
3
3
  name: string;
4
4
  summary?: string;
@@ -1,6 +1,6 @@
1
- import { HttpMethod } from "../types";
2
- import type { AuthMode } from "../types/endpoints";
3
- import type { RateLimitMeta, TokenLimitMeta, CacheMeta } from "../types/plugins";
1
+ import { HttpMethod } from "../types/index.js";
2
+ import type { AuthMode } from "../types/endpoints.js";
3
+ import type { RateLimitMeta, TokenLimitMeta, CacheMeta } from "../types/plugins.js";
4
4
  export declare const ROUTE_METADATA_KEY: unique symbol;
5
5
  export interface ControllerOpts {
6
6
  tag?: string;
@@ -1,3 +1,3 @@
1
- export * from './decorators';
2
- export * from './metadata';
1
+ export * from './decorators.js';
2
+ export * from './metadata.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ControllerMeta, RouteMeta } from '../types/endpoints';
1
+ import { ControllerMeta, RouteMeta } from '../types/endpoints.js';
2
2
  export declare function getControllerMeta(ctor: Function): ControllerMeta | undefined;
3
3
  export declare function ensureControllerMeta(ctor: Function): ControllerMeta;
4
4
  export declare function ensureRouteMeta(ctor: Function, key: string | symbol): RouteMeta;
@@ -1,9 +1,9 @@
1
- export { FileResponse, isFileResponse } from './file-response';
1
+ export { FileResponse, isFileResponse } from './file-response.js';
2
2
  export type { FileResponseOpts } from './file-response';
3
- export { StaticFolder, isStaticFolder } from './static-folder';
3
+ export { StaticFolder, isStaticFolder } from './static-folder.js';
4
4
  export type { StaticFolderOpts } from './static-folder';
5
5
  export type { VirtualFileSystem, MemoryFileEntry } from './virtual-file-system';
6
- export { NodeFileSystem, MemoryFileSystem } from './virtual-file-system';
7
- export { getMimeType } from './mime-types';
8
- export { isExcluded } from './glob-match';
6
+ export { NodeFileSystem, MemoryFileSystem } from './virtual-file-system.js';
7
+ export { getMimeType } from './mime-types.js';
8
+ export { isExcluded } from './glob-match.js';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { StaticFolder } from './static-folder';
1
+ import { StaticFolder } from './static-folder.js';
2
2
  export declare function createDocsStaticFolder(options: {
3
3
  openapi: any;
4
4
  mountPoint?: string;
@@ -1,5 +1,5 @@
1
- import { FileResponse } from './file-response';
2
- import { type MemoryFileEntry, type VirtualFileSystem } from './virtual-file-system';
1
+ import { FileResponse } from './file-response.js';
2
+ import { type MemoryFileEntry, type VirtualFileSystem } from './virtual-file-system.js';
3
3
  export declare const STATIC_FOLDER_BRAND: unique symbol;
4
4
  export interface StaticFolderOpts {
5
5
  /** Gitignore-style exclude patterns */
@@ -1,6 +1,6 @@
1
- import type { ClientRouteLike } from './client-route';
2
- import { ClientError, ServerError } from "./errors";
3
- import type { PLATRPCEventKind } from "../rpc";
1
+ import type { ClientRouteLike } from './client-route.js';
2
+ import { ClientError, ServerError } from "./errors.js";
3
+ import type { PLATRPCEventKind } from "../rpc.js";
4
4
  export type ApiClass<T> = abstract new (...args: any[]) => T;
5
5
  export interface BuiltRequest {
6
6
  url: string;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { HttpMethod } from "./http";
3
- import { RateLimitMeta, TokenLimitMeta, CacheMeta, RateLimitContext, TokenLimitContext, CacheContext } from "./plugins";
2
+ import { HttpMethod } from "./http.js";
3
+ import { RateLimitMeta, TokenLimitMeta, CacheMeta, RateLimitContext, TokenLimitContext, CacheContext } from "./plugins.js";
4
4
  export type AuthMode = string;
5
5
  export interface EndpointDef {
6
6
  controller: Function;
@@ -1,4 +1,4 @@
1
- import type { ClientRouteLike } from './client-route';
1
+ import type { ClientRouteLike } from './client-route.js';
2
2
  export interface ErrorPayload {
3
3
  code?: string;
4
4
  message?: string;
@@ -1,9 +1,9 @@
1
- export * from './client-route';
2
- export * from './endpoints';
3
- export * from './errors';
4
- export * from './http';
5
- export * from './openapi';
6
- export * from './opts';
7
- export * from './plugins';
8
- export * from './tools';
1
+ export * from './client-route.js';
2
+ export * from './endpoints.js';
3
+ export * from './errors.js';
4
+ export * from './http.js';
5
+ export * from './openapi.js';
6
+ export * from './opts.js';
7
+ export * from './plugins.js';
8
+ export * from './tools.js';
9
9
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modularizer/plat",
3
- "version": "0.16.1",
3
+ "version": "0.17.0",
4
4
  "description": "Protocol and Language Agnostic Tooling Yielding Universal Semantics",
5
5
  "type": "module",
6
6
  "author": {