@moda-ai/cli 1.20.1 → 1.22.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 +3 -0
- package/dist/api-client.d.ts +1 -1
- package/dist/api-client.js +2 -2
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +109 -1
- package/dist/init/index.d.ts +2 -0
- package/dist/init/index.js +101 -26
- package/dist/init/sdk-catalog.d.ts +10 -0
- package/dist/init/sdk-catalog.js +80 -0
- package/dist/init/sdk-guide.d.ts +5 -34
- package/dist/init/sdk-guide.js +74 -290
- package/dist/init/sdk-integration.d.ts +43 -44
- package/dist/init/sdk-integration.js +796 -133
- package/dist/init/sdk-protocol.d.ts +135 -0
- package/dist/init/sdk-protocol.js +152 -0
- package/dist/init/sdk-verification.d.ts +27 -0
- package/dist/init/sdk-verification.js +123 -0
- package/dist/manifest.js +1 -0
- package/dist/output.d.ts +8 -0
- package/dist/output.js +11 -0
- package/dist/schemas.d.ts +34 -0
- package/dist/schemas.js +30 -0
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
- package/skills/moda-cli/SKILL.md +29 -1
- package/dist/init/skill-resolver.d.ts +0 -19
- package/dist/init/skill-resolver.js +0 -78
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// src/init/skill-resolver.ts — deterministic resolution from detected project
|
|
2
|
-
// context to a bundled integration-skill id.
|
|
3
|
-
//
|
|
4
|
-
// Pure function, zero LLM involvement. The table is ordered; the first
|
|
5
|
-
// matching row wins. Wrapper frameworks beat raw providers: if the Vercel AI
|
|
6
|
-
// SDK or LangChain is present, the wrapper layer gets instrumented, never the
|
|
7
|
-
// underlying openai/anthropic client.
|
|
8
|
-
/** The §2.3 resolution table, encoded as data. Order matters. */
|
|
9
|
-
export const RESOLUTION_TABLE = [
|
|
10
|
-
{ language: 'node', framework: 'vercel-ai-sdk', skillId: 'integration-node-vercel-ai-sdk' },
|
|
11
|
-
{ language: 'node', framework: 'langchain', skillId: 'integration-node-langchain' },
|
|
12
|
-
{ language: 'python', framework: 'langchain', skillId: 'integration-python-langchain' },
|
|
13
|
-
{ language: 'python', framework: 'claude-agent-sdk', skillId: 'integration-python-claude-agent-sdk' },
|
|
14
|
-
{ language: 'node', provider: 'openai', skillId: 'integration-node-openai' },
|
|
15
|
-
{ language: 'node', provider: 'anthropic', skillId: 'integration-node-anthropic' },
|
|
16
|
-
{ language: 'python', provider: 'openai', skillId: 'integration-python-openai' },
|
|
17
|
-
{ language: 'python', provider: 'anthropic', skillId: 'integration-python-anthropic' },
|
|
18
|
-
{ language: 'node', skillId: 'integration-node-generic' },
|
|
19
|
-
{ language: 'python', skillId: 'integration-python-generic' },
|
|
20
|
-
];
|
|
21
|
-
/**
|
|
22
|
-
* Resolve the detected context to a bundled skill id, or null when no
|
|
23
|
-
* language was detected (callers fall back to the slim generic guide).
|
|
24
|
-
*/
|
|
25
|
-
export function resolveIntegrationSkillId(context) {
|
|
26
|
-
const languages = normalizeLanguages(context.languages);
|
|
27
|
-
const frameworks = normalizeFrameworks(context.frameworkHints);
|
|
28
|
-
const providers = normalizeProviders(context.providerHints);
|
|
29
|
-
for (const row of RESOLUTION_TABLE) {
|
|
30
|
-
if (!languages.has(row.language))
|
|
31
|
-
continue;
|
|
32
|
-
if (row.framework && !frameworks.has(row.framework))
|
|
33
|
-
continue;
|
|
34
|
-
if (row.provider && !providers.has(row.provider))
|
|
35
|
-
continue;
|
|
36
|
-
return row.skillId;
|
|
37
|
-
}
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
function normalizeLanguages(languages) {
|
|
41
|
-
const result = new Set();
|
|
42
|
-
for (const language of languages) {
|
|
43
|
-
const lower = language.toLowerCase();
|
|
44
|
-
if (lower.includes('node') || lower.includes('typescript') || lower.includes('javascript')) {
|
|
45
|
-
result.add('node');
|
|
46
|
-
}
|
|
47
|
-
if (lower.includes('python'))
|
|
48
|
-
result.add('python');
|
|
49
|
-
}
|
|
50
|
-
return result;
|
|
51
|
-
}
|
|
52
|
-
function normalizeFrameworks(frameworkHints) {
|
|
53
|
-
const result = new Set();
|
|
54
|
-
for (const hint of frameworkHints) {
|
|
55
|
-
const lower = hint.toLowerCase();
|
|
56
|
-
if (lower.includes('vercel ai sdk') || lower.includes('vercel-ai-sdk') || lower.includes('ai sdk')) {
|
|
57
|
-
result.add('vercel-ai-sdk');
|
|
58
|
-
}
|
|
59
|
-
if (lower.includes('langchain') || lower.includes('langgraph'))
|
|
60
|
-
result.add('langchain');
|
|
61
|
-
if (lower.includes('claude agent sdk') || lower.includes('claude-agent-sdk')) {
|
|
62
|
-
result.add('claude-agent-sdk');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
function normalizeProviders(providerHints) {
|
|
68
|
-
const result = new Set();
|
|
69
|
-
for (const hint of providerHints) {
|
|
70
|
-
const lower = hint.toLowerCase();
|
|
71
|
-
if (lower.includes('openai'))
|
|
72
|
-
result.add('openai');
|
|
73
|
-
if (lower.includes('anthropic'))
|
|
74
|
-
result.add('anthropic');
|
|
75
|
-
}
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=skill-resolver.js.map
|