praetom 0.1.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 (102) hide show
  1. package/README.md +82 -0
  2. package/dist/_esm-loader.d.ts +49 -0
  3. package/dist/_esm-loader.d.ts.map +1 -0
  4. package/dist/_esm-loader.js +131 -0
  5. package/dist/_esm-loader.js.map +1 -0
  6. package/dist/_internal.d.ts +63 -0
  7. package/dist/_internal.d.ts.map +1 -0
  8. package/dist/_internal.js +357 -0
  9. package/dist/_internal.js.map +1 -0
  10. package/dist/browser.d.ts +90 -0
  11. package/dist/browser.d.ts.map +1 -0
  12. package/dist/browser.js +357 -0
  13. package/dist/browser.js.map +1 -0
  14. package/dist/cli/cli.d.ts +3 -0
  15. package/dist/cli/cli.d.ts.map +1 -0
  16. package/dist/cli/cli.js +97 -0
  17. package/dist/cli/cli.js.map +1 -0
  18. package/dist/cli/commands/discover.d.ts +3 -0
  19. package/dist/cli/commands/discover.d.ts.map +1 -0
  20. package/dist/cli/commands/discover.js +15 -0
  21. package/dist/cli/commands/discover.js.map +1 -0
  22. package/dist/cli/commands/features.d.ts +5 -0
  23. package/dist/cli/commands/features.d.ts.map +1 -0
  24. package/dist/cli/commands/features.js +83 -0
  25. package/dist/cli/commands/features.js.map +1 -0
  26. package/dist/cli/commands/init.d.ts +3 -0
  27. package/dist/cli/commands/init.d.ts.map +1 -0
  28. package/dist/cli/commands/init.js +52 -0
  29. package/dist/cli/commands/init.js.map +1 -0
  30. package/dist/cli/commands/login.d.ts +20 -0
  31. package/dist/cli/commands/login.d.ts.map +1 -0
  32. package/dist/cli/commands/login.js +138 -0
  33. package/dist/cli/commands/login.js.map +1 -0
  34. package/dist/cli/commands/logout.d.ts +3 -0
  35. package/dist/cli/commands/logout.d.ts.map +1 -0
  36. package/dist/cli/commands/logout.js +15 -0
  37. package/dist/cli/commands/logout.js.map +1 -0
  38. package/dist/cli/commands/rotate.d.ts +3 -0
  39. package/dist/cli/commands/rotate.d.ts.map +1 -0
  40. package/dist/cli/commands/rotate.js +33 -0
  41. package/dist/cli/commands/rotate.js.map +1 -0
  42. package/dist/cli/commands/status.d.ts +3 -0
  43. package/dist/cli/commands/status.d.ts.map +1 -0
  44. package/dist/cli/commands/status.js +54 -0
  45. package/dist/cli/commands/status.js.map +1 -0
  46. package/dist/cli/commands/uninstall.d.ts +3 -0
  47. package/dist/cli/commands/uninstall.d.ts.map +1 -0
  48. package/dist/cli/commands/uninstall.js +63 -0
  49. package/dist/cli/commands/uninstall.js.map +1 -0
  50. package/dist/cli/commands/usage.d.ts +3 -0
  51. package/dist/cli/commands/usage.d.ts.map +1 -0
  52. package/dist/cli/commands/usage.js +19 -0
  53. package/dist/cli/commands/usage.js.map +1 -0
  54. package/dist/cli/commands/whoami.d.ts +3 -0
  55. package/dist/cli/commands/whoami.d.ts.map +1 -0
  56. package/dist/cli/commands/whoami.js +37 -0
  57. package/dist/cli/commands/whoami.js.map +1 -0
  58. package/dist/cli/util/agent-env.d.ts +13 -0
  59. package/dist/cli/util/agent-env.d.ts.map +1 -0
  60. package/dist/cli/util/agent-env.js +28 -0
  61. package/dist/cli/util/agent-env.js.map +1 -0
  62. package/dist/cli/util/api.d.ts +36 -0
  63. package/dist/cli/util/api.d.ts.map +1 -0
  64. package/dist/cli/util/api.js +84 -0
  65. package/dist/cli/util/api.js.map +1 -0
  66. package/dist/cli/util/auth-file.d.ts +25 -0
  67. package/dist/cli/util/auth-file.d.ts.map +1 -0
  68. package/dist/cli/util/auth-file.js +74 -0
  69. package/dist/cli/util/auth-file.js.map +1 -0
  70. package/dist/cli/util/git.d.ts +28 -0
  71. package/dist/cli/util/git.d.ts.map +1 -0
  72. package/dist/cli/util/git.js +103 -0
  73. package/dist/cli/util/git.js.map +1 -0
  74. package/dist/cli/util/run.d.ts +26 -0
  75. package/dist/cli/util/run.d.ts.map +1 -0
  76. package/dist/cli/util/run.js +31 -0
  77. package/dist/cli/util/run.js.map +1 -0
  78. package/dist/edge.d.ts +34 -0
  79. package/dist/edge.d.ts.map +1 -0
  80. package/dist/edge.js +127 -0
  81. package/dist/edge.js.map +1 -0
  82. package/dist/server.d.ts +69 -0
  83. package/dist/server.d.ts.map +1 -0
  84. package/dist/server.js +193 -0
  85. package/dist/server.js.map +1 -0
  86. package/dist/vite/index.d.ts +48 -0
  87. package/dist/vite/index.d.ts.map +1 -0
  88. package/dist/vite/index.js +138 -0
  89. package/dist/vite/index.js.map +1 -0
  90. package/dist/webpack/index.d.ts +64 -0
  91. package/dist/webpack/index.d.ts.map +1 -0
  92. package/dist/webpack/index.js +106 -0
  93. package/dist/webpack/index.js.map +1 -0
  94. package/dist/webpack/loader.d.ts +27 -0
  95. package/dist/webpack/loader.d.ts.map +1 -0
  96. package/dist/webpack/loader.js +54 -0
  97. package/dist/webpack/loader.js.map +1 -0
  98. package/dist/webpack/shared.d.ts +25 -0
  99. package/dist/webpack/shared.d.ts.map +1 -0
  100. package/dist/webpack/shared.js +63 -0
  101. package/dist/webpack/shared.js.map +1 -0
  102. package/package.json +79 -0
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Webpack loader half of praetom-webpack. Called per-module by webpack
3
+ * with the file's source. We check whether the file matches a feature
4
+ * path (the plugin half sets the feature map on the loader's context)
5
+ * and rewrite the source if so.
6
+ *
7
+ * Registered by the plugin via `compiler.options.module.rules`. Not
8
+ * meant to be added manually to webpack config.
9
+ */
10
+ import type { FeatureMapEntry } from "./shared.js";
11
+ interface LoaderContext {
12
+ resource?: string;
13
+ resourcePath?: string;
14
+ rootContext?: string;
15
+ query?: {
16
+ features?: readonly FeatureMapEntry[];
17
+ };
18
+ getOptions?: () => {
19
+ features?: readonly FeatureMapEntry[];
20
+ };
21
+ async?: () => (err: Error | null, content?: string) => void;
22
+ callback?: (err: Error | null, content?: string) => void;
23
+ emitWarning?: (warning: Error) => void;
24
+ }
25
+ export default function praetomLoader(this: LoaderContext, source: string): string | void;
26
+ export {};
27
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/webpack/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;KAAE,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM;QAAE,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;KAAE,CAAC;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8CxF"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Webpack loader half of praetom-webpack. Called per-module by webpack
3
+ * with the file's source. We check whether the file matches a feature
4
+ * path (the plugin half sets the feature map on the loader's context)
5
+ * and rewrite the source if so.
6
+ *
7
+ * Registered by the plugin via `compiler.options.module.rules`. Not
8
+ * meant to be added manually to webpack config.
9
+ */
10
+ import { matchFeatureForPath, wrapModuleSource } from "./shared.js";
11
+ export default function praetomLoader(source) {
12
+ const options = typeof this.getOptions === "function" ? this.getOptions() : (this.query ?? {});
13
+ const features = options.features ?? [];
14
+ if (features.length === 0)
15
+ return source;
16
+ const resourcePath = this.resourcePath ?? this.resource ?? "";
17
+ if (!resourcePath)
18
+ return source;
19
+ if (resourcePath.includes("/node_modules/"))
20
+ return source;
21
+ // Try both rootContext-relative AND repo-root-relative. Feature paths
22
+ // from praetom are repo-root-relative (e.g. "apps/web/src/app/.../route.ts"),
23
+ // but webpack's rootContext may be a workspace subdir (e.g. apps/web).
24
+ // Match against both forms so the path attribution works regardless.
25
+ const root = this.rootContext ?? "";
26
+ const candidates = new Set();
27
+ candidates.add(resourcePath);
28
+ if (root && resourcePath.startsWith(root)) {
29
+ candidates.add(resourcePath.slice(root.length).replace(/^\//, ""));
30
+ }
31
+ // Also try stripping any monorepo root prefix — find common substrings
32
+ // like "/apps/" or "/packages/" and use what follows.
33
+ const idx = resourcePath.search(/\/(apps|packages)\//);
34
+ if (idx > 0) {
35
+ candidates.add(resourcePath.slice(idx + 1));
36
+ }
37
+ let match = null;
38
+ for (const candidate of candidates) {
39
+ match = matchFeatureForPath(features, candidate);
40
+ if (match)
41
+ break;
42
+ }
43
+ if (!match)
44
+ return source;
45
+ const wrapped = wrapModuleSource(source, match.slug, match.entrySymbol);
46
+ if (!wrapped) {
47
+ if (this.emitWarning) {
48
+ this.emitWarning(new Error(`[praetom] could not wrap ${resourcePath} (export shape not recognized; skipping)`));
49
+ }
50
+ return source;
51
+ }
52
+ return wrapped;
53
+ }
54
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/webpack/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAcpE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAsB,MAAc;IACvE,MAAM,OAAO,GACX,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CA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AAI,KAAK;YAAE,MAAM;IACnB,CAAC;IACD,IAAI,CAAC,KAAK;QAAE,OAAO,MAAM,CAAC;IAE1B,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACxE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,WAAW,CACd,IAAI,KAAK,CACP,4BAA4B,YAAY,0CAA0C,CACnF,CACF,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Shared source-rewrite logic. Identical conceptually to the regex
3
+ * transform in praetom-vite and the runtime ESM loader hook. Lives here
4
+ * because the webpack plugin needs the same transform but webpack
5
+ * exposes it through a loader function (vite uses `transform`).
6
+ */
7
+ export interface FeatureMapEntry {
8
+ slug: string;
9
+ paths: string[];
10
+ entrySymbol?: string;
11
+ }
12
+ export interface RuntimeConfigResponse {
13
+ workspaceSlug: string;
14
+ repo: string;
15
+ etag: string;
16
+ features: FeatureMapEntry[];
17
+ }
18
+ export declare function matchFeatureForPath(features: readonly FeatureMapEntry[], relPath: string): {
19
+ slug: string;
20
+ entrySymbol?: string;
21
+ } | null;
22
+ export declare function shouldWrap(name: string, entrySymbol: string | undefined): boolean;
23
+ export declare function wrapModuleSource(source: string, slug: string, entrySymbol?: string): string | null;
24
+ export declare function fetchFeatureMap(configEndpoint: string, ingestToken: string): Promise<RuntimeConfigResponse>;
25
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/webpack/shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAcD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,OAAO,EAAE,MAAM,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAO/C;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAGjF;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,GAAG,IAAI,CAkCf;AAED,wBAAsB,eAAe,CACnC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,CAAC,CAQhC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Shared source-rewrite logic. Identical conceptually to the regex
3
+ * transform in praetom-vite and the runtime ESM loader hook. Lives here
4
+ * because the webpack plugin needs the same transform but webpack
5
+ * exposes it through a loader function (vite uses `transform`).
6
+ */
7
+ const HTTP_METHODS = new Set([
8
+ "GET",
9
+ "POST",
10
+ "PUT",
11
+ "PATCH",
12
+ "DELETE",
13
+ "OPTIONS",
14
+ "HEAD",
15
+ ]);
16
+ const PRAETOM_IMPORT_MARKER = "__praetom_wrap_import__";
17
+ export function matchFeatureForPath(features, relPath) {
18
+ for (const feature of features) {
19
+ if (feature.paths.some((p) => relPath === p || relPath.endsWith(`/${p}`))) {
20
+ return { slug: feature.slug, entrySymbol: feature.entrySymbol };
21
+ }
22
+ }
23
+ return null;
24
+ }
25
+ export function shouldWrap(name, entrySymbol) {
26
+ if (entrySymbol)
27
+ return name === entrySymbol;
28
+ return HTTP_METHODS.has(name) || name === "handler";
29
+ }
30
+ export function wrapModuleSource(source, slug, entrySymbol) {
31
+ if (source.includes(PRAETOM_IMPORT_MARKER))
32
+ return null;
33
+ const targets = new Set();
34
+ let rewritten = source.replace(/^export\s+(async\s+)?function\s+([A-Za-z_$][\w$]*)\s*\(/gm, (_m, asyncKw, name) => {
35
+ if (!shouldWrap(name, entrySymbol))
36
+ return _m;
37
+ targets.add(name);
38
+ return `${asyncKw ?? ""}function __praetom_orig_${name}(`;
39
+ });
40
+ rewritten = rewritten.replace(/^export\s+const\s+([A-Za-z_$][\w$]*)\s*=/gm, (_m, name) => {
41
+ if (!shouldWrap(name, entrySymbol))
42
+ return _m;
43
+ targets.add(name);
44
+ return `const __praetom_orig_${name} =`;
45
+ });
46
+ if (targets.size === 0)
47
+ return null;
48
+ const importLine = `import { __praetomWrapEntryPoint as ${PRAETOM_IMPORT_MARKER} } from "praetom";\n`;
49
+ const wraps = [...targets]
50
+ .map((name) => `export const ${name} = ${PRAETOM_IMPORT_MARKER}(${JSON.stringify(slug)}, ${JSON.stringify(name)}, __praetom_orig_${name});`)
51
+ .join("\n");
52
+ return `${importLine}${rewritten}\n${wraps}\n`;
53
+ }
54
+ export async function fetchFeatureMap(configEndpoint, ingestToken) {
55
+ const res = await fetch(configEndpoint, {
56
+ headers: { authorization: `Bearer ${ingestToken}` },
57
+ });
58
+ if (!res.ok) {
59
+ throw new Error(`runtime/config returned HTTP ${res.status}`);
60
+ }
61
+ return (await res.json());
62
+ }
63
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/webpack/shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,KAAK;IACL,MAAM;IACN,KAAK;IACL,OAAO;IACP,QA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ligence for AI-generated code. One package: runtime SDK, bundler plugins, and CLI. `register()` once, the praetom server defines what gets wrapped at runtime; the bundler plugin handles bundled code; the CLI wires it all up from the terminal.",
5
+ "private": false,
6
+ "type": "module",
7
+ "main": "./dist/server.js",
8
+ "types": "./dist/server.d.ts",
9
+ "bin": {
10
+ "praetom": "./dist/cli/cli.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "README.md"
15
+ ],
16
+ "exports": {
17
+ ".": {
18
+ "edge-light": {
19
+ "types": "./dist/edge.d.ts",
20
+ "default": "./dist/edge.js"
21
+ },
22
+ "workerd": {
23
+ "types": "./dist/edge.d.ts",
24
+ "default": "./dist/edge.js"
25
+ },
26
+ "browser": {
27
+ "types": "./dist/browser.d.ts",
28
+ "default": "./dist/browser.js"
29
+ },
30
+ "node": {
31
+ "types": "./dist/server.d.ts",
32
+ "default": "./dist/server.js"
33
+ },
34
+ "default": {
35
+ "types": "./dist/server.d.ts",
36
+ "default": "./dist/server.js"
37
+ }
38
+ },
39
+ "./vite": {
40
+ "types": "./dist/vite/index.d.ts",
41
+ "default": "./dist/vite/index.js"
42
+ },
43
+ "./webpack": {
44
+ "types": "./dist/webpack/index.d.ts",
45
+ "default": "./dist/webpack/index.js"
46
+ },
47
+ "./webpack/loader": {
48
+ "types": "./dist/webpack/loader.d.ts",
49
+ "default": "./dist/webpack/loader.js"
50
+ }
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "homepage": "https://praetom.com",
56
+ "scripts": {
57
+ "build": "tsc -p tsconfig.json && chmod +x dist/cli/cli.js",
58
+ "prepare": "tsc -p tsconfig.json && chmod +x dist/cli/cli.js",
59
+ "lint": "eslint src",
60
+ "dev": "tsc -p tsconfig.json --watch"
61
+ },
62
+ "dependencies": {
63
+ "commander": "^12.1.0"
64
+ },
65
+ "peerDependencies": {
66
+ "vite": ">=4.0.0",
67
+ "webpack": ">=5.0.0"
68
+ },
69
+ "peerDependenciesMeta": {
70
+ "vite": { "optional": true },
71
+ "webpack": { "optional": true }
72
+ },
73
+ "devDependencies": {
74
+ "@types/node": "^20",
75
+ "typescript": "^5",
76
+ "vite": "^5",
77
+ "webpack": "^5"
78
+ }
79
+ }