@portel/photon 1.9.0 → 1.10.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.
- package/README.md +163 -210
- package/dist/async/dedup-map.d.ts +40 -0
- package/dist/async/dedup-map.d.ts.map +1 -0
- package/dist/async/dedup-map.js +80 -0
- package/dist/async/dedup-map.js.map +1 -0
- package/dist/async/index.d.ts +11 -0
- package/dist/async/index.d.ts.map +1 -0
- package/dist/async/index.js +11 -0
- package/dist/async/index.js.map +1 -0
- package/dist/async/loading-gate.d.ts +27 -0
- package/dist/async/loading-gate.d.ts.map +1 -0
- package/dist/async/loading-gate.js +48 -0
- package/dist/async/loading-gate.js.map +1 -0
- package/dist/async/with-timeout.d.ts +6 -0
- package/dist/async/with-timeout.d.ts.map +1 -0
- package/dist/async/with-timeout.js +17 -0
- package/dist/async/with-timeout.js.map +1 -0
- package/dist/auto-ui/beam/class-metadata.d.ts +52 -0
- package/dist/auto-ui/beam/class-metadata.d.ts.map +1 -0
- package/dist/auto-ui/beam/class-metadata.js +133 -0
- package/dist/auto-ui/beam/class-metadata.js.map +1 -0
- package/dist/auto-ui/beam/config.d.ts +13 -0
- package/dist/auto-ui/beam/config.d.ts.map +1 -0
- package/dist/auto-ui/beam/config.js +52 -0
- package/dist/auto-ui/beam/config.js.map +1 -0
- package/dist/auto-ui/beam/external-mcp.d.ts +37 -0
- package/dist/auto-ui/beam/external-mcp.d.ts.map +1 -0
- package/dist/auto-ui/beam/external-mcp.js +311 -0
- package/dist/auto-ui/beam/external-mcp.js.map +1 -0
- package/dist/auto-ui/beam/photon-management.d.ts +51 -0
- package/dist/auto-ui/beam/photon-management.d.ts.map +1 -0
- package/dist/auto-ui/beam/photon-management.js +310 -0
- package/dist/auto-ui/beam/photon-management.js.map +1 -0
- package/dist/auto-ui/beam/routes/api-browse.d.ts +17 -0
- package/dist/auto-ui/beam/routes/api-browse.d.ts.map +1 -0
- package/dist/auto-ui/beam/routes/api-browse.js +531 -0
- package/dist/auto-ui/beam/routes/api-browse.js.map +1 -0
- package/dist/auto-ui/beam/routes/api-config.d.ts +9 -0
- package/dist/auto-ui/beam/routes/api-config.d.ts.map +1 -0
- package/dist/auto-ui/beam/routes/api-config.js +494 -0
- package/dist/auto-ui/beam/routes/api-config.js.map +1 -0
- package/dist/auto-ui/beam/routes/api-marketplace.d.ts +8 -0
- package/dist/auto-ui/beam/routes/api-marketplace.d.ts.map +1 -0
- package/dist/auto-ui/beam/routes/api-marketplace.js +490 -0
- package/dist/auto-ui/beam/routes/api-marketplace.js.map +1 -0
- package/dist/auto-ui/beam/startup.d.ts +41 -0
- package/dist/auto-ui/beam/startup.d.ts.map +1 -0
- package/dist/auto-ui/beam/startup.js +98 -0
- package/dist/auto-ui/beam/startup.js.map +1 -0
- package/dist/auto-ui/beam/subscription.d.ts +35 -0
- package/dist/auto-ui/beam/subscription.d.ts.map +1 -0
- package/dist/auto-ui/beam/subscription.js +151 -0
- package/dist/auto-ui/beam/subscription.js.map +1 -0
- package/dist/auto-ui/beam/types.d.ts +103 -0
- package/dist/auto-ui/beam/types.d.ts.map +1 -0
- package/dist/auto-ui/beam/types.js +8 -0
- package/dist/auto-ui/beam/types.js.map +1 -0
- package/dist/auto-ui/beam.d.ts +2 -0
- package/dist/auto-ui/beam.d.ts.map +1 -1
- package/dist/auto-ui/beam.js +729 -2596
- package/dist/auto-ui/beam.js.map +1 -1
- package/dist/auto-ui/bridge/index.d.ts.map +1 -1
- package/dist/auto-ui/bridge/index.js +10 -2
- package/dist/auto-ui/bridge/index.js.map +1 -1
- package/dist/auto-ui/components/card.d.ts.map +1 -1
- package/dist/auto-ui/components/card.js +3 -1
- package/dist/auto-ui/components/card.js.map +1 -1
- package/dist/auto-ui/components/progress.d.ts.map +1 -1
- package/dist/auto-ui/components/progress.js.map +1 -1
- package/dist/auto-ui/daemon-tools.d.ts +1 -1
- package/dist/auto-ui/daemon-tools.d.ts.map +1 -1
- package/dist/auto-ui/daemon-tools.js +4 -3
- package/dist/auto-ui/daemon-tools.js.map +1 -1
- package/dist/auto-ui/photon-bridge.d.ts +6 -2
- package/dist/auto-ui/photon-bridge.d.ts.map +1 -1
- package/dist/auto-ui/photon-bridge.js +20 -8
- package/dist/auto-ui/photon-bridge.js.map +1 -1
- package/dist/auto-ui/platform-compat.d.ts.map +1 -1
- package/dist/auto-ui/platform-compat.js +4 -0
- package/dist/auto-ui/platform-compat.js.map +1 -1
- package/dist/auto-ui/streamable-http-transport.d.ts +4 -2
- package/dist/auto-ui/streamable-http-transport.d.ts.map +1 -1
- package/dist/auto-ui/streamable-http-transport.js +120 -30
- package/dist/auto-ui/streamable-http-transport.js.map +1 -1
- package/dist/auto-ui/types.d.ts +4 -2
- package/dist/auto-ui/types.d.ts.map +1 -1
- package/dist/auto-ui/types.js.map +1 -1
- package/dist/beam.bundle.js +8225 -3999
- package/dist/beam.bundle.js.map +4 -4
- package/dist/cli/commands/alias.d.ts +14 -0
- package/dist/cli/commands/alias.d.ts.map +1 -0
- package/dist/cli/commands/alias.js +41 -0
- package/dist/cli/commands/alias.js.map +1 -0
- package/dist/cli/commands/audit.d.ts +9 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +377 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/beam.d.ts +20 -0
- package/dist/cli/commands/beam.d.ts.map +1 -0
- package/dist/cli/commands/beam.js +256 -0
- package/dist/cli/commands/beam.js.map +1 -0
- package/dist/cli/commands/config.d.ts +14 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +165 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/daemon.d.ts +11 -0
- package/dist/cli/commands/daemon.d.ts.map +1 -0
- package/dist/cli/commands/daemon.js +108 -0
- package/dist/cli/commands/daemon.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +14 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +257 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/host.d.ts +11 -0
- package/dist/cli/commands/host.d.ts.map +1 -0
- package/dist/cli/commands/host.js +96 -0
- package/dist/cli/commands/host.js.map +1 -0
- package/dist/cli/commands/info.d.ts +1 -1
- package/dist/cli/commands/info.d.ts.map +1 -1
- package/dist/cli/commands/info.js +16 -15
- package/dist/cli/commands/info.js.map +1 -1
- package/dist/cli/commands/init.d.ts +20 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +774 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/maker.d.ts +12 -0
- package/dist/cli/commands/maker.d.ts.map +1 -0
- package/dist/cli/commands/maker.js +605 -0
- package/dist/cli/commands/maker.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +27 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +390 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/package-app.d.ts +1 -1
- package/dist/cli/commands/package-app.d.ts.map +1 -1
- package/dist/cli/commands/package-app.js +5 -4
- package/dist/cli/commands/package-app.js.map +1 -1
- package/dist/cli/commands/package.d.ts +1 -1
- package/dist/cli/commands/package.d.ts.map +1 -1
- package/dist/cli/commands/package.js +134 -32
- package/dist/cli/commands/package.js.map +1 -1
- package/dist/cli/commands/run.d.ts +34 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +334 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/search.d.ts +11 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +60 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +11 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +138 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/test.d.ts +14 -0
- package/dist/cli/commands/test.d.ts.map +1 -0
- package/dist/cli/commands/test.js +51 -0
- package/dist/cli/commands/test.js.map +1 -0
- package/dist/cli/commands/update.d.ts +11 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +72 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/index.d.ts +14 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +139 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli-alias.js +2 -2
- package/dist/cli-alias.js.map +1 -1
- package/dist/cli.d.ts +3 -16
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -2725
- package/dist/cli.js.map +1 -1
- package/dist/context-store.d.ts +13 -12
- package/dist/context-store.d.ts.map +1 -1
- package/dist/context-store.js +47 -23
- package/dist/context-store.js.map +1 -1
- package/dist/context.d.ts +35 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +38 -0
- package/dist/context.js.map +1 -0
- package/dist/daemon/client.d.ts +25 -13
- package/dist/daemon/client.d.ts.map +1 -1
- package/dist/daemon/client.js +183 -135
- package/dist/daemon/client.js.map +1 -1
- package/dist/daemon/manager.d.ts +58 -26
- package/dist/daemon/manager.d.ts.map +1 -1
- package/dist/daemon/manager.js +348 -157
- package/dist/daemon/manager.js.map +1 -1
- package/dist/daemon/protocol.d.ts +9 -3
- package/dist/daemon/protocol.d.ts.map +1 -1
- package/dist/daemon/protocol.js +2 -0
- package/dist/daemon/protocol.js.map +1 -1
- package/dist/daemon/server.js +850 -200
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/session-manager.d.ts +16 -2
- package/dist/daemon/session-manager.d.ts.map +1 -1
- package/dist/daemon/session-manager.js +65 -7
- package/dist/daemon/session-manager.js.map +1 -1
- package/dist/daemon/state-machine.d.ts +22 -0
- package/dist/daemon/state-machine.d.ts.map +1 -0
- package/dist/daemon/state-machine.js +48 -0
- package/dist/daemon/state-machine.js.map +1 -0
- package/dist/deploy/cloudflare.d.ts.map +1 -1
- package/dist/deploy/cloudflare.js +5 -5
- package/dist/deploy/cloudflare.js.map +1 -1
- package/dist/loader.d.ts +65 -7
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +587 -63
- package/dist/loader.js.map +1 -1
- package/dist/marketplace-manager.d.ts +84 -12
- package/dist/marketplace-manager.d.ts.map +1 -1
- package/dist/marketplace-manager.js +470 -26
- package/dist/marketplace-manager.js.map +1 -1
- package/dist/path-resolver.d.ts +3 -1
- package/dist/path-resolver.d.ts.map +1 -1
- package/dist/path-resolver.js +4 -3
- package/dist/path-resolver.js.map +1 -1
- package/dist/photon-cli-runner.d.ts +1 -1
- package/dist/photon-cli-runner.d.ts.map +1 -1
- package/dist/photon-cli-runner.js +34 -44
- package/dist/photon-cli-runner.js.map +1 -1
- package/dist/photon-doc-extractor.d.ts +1 -0
- package/dist/photon-doc-extractor.d.ts.map +1 -1
- package/dist/photon-doc-extractor.js +33 -12
- package/dist/photon-doc-extractor.js.map +1 -1
- package/dist/photons/maker.photon.d.ts.map +1 -1
- package/dist/photons/maker.photon.js +4 -4
- package/dist/photons/maker.photon.js.map +1 -1
- package/dist/photons/maker.photon.ts +4 -3
- package/dist/photons/marketplace.photon.d.ts.map +1 -1
- package/dist/photons/marketplace.photon.js +10 -27
- package/dist/photons/marketplace.photon.js.map +1 -1
- package/dist/photons/marketplace.photon.ts +14 -33
- package/dist/photons/tunnel.photon.d.ts.map +1 -1
- package/dist/photons/tunnel.photon.js +4 -8
- package/dist/photons/tunnel.photon.js.map +1 -1
- package/dist/photons/tunnel.photon.ts +4 -7
- package/dist/serv/session/kv-store.d.ts +1 -1
- package/dist/serv/session/kv-store.d.ts.map +1 -1
- package/dist/serv/session/store.d.ts.map +1 -1
- package/dist/serv/session/store.js +16 -14
- package/dist/serv/session/store.js.map +1 -1
- package/dist/serv/vault/token-vault.js +1 -1
- package/dist/serv/vault/token-vault.js.map +1 -1
- package/dist/server.d.ts +34 -12
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +364 -313
- package/dist/server.js.map +1 -1
- package/dist/shared/audit.d.ts +30 -0
- package/dist/shared/audit.d.ts.map +1 -0
- package/dist/shared/audit.js +89 -0
- package/dist/shared/audit.js.map +1 -0
- package/dist/shared/cli-sections.d.ts +0 -4
- package/dist/shared/cli-sections.d.ts.map +1 -1
- package/dist/shared/cli-sections.js +0 -6
- package/dist/shared/cli-sections.js.map +1 -1
- package/dist/shared/cli-utils.d.ts +2 -56
- package/dist/shared/cli-utils.d.ts.map +1 -1
- package/dist/shared/cli-utils.js +1 -87
- package/dist/shared/cli-utils.js.map +1 -1
- package/dist/shared/error-handler.d.ts +6 -72
- package/dist/shared/error-handler.d.ts.map +1 -1
- package/dist/shared/error-handler.js +22 -213
- package/dist/shared/error-handler.js.map +1 -1
- package/dist/shared/security.d.ts +0 -9
- package/dist/shared/security.d.ts.map +1 -1
- package/dist/shared/security.js +0 -30
- package/dist/shared/security.js.map +1 -1
- package/dist/shared-utils.d.ts +0 -26
- package/dist/shared-utils.d.ts.map +1 -1
- package/dist/shared-utils.js +0 -44
- package/dist/shared-utils.js.map +1 -1
- package/dist/shell-completions.d.ts +1 -1
- package/dist/shell-completions.d.ts.map +1 -1
- package/dist/shell-completions.js +5 -5
- package/dist/shell-completions.js.map +1 -1
- package/dist/template-manager.d.ts.map +1 -1
- package/dist/template-manager.js +14 -1
- package/dist/template-manager.js.map +1 -1
- package/dist/test-runner.d.ts +0 -12
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +4 -39
- package/dist/test-runner.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +2 -2
- package/dist/testing.js.map +1 -1
- package/dist/version-checker.d.ts +4 -4
- package/dist/version-checker.d.ts.map +1 -1
- package/dist/version-checker.js +33 -4
- package/dist/version-checker.js.map +1 -1
- package/dist/watcher.d.ts.map +1 -1
- package/dist/watcher.js +14 -12
- package/dist/watcher.js.map +1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AC;gBACH,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;gBACnD,QAAQ,CAAC,wCAAwC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACxE,YAAY,CAAC,+BAA+B,CAAC,CAAC;YAChD,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS,CAAC,gCAAgC,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAC;YAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maker CLI Commands
|
|
3
|
+
*
|
|
4
|
+
* Commands for photon creators and publishers:
|
|
5
|
+
* new, validate, sync, init, diagram, diagrams
|
|
6
|
+
*/
|
|
7
|
+
import type { Command } from 'commander';
|
|
8
|
+
/**
|
|
9
|
+
* Register the `maker` command group and all its subcommands
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerMakerCommands(program: Command): void;
|
|
12
|
+
//# sourceMappingURL=maker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maker.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/maker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6azC;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+P5D"}
|
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maker CLI Commands
|
|
3
|
+
*
|
|
4
|
+
* Commands for photon creators and publishers:
|
|
5
|
+
* new, validate, sync, init, diagram, diagrams
|
|
6
|
+
*/
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import * as fs from 'fs/promises';
|
|
9
|
+
import { existsSync, lstatSync } from 'fs';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
import { getErrorMessage, ExitCode, exitWithError } from '../../shared/error-handler.js';
|
|
12
|
+
import { logger } from '../../shared/logger.js';
|
|
13
|
+
import { resolvePhotonPath, ensureWorkingDir } from '../../path-resolver.js';
|
|
14
|
+
import { getDefaultContext } from '../../context.js';
|
|
15
|
+
import { PHOTON_VERSION } from '../../version.js';
|
|
16
|
+
import { isNodeError } from '../../shared/error-handler.js';
|
|
17
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
19
|
+
// PRIVATE HELPERS
|
|
20
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
21
|
+
/**
|
|
22
|
+
* Ensure .gitignore includes marketplace template directory
|
|
23
|
+
*/
|
|
24
|
+
async function ensureGitignore(workingDir) {
|
|
25
|
+
const gitignorePath = path.join(workingDir, '.gitignore');
|
|
26
|
+
const templatesPattern = '.marketplace/_templates/';
|
|
27
|
+
try {
|
|
28
|
+
let gitignoreContent = '';
|
|
29
|
+
if (existsSync(gitignorePath)) {
|
|
30
|
+
gitignoreContent = await fs.readFile(gitignorePath, 'utf-8');
|
|
31
|
+
}
|
|
32
|
+
// Check if pattern already exists
|
|
33
|
+
if (gitignoreContent.includes(templatesPattern)) {
|
|
34
|
+
return; // Already configured
|
|
35
|
+
}
|
|
36
|
+
// Add templates pattern to .gitignore
|
|
37
|
+
const newContent = gitignoreContent.endsWith('\n')
|
|
38
|
+
? gitignoreContent + templatesPattern + '\n'
|
|
39
|
+
: gitignoreContent + '\n' + templatesPattern + '\n';
|
|
40
|
+
await fs.writeFile(gitignorePath, newContent, 'utf-8');
|
|
41
|
+
console.error(' ✓ Added .marketplace/_templates/ to .gitignore');
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
// Non-fatal - just warn
|
|
45
|
+
console.error(` ⚠ Could not update .gitignore: ${getErrorMessage(error)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Perform marketplace sync - generates documentation files
|
|
50
|
+
*/
|
|
51
|
+
async function performMarketplaceSync(dirPath, options) {
|
|
52
|
+
const resolvedPath = path.resolve(dirPath);
|
|
53
|
+
const isDefaultDir = resolvedPath === getDefaultContext().baseDir;
|
|
54
|
+
if (!existsSync(resolvedPath)) {
|
|
55
|
+
exitWithError(`Directory not found: ${resolvedPath}`, {
|
|
56
|
+
exitCode: ExitCode.NOT_FOUND,
|
|
57
|
+
suggestion: 'Check the path and ensure the directory exists',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// Scan for .photon.ts files
|
|
61
|
+
console.error('📦 Scanning for .photon.ts files...');
|
|
62
|
+
const files = await fs.readdir(resolvedPath);
|
|
63
|
+
let photonFiles = files.filter((f) => f.endsWith('.photon.ts'));
|
|
64
|
+
// Filter out installed photons if requested (for ~/.photon)
|
|
65
|
+
if (options.filterInstalled && isDefaultDir) {
|
|
66
|
+
const { readLocalMetadata } = await import('../../marketplace-manager.js');
|
|
67
|
+
const metadata = await readLocalMetadata();
|
|
68
|
+
// Metadata keys may include .photon.ts extension
|
|
69
|
+
const installedNames = new Set(Object.keys(metadata.photons || {}).map((k) => k.replace(/\.photon\.ts$/, '')));
|
|
70
|
+
const originalCount = photonFiles.length;
|
|
71
|
+
photonFiles = photonFiles.filter((f) => {
|
|
72
|
+
const name = f.replace(/\.photon\.ts$/, '');
|
|
73
|
+
return !installedNames.has(name);
|
|
74
|
+
});
|
|
75
|
+
if (originalCount !== photonFiles.length) {
|
|
76
|
+
console.error(` Filtered out ${originalCount - photonFiles.length} installed photons`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Check for misplaced photon files in subdirectories
|
|
80
|
+
const subdirs = files.filter((f) => {
|
|
81
|
+
try {
|
|
82
|
+
return lstatSync(path.join(resolvedPath, f)).isDirectory() && !f.startsWith('.');
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return false; // stat failed (permission denied, broken symlink)
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
const misplaced = [];
|
|
89
|
+
for (const dir of subdirs) {
|
|
90
|
+
const subfiles = await fs.readdir(path.join(resolvedPath, dir));
|
|
91
|
+
for (const f of subfiles) {
|
|
92
|
+
if (f.endsWith('.photon.ts')) {
|
|
93
|
+
const rootExists = photonFiles.includes(f);
|
|
94
|
+
if (!rootExists) {
|
|
95
|
+
misplaced.push(`${dir}/${f}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (misplaced.length > 0) {
|
|
101
|
+
const fileList = misplaced.join(', ');
|
|
102
|
+
const names = misplaced.map((f) => f.split('/').pop()).join(', ');
|
|
103
|
+
exitWithError(`Photon files must live at the root, not in subdirectories: ${fileList}`, {
|
|
104
|
+
exitCode: ExitCode.VALIDATION_ERROR,
|
|
105
|
+
suggestion: `Move to root: ${names}. Subdirectories are for assets only (ui/, etc.)`,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (photonFiles.length === 0) {
|
|
109
|
+
exitWithError(`No .photon.ts files found`, {
|
|
110
|
+
exitCode: ExitCode.NOT_FOUND,
|
|
111
|
+
searchedIn: resolvedPath,
|
|
112
|
+
suggestion: "Create a .photon.ts file or use 'photon maker new' to generate one",
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
console.error(` Found ${photonFiles.length} photons\n`);
|
|
116
|
+
// Initialize template manager
|
|
117
|
+
const { TemplateManager } = await import('../../template-manager.js');
|
|
118
|
+
const templateMgr = new TemplateManager(resolvedPath);
|
|
119
|
+
console.error('📝 Ensuring templates...');
|
|
120
|
+
await templateMgr.ensureTemplates();
|
|
121
|
+
// Ensure .gitignore excludes templates
|
|
122
|
+
await ensureGitignore(resolvedPath);
|
|
123
|
+
console.error('');
|
|
124
|
+
// Extract metadata from each Photon
|
|
125
|
+
console.error('📄 Extracting documentation...');
|
|
126
|
+
const { calculateFileHash, calculatePhotonHash } = await import('../../marketplace-manager.js');
|
|
127
|
+
const { PhotonDocExtractor } = await import('../../photon-doc-extractor.js');
|
|
128
|
+
const photons = [];
|
|
129
|
+
for (const file of photonFiles.sort()) {
|
|
130
|
+
const filePath = path.join(resolvedPath, file);
|
|
131
|
+
// Extract full metadata
|
|
132
|
+
const extractor = new PhotonDocExtractor(filePath);
|
|
133
|
+
const metadata = await extractor.extractFullMetadata();
|
|
134
|
+
// contentHash = source-only (for download integrity verification)
|
|
135
|
+
const contentHash = await calculateFileHash(filePath);
|
|
136
|
+
// hash = source + assets (for update detection)
|
|
137
|
+
const hash = metadata.assets?.length
|
|
138
|
+
? await calculatePhotonHash(filePath, metadata.assets, resolvedPath)
|
|
139
|
+
: contentHash;
|
|
140
|
+
console.error(` ✓ ${metadata.name} (${metadata.tools?.length || 0} tools)`);
|
|
141
|
+
// Build manifest entry
|
|
142
|
+
photons.push({
|
|
143
|
+
name: metadata.name,
|
|
144
|
+
version: metadata.version,
|
|
145
|
+
description: metadata.description,
|
|
146
|
+
author: metadata.author || options.owner || 'Unknown',
|
|
147
|
+
license: metadata.license || 'MIT',
|
|
148
|
+
repository: metadata.repository,
|
|
149
|
+
homepage: metadata.homepage,
|
|
150
|
+
icon: metadata.icon || null,
|
|
151
|
+
source: `../${file}`,
|
|
152
|
+
hash,
|
|
153
|
+
contentHash,
|
|
154
|
+
tools: metadata.tools?.map((t) => t.name),
|
|
155
|
+
assets: metadata.assets,
|
|
156
|
+
photonType: metadata.photonType,
|
|
157
|
+
features: metadata.features,
|
|
158
|
+
});
|
|
159
|
+
// Generate individual photon documentation
|
|
160
|
+
const photonMarkdown = await templateMgr.renderTemplate('photon.md', metadata);
|
|
161
|
+
const docPath = path.join(resolvedPath, `${metadata.name}.md`);
|
|
162
|
+
await fs.writeFile(docPath, photonMarkdown, 'utf-8');
|
|
163
|
+
}
|
|
164
|
+
// Create manifest
|
|
165
|
+
console.error('\n📋 Updating manifest...');
|
|
166
|
+
const baseName = path.basename(resolvedPath);
|
|
167
|
+
const marketplaceDir = path.join(resolvedPath, '.marketplace');
|
|
168
|
+
await fs.mkdir(marketplaceDir, { recursive: true });
|
|
169
|
+
const manifestPath = path.join(marketplaceDir, 'photons.json');
|
|
170
|
+
// Read existing manifest to preserve owner and detect unbumped versions
|
|
171
|
+
let existingOwner;
|
|
172
|
+
let existingPhotons = [];
|
|
173
|
+
if (existsSync(manifestPath)) {
|
|
174
|
+
try {
|
|
175
|
+
const existingManifest = JSON.parse(await fs.readFile(manifestPath, 'utf-8'));
|
|
176
|
+
if (!options.owner) {
|
|
177
|
+
existingOwner = existingManifest.owner;
|
|
178
|
+
}
|
|
179
|
+
existingPhotons = existingManifest.photons || [];
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
// Ignore parse errors
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Warn about content changes without version bumps
|
|
186
|
+
if (existingPhotons.length > 0) {
|
|
187
|
+
const existingByName = new Map(existingPhotons.map((p) => [p.name, p]));
|
|
188
|
+
let hasWarnings = false;
|
|
189
|
+
for (const p of photons) {
|
|
190
|
+
const prev = existingByName.get(p.name);
|
|
191
|
+
if (prev && prev.hash && p.hash && prev.hash !== p.hash && prev.version === p.version) {
|
|
192
|
+
if (!hasWarnings) {
|
|
193
|
+
console.error('');
|
|
194
|
+
hasWarnings = true;
|
|
195
|
+
}
|
|
196
|
+
console.error(`⚠ ${p.name}: content changed but version is still ${p.version} — consider bumping`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const manifest = {
|
|
201
|
+
name: options.name || baseName,
|
|
202
|
+
version: PHOTON_VERSION,
|
|
203
|
+
description: options.description || undefined,
|
|
204
|
+
owner: options.owner
|
|
205
|
+
? {
|
|
206
|
+
name: options.owner,
|
|
207
|
+
}
|
|
208
|
+
: existingOwner,
|
|
209
|
+
photons,
|
|
210
|
+
};
|
|
211
|
+
await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2), 'utf-8');
|
|
212
|
+
console.error(' ✓ .marketplace/photons.json');
|
|
213
|
+
// Sync README with generated content
|
|
214
|
+
console.error('\n📖 Syncing README.md...');
|
|
215
|
+
const { ReadmeSyncer } = await import('../../readme-syncer.js');
|
|
216
|
+
const readmePath = path.join(resolvedPath, 'README.md');
|
|
217
|
+
const syncer = new ReadmeSyncer(readmePath);
|
|
218
|
+
// Render README section from template
|
|
219
|
+
const readmeContent = await templateMgr.renderTemplate('readme.md', {
|
|
220
|
+
marketplaceName: manifest.name,
|
|
221
|
+
marketplaceDescription: manifest.description || '',
|
|
222
|
+
photons: photons.map((p) => ({
|
|
223
|
+
name: p.name,
|
|
224
|
+
description: p.description,
|
|
225
|
+
version: p.version,
|
|
226
|
+
license: p.license,
|
|
227
|
+
tools: p.tools || [],
|
|
228
|
+
photonType: p.photonType || 'api',
|
|
229
|
+
features: p.features || [],
|
|
230
|
+
})),
|
|
231
|
+
});
|
|
232
|
+
const isUpdate = await syncer.sync(readmeContent);
|
|
233
|
+
if (isUpdate) {
|
|
234
|
+
console.error(' ✓ README.md synced (user content preserved)');
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
console.error(' ✓ README.md created');
|
|
238
|
+
}
|
|
239
|
+
console.error('\n✅ Marketplace synced successfully!');
|
|
240
|
+
console.error(`\n Marketplace: ${manifest.name}`);
|
|
241
|
+
console.error(` Photons: ${photons.length}`);
|
|
242
|
+
console.error(` Documentation: ${photons.length} markdown files generated`);
|
|
243
|
+
console.error(`\n Generated files:`);
|
|
244
|
+
console.error(` • .marketplace/photons.json (manifest)`);
|
|
245
|
+
console.error(` • *.md (${photons.length} documentation files at root)`);
|
|
246
|
+
console.error(` • README.md (auto-generated table)`);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Initialize a marketplace with git hooks
|
|
250
|
+
*/
|
|
251
|
+
async function performMarketplaceInit(dirPath, options) {
|
|
252
|
+
const absolutePath = path.resolve(dirPath);
|
|
253
|
+
// Check if directory exists
|
|
254
|
+
if (!existsSync(absolutePath)) {
|
|
255
|
+
await fs.mkdir(absolutePath, { recursive: true });
|
|
256
|
+
console.error(`📁 Created directory: ${absolutePath}`);
|
|
257
|
+
}
|
|
258
|
+
// Check if it's a git repository
|
|
259
|
+
const gitDir = path.join(absolutePath, '.git');
|
|
260
|
+
if (!existsSync(gitDir)) {
|
|
261
|
+
exitWithError('Not a git repository', {
|
|
262
|
+
exitCode: ExitCode.CONFIG_ERROR,
|
|
263
|
+
searchedIn: absolutePath,
|
|
264
|
+
suggestion: 'Initialize with: git init',
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
// Create .githooks directory
|
|
268
|
+
const hooksDir = path.join(absolutePath, '.githooks');
|
|
269
|
+
await fs.mkdir(hooksDir, { recursive: true });
|
|
270
|
+
// Create pre-commit hook
|
|
271
|
+
const preCommitHook = `#!/bin/bash
|
|
272
|
+
# Pre-commit hook: Auto-sync marketplace manifest before commit
|
|
273
|
+
# This ensures .marketplace/photons.json and .claude-plugin/ are always up-to-date
|
|
274
|
+
|
|
275
|
+
# Check if any .photon.ts files or marketplace files are being committed
|
|
276
|
+
if git diff --cached --name-only | grep -qE '\\.photon\\.ts$|\\.marketplace/|\\.claude-plugin/'; then
|
|
277
|
+
echo "🔄 Syncing marketplace manifest..."
|
|
278
|
+
|
|
279
|
+
# Run photon maker sync with --claude-code to generate plugin files
|
|
280
|
+
if photon maker sync --dir . --claude-code; then
|
|
281
|
+
# Stage the generated files
|
|
282
|
+
git add .marketplace/photons.json README.md *.md .claude-plugin/ 2>/dev/null
|
|
283
|
+
echo "✅ Marketplace and Claude Code plugin synced and staged"
|
|
284
|
+
else
|
|
285
|
+
echo "❌ Failed to sync marketplace"
|
|
286
|
+
exit 1
|
|
287
|
+
fi
|
|
288
|
+
fi
|
|
289
|
+
|
|
290
|
+
exit 0
|
|
291
|
+
`;
|
|
292
|
+
const preCommitPath = path.join(hooksDir, 'pre-commit');
|
|
293
|
+
await fs.writeFile(preCommitPath, preCommitHook, { mode: 0o755 });
|
|
294
|
+
console.error('✅ Created .githooks/pre-commit');
|
|
295
|
+
// Create setup script
|
|
296
|
+
const setupScript = `#!/bin/bash
|
|
297
|
+
# Setup script to install git hooks for this marketplace
|
|
298
|
+
|
|
299
|
+
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
300
|
+
HOOKS_DIR="$REPO_ROOT/.git/hooks"
|
|
301
|
+
SOURCE_HOOKS="$REPO_ROOT/.githooks"
|
|
302
|
+
|
|
303
|
+
echo "🔧 Installing git hooks for Photon marketplace..."
|
|
304
|
+
|
|
305
|
+
# Copy pre-commit hook
|
|
306
|
+
if [ -f "$SOURCE_HOOKS/pre-commit" ]; then
|
|
307
|
+
cp "$SOURCE_HOOKS/pre-commit" "$HOOKS_DIR/pre-commit"
|
|
308
|
+
chmod +x "$HOOKS_DIR/pre-commit"
|
|
309
|
+
echo "✅ Installed pre-commit hook (auto-syncs marketplace manifest)"
|
|
310
|
+
else
|
|
311
|
+
echo "❌ pre-commit hook not found"
|
|
312
|
+
exit 1
|
|
313
|
+
fi
|
|
314
|
+
|
|
315
|
+
echo ""
|
|
316
|
+
echo "✅ Git hooks installed successfully!"
|
|
317
|
+
echo ""
|
|
318
|
+
echo "The pre-commit hook will automatically run 'photon maker sync'"
|
|
319
|
+
echo "whenever you commit changes to .photon.ts files."
|
|
320
|
+
`;
|
|
321
|
+
const setupPath = path.join(hooksDir, 'setup.sh');
|
|
322
|
+
await fs.writeFile(setupPath, setupScript, { mode: 0o755 });
|
|
323
|
+
console.error('✅ Created .githooks/setup.sh');
|
|
324
|
+
// Install hooks to .git/hooks
|
|
325
|
+
const gitHooksDir = path.join(absolutePath, '.git', 'hooks');
|
|
326
|
+
const gitPreCommitPath = path.join(gitHooksDir, 'pre-commit');
|
|
327
|
+
await fs.writeFile(gitPreCommitPath, preCommitHook, { mode: 0o755 });
|
|
328
|
+
console.error('✅ Installed hooks to .git/hooks');
|
|
329
|
+
// Create .marketplace directory
|
|
330
|
+
const marketplaceDir = path.join(absolutePath, '.marketplace');
|
|
331
|
+
await fs.mkdir(marketplaceDir, { recursive: true });
|
|
332
|
+
console.error('✅ Created .marketplace directory');
|
|
333
|
+
// Run initial sync (don't filter installed for marketplace repos)
|
|
334
|
+
console.error('\n🔄 Running initial marketplace sync...\n');
|
|
335
|
+
await performMarketplaceSync(absolutePath, options);
|
|
336
|
+
console.error('\n✅ Marketplace initialized successfully!');
|
|
337
|
+
console.error('\nNext steps:');
|
|
338
|
+
console.error('1. Add your .photon.ts files to this directory');
|
|
339
|
+
console.error('2. Commit your changes (hooks will auto-sync)');
|
|
340
|
+
console.error('3. Push to GitHub to share your marketplace');
|
|
341
|
+
console.error('\nContributors can setup hooks with:');
|
|
342
|
+
console.error(' bash .githooks/setup.sh');
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Return the inline photon template (fallback when file template is absent)
|
|
346
|
+
*/
|
|
347
|
+
function getInlineTemplate() {
|
|
348
|
+
return `/**
|
|
349
|
+
* TemplateName Photon MCP
|
|
350
|
+
*
|
|
351
|
+
* Single-file MCP server using Photon
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
export default class TemplateName {
|
|
355
|
+
/**
|
|
356
|
+
* Example tool
|
|
357
|
+
* @param message Message to echo
|
|
358
|
+
*/
|
|
359
|
+
async echo(params: { message: string }) {
|
|
360
|
+
return \`Echo: \${params.message}\`;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Add two numbers
|
|
365
|
+
* @param a First number
|
|
366
|
+
* @param b Second number
|
|
367
|
+
*/
|
|
368
|
+
async add(params: { a: number; b: number }) {
|
|
369
|
+
return params.a + params.b;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
`;
|
|
373
|
+
}
|
|
374
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
375
|
+
// COMMAND REGISTRATION
|
|
376
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
377
|
+
/**
|
|
378
|
+
* Register the `maker` command group and all its subcommands
|
|
379
|
+
*/
|
|
380
|
+
export function registerMakerCommands(program) {
|
|
381
|
+
const maker = program
|
|
382
|
+
.command('maker', { hidden: true })
|
|
383
|
+
.description('Commands for creating photons and marketplaces');
|
|
384
|
+
// maker new: create a new photon from template
|
|
385
|
+
maker
|
|
386
|
+
.command('new')
|
|
387
|
+
.argument('<name>', 'Name for the new photon')
|
|
388
|
+
.description('Create a new photon from template')
|
|
389
|
+
.action(async (name, options, command) => {
|
|
390
|
+
try {
|
|
391
|
+
// Get working directory from global options
|
|
392
|
+
const workingDir = getDefaultContext().baseDir;
|
|
393
|
+
// Ensure working directory exists
|
|
394
|
+
await ensureWorkingDir(workingDir);
|
|
395
|
+
const fileName = `${name}.photon.ts`;
|
|
396
|
+
const filePath = path.join(workingDir, fileName);
|
|
397
|
+
// Check if file already exists
|
|
398
|
+
try {
|
|
399
|
+
await fs.access(filePath);
|
|
400
|
+
exitWithError(`File already exists: ${filePath}`, {
|
|
401
|
+
suggestion: `Choose a different name or delete the existing file`,
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
catch (err) {
|
|
405
|
+
if (!isNodeError(err, 'ENOENT')) {
|
|
406
|
+
exitWithError(`Cannot access ${filePath}: ${getErrorMessage(err)}`);
|
|
407
|
+
}
|
|
408
|
+
// ENOENT = file doesn't exist — good, proceed
|
|
409
|
+
}
|
|
410
|
+
// Read template
|
|
411
|
+
const templatePath = path.join(__dirname, '..', '..', '..', 'templates', 'photon.template.ts');
|
|
412
|
+
let template;
|
|
413
|
+
try {
|
|
414
|
+
template = await fs.readFile(templatePath, 'utf-8');
|
|
415
|
+
}
|
|
416
|
+
catch (err) {
|
|
417
|
+
logger.debug(`Template not found at ${templatePath}, using inline template`);
|
|
418
|
+
template = getInlineTemplate();
|
|
419
|
+
}
|
|
420
|
+
// Replace placeholders
|
|
421
|
+
// Convert kebab-case to PascalCase for class name
|
|
422
|
+
const className = name
|
|
423
|
+
.split(/[-_]/)
|
|
424
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
425
|
+
.join('');
|
|
426
|
+
const content = template
|
|
427
|
+
.replace(/TemplateName/g, className)
|
|
428
|
+
.replace(/template-name/g, name);
|
|
429
|
+
// Write file
|
|
430
|
+
await fs.writeFile(filePath, content, 'utf-8');
|
|
431
|
+
console.error(`✅ Created ${fileName} in ${workingDir}`);
|
|
432
|
+
console.error(`Run with: photon mcp ${name} --dev`);
|
|
433
|
+
}
|
|
434
|
+
catch (error) {
|
|
435
|
+
logger.error(`Error: ${getErrorMessage(error)}`);
|
|
436
|
+
process.exit(1);
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
// maker validate: validate photon syntax and schemas
|
|
440
|
+
maker
|
|
441
|
+
.command('validate')
|
|
442
|
+
.argument('<name>', 'Photon name (without .photon.ts extension)')
|
|
443
|
+
.description('Validate photon syntax and schemas')
|
|
444
|
+
.action(async (name, options, command) => {
|
|
445
|
+
try {
|
|
446
|
+
// Get working directory from global options
|
|
447
|
+
const workingDir = getDefaultContext().baseDir;
|
|
448
|
+
// Resolve file path from name in working directory
|
|
449
|
+
const filePath = await resolvePhotonPath(name, workingDir);
|
|
450
|
+
if (!filePath) {
|
|
451
|
+
exitWithError(`Photon not found: ${name}`, {
|
|
452
|
+
exitCode: ExitCode.NOT_FOUND,
|
|
453
|
+
searchedIn: workingDir,
|
|
454
|
+
suggestion: "Use 'photon info' to see available photons",
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
console.error(`Validating ${path.basename(filePath)}...\n`);
|
|
458
|
+
// Import loader and try to load
|
|
459
|
+
const { PhotonLoader } = await import('../../loader.js');
|
|
460
|
+
const loader = new PhotonLoader(false); // quiet mode for inspection
|
|
461
|
+
const mcp = await loader.loadFile(filePath);
|
|
462
|
+
console.error(`✅ Valid Photon`);
|
|
463
|
+
console.error(`Name: ${mcp.name}`);
|
|
464
|
+
console.error(`Tools: ${mcp.tools.length}`);
|
|
465
|
+
for (const tool of mcp.tools) {
|
|
466
|
+
console.error(` - ${tool.name}: ${tool.description}`);
|
|
467
|
+
}
|
|
468
|
+
process.exit(0);
|
|
469
|
+
}
|
|
470
|
+
catch (error) {
|
|
471
|
+
logger.error(`Validation failed: ${getErrorMessage(error)}`);
|
|
472
|
+
process.exit(1);
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
// maker sync: generate marketplace manifest
|
|
476
|
+
maker
|
|
477
|
+
.command('sync')
|
|
478
|
+
.option('--dir <path>', 'Directory to sync (defaults to current directory)')
|
|
479
|
+
.option('--name <name>', 'Marketplace name')
|
|
480
|
+
.option('--description <desc>', 'Marketplace description')
|
|
481
|
+
.option('--owner <owner>', 'Owner name')
|
|
482
|
+
.option('--claude-code', 'Generate Claude Code plugin files')
|
|
483
|
+
.description('Generate marketplace manifest and documentation from your photons')
|
|
484
|
+
.action(async (options) => {
|
|
485
|
+
try {
|
|
486
|
+
const dirPath = options.dir || '.';
|
|
487
|
+
const resolvedPath = path.resolve(dirPath);
|
|
488
|
+
// Only filter installed photons when syncing ~/.photon
|
|
489
|
+
const filterInstalled = resolvedPath === getDefaultContext().baseDir;
|
|
490
|
+
await performMarketplaceSync(dirPath, { ...options, filterInstalled });
|
|
491
|
+
// Generate Claude Code plugin if requested
|
|
492
|
+
if (options.claudeCode) {
|
|
493
|
+
const { generateClaudeCodePlugin } = await import('../../claude-code-plugin.js');
|
|
494
|
+
await generateClaudeCodePlugin(dirPath, options);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
catch (error) {
|
|
498
|
+
logger.error(`Error: ${getErrorMessage(error)}`);
|
|
499
|
+
if (process.env.DEBUG && error instanceof Error) {
|
|
500
|
+
console.error(error.stack);
|
|
501
|
+
}
|
|
502
|
+
process.exit(1);
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
// maker init: initialize a directory as a Photon marketplace with git hooks
|
|
506
|
+
maker
|
|
507
|
+
.command('init')
|
|
508
|
+
.option('--dir <path>', 'Directory to initialize (defaults to current directory)')
|
|
509
|
+
.option('--name <name>', 'Marketplace name')
|
|
510
|
+
.option('--description <desc>', 'Marketplace description')
|
|
511
|
+
.option('--owner <owner>', 'Owner name')
|
|
512
|
+
.description('Initialize a directory as a Photon marketplace with git hooks')
|
|
513
|
+
.action(async (options) => {
|
|
514
|
+
try {
|
|
515
|
+
const dirPath = options.dir || '.';
|
|
516
|
+
await performMarketplaceInit(dirPath, options);
|
|
517
|
+
}
|
|
518
|
+
catch (error) {
|
|
519
|
+
logger.error(`Error: ${getErrorMessage(error)}`);
|
|
520
|
+
if (process.env.DEBUG && error instanceof Error) {
|
|
521
|
+
console.error(error.stack);
|
|
522
|
+
}
|
|
523
|
+
process.exit(1);
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
// maker diagram: generate Mermaid diagram for a Photon
|
|
527
|
+
maker
|
|
528
|
+
.command('diagram <photon>')
|
|
529
|
+
.option('--dir <path>', 'Directory containing photon (defaults to current directory)')
|
|
530
|
+
.description('Generate Mermaid diagram for a Photon')
|
|
531
|
+
.action(async (photonName, options) => {
|
|
532
|
+
try {
|
|
533
|
+
const { PhotonDocExtractor } = await import('../../photon-doc-extractor.js');
|
|
534
|
+
// Resolve photon path
|
|
535
|
+
const dirPath = options.dir || '.';
|
|
536
|
+
let photonPath = photonName;
|
|
537
|
+
// If not a path, look in the directory
|
|
538
|
+
if (!photonName.includes('/') && !photonName.includes('\\')) {
|
|
539
|
+
if (!photonName.endsWith('.photon.ts')) {
|
|
540
|
+
photonName = `${photonName}.photon.ts`;
|
|
541
|
+
}
|
|
542
|
+
photonPath = path.resolve(dirPath, photonName);
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
photonPath = path.resolve(photonName);
|
|
546
|
+
}
|
|
547
|
+
if (!existsSync(photonPath)) {
|
|
548
|
+
logger.error(`Photon not found: ${photonPath}`);
|
|
549
|
+
process.exit(1);
|
|
550
|
+
}
|
|
551
|
+
const extractor = new PhotonDocExtractor(photonPath);
|
|
552
|
+
const diagram = await extractor.generateDiagram();
|
|
553
|
+
// Output just the diagram (can be piped or copied)
|
|
554
|
+
console.log(diagram);
|
|
555
|
+
}
|
|
556
|
+
catch (error) {
|
|
557
|
+
logger.error(`Error: ${getErrorMessage(error)}`);
|
|
558
|
+
if (process.env.DEBUG && error instanceof Error) {
|
|
559
|
+
console.error(error.stack);
|
|
560
|
+
}
|
|
561
|
+
process.exit(1);
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
// maker diagrams: generate Mermaid diagrams for all Photons in a directory
|
|
565
|
+
maker
|
|
566
|
+
.command('diagrams')
|
|
567
|
+
.option('--dir <path>', 'Directory to scan (defaults to current directory)')
|
|
568
|
+
.description('Generate Mermaid diagrams for all Photons in a directory')
|
|
569
|
+
.action(async (options) => {
|
|
570
|
+
try {
|
|
571
|
+
const { PhotonDocExtractor } = await import('../../photon-doc-extractor.js');
|
|
572
|
+
const dirPath = path.resolve(options.dir || '.');
|
|
573
|
+
const files = await fs.readdir(dirPath);
|
|
574
|
+
const photonFiles = files.filter((f) => f.endsWith('.photon.ts'));
|
|
575
|
+
if (photonFiles.length === 0) {
|
|
576
|
+
console.error('No .photon.ts files found');
|
|
577
|
+
process.exit(1);
|
|
578
|
+
}
|
|
579
|
+
console.error(`📦 Found ${photonFiles.length} photons\n`);
|
|
580
|
+
for (const file of photonFiles) {
|
|
581
|
+
const photonPath = path.join(dirPath, file);
|
|
582
|
+
const name = file.replace('.photon.ts', '');
|
|
583
|
+
try {
|
|
584
|
+
const extractor = new PhotonDocExtractor(photonPath);
|
|
585
|
+
const diagram = await extractor.generateDiagram();
|
|
586
|
+
console.log(`## ${name}\n`);
|
|
587
|
+
console.log('```mermaid');
|
|
588
|
+
console.log(diagram);
|
|
589
|
+
console.log('```\n');
|
|
590
|
+
}
|
|
591
|
+
catch (err) {
|
|
592
|
+
console.error(`⚠️ Failed to generate diagram for ${name}: ${err.message}`);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
catch (error) {
|
|
597
|
+
logger.error(`Error: ${getErrorMessage(error)}`);
|
|
598
|
+
if (process.env.DEBUG && error instanceof Error) {
|
|
599
|
+
console.error(error.stack);
|
|
600
|
+
}
|
|
601
|
+
process.exit(1);
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
//# sourceMappingURL=maker.js.map
|