@inkeep/agents-cli 0.50.6 → 0.52.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/dist/agents-cli/package.js +6 -0
- package/dist/commands/config.js +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/pull-v3/component-parser.js +4 -10
- package/dist/commands/pull-v4/agent-generator.js +274 -0
- package/dist/commands/pull-v4/artifact-component-generator.js +69 -0
- package/dist/commands/pull-v4/context-config-generator.js +264 -0
- package/dist/commands/pull-v4/credential-generator.js +30 -0
- package/dist/commands/pull-v4/data-component-generator.js +50 -0
- package/dist/commands/pull-v4/environment-generator.js +123 -0
- package/dist/commands/pull-v4/external-agent-generator.js +56 -0
- package/dist/commands/pull-v4/function-tool-generator.js +48 -0
- package/dist/commands/pull-v4/introspect/index.js +365 -0
- package/dist/commands/pull-v4/introspect/test-helpers.js +143 -0
- package/dist/commands/pull-v4/introspect-generator.js +691 -0
- package/dist/commands/pull-v4/mcp-tool-generator.js +91 -0
- package/dist/commands/pull-v4/module-merge.js +379 -0
- package/dist/commands/pull-v4/project-generator.js +101 -0
- package/dist/commands/pull-v4/status-component-generator.js +35 -0
- package/dist/commands/pull-v4/sub-agent-generator.js +168 -0
- package/dist/commands/pull-v4/trigger-generator.js +58 -0
- package/dist/commands/pull-v4/utils.js +219 -0
- package/dist/commands/push.js +1 -1
- package/dist/commands/update.js +2 -2
- package/dist/index.js +18 -44
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.js +18 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.js +180 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.js +8 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/css.js +12 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/json.js +60 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/line.js +37 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/sentence.js +31 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/word.js +118 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/index.js +11 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/patch/create.js +141 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/util/string.js +63 -0
- package/dist/utils/ci-environment.js +1 -1
- package/dist/utils/config.js +1 -1
- package/dist/utils/environment-loader.js +1 -1
- package/dist/utils/file-finder.js +1 -1
- package/dist/utils/mcp-runner.js +1 -1
- package/dist/utils/profile-config.js +1 -1
- package/dist/utils/profiles/profile-manager.js +1 -1
- package/dist/utils/project-directory.js +1 -1
- package/dist/utils/project-loader.js +1 -1
- package/dist/utils/version-check.js +6 -15
- package/package.json +5 -4
- package/dist/commands/pull-v3/component-updater.js +0 -768
- package/dist/commands/pull-v3/components/agent-generator.js +0 -255
- package/dist/commands/pull-v3/components/artifact-component-generator.js +0 -143
- package/dist/commands/pull-v3/components/context-config-generator.js +0 -190
- package/dist/commands/pull-v3/components/credential-generator.js +0 -89
- package/dist/commands/pull-v3/components/data-component-generator.js +0 -102
- package/dist/commands/pull-v3/components/environment-generator.js +0 -173
- package/dist/commands/pull-v3/components/external-agent-generator.js +0 -75
- package/dist/commands/pull-v3/components/function-tool-generator.js +0 -92
- package/dist/commands/pull-v3/components/mcp-tool-generator.js +0 -86
- package/dist/commands/pull-v3/components/project-generator.js +0 -157
- package/dist/commands/pull-v3/components/status-component-generator.js +0 -92
- package/dist/commands/pull-v3/components/sub-agent-generator.js +0 -295
- package/dist/commands/pull-v3/components/trigger-generator.js +0 -185
- package/dist/commands/pull-v3/index.js +0 -510
- package/dist/commands/pull-v3/introspect-generator.js +0 -286
- package/dist/commands/pull-v3/llm-content-merger.js +0 -192
- package/dist/commands/pull-v3/new-component-generator.js +0 -279
- package/dist/commands/pull-v3/project-index-generator.js +0 -32
- package/dist/commands/pull-v3/project-validator.js +0 -358
- package/dist/utils/url.js +0 -26
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { createTwoFilesPatch } from "../../../node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/patch/create.js";
|
|
2
|
+
import "../../../node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/index.js";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
|
|
7
|
+
//#region src/commands/pull-v4/introspect/test-helpers.ts
|
|
8
|
+
const beforeCredentialContent = `import { credential } from '@inkeep/agents-sdk';
|
|
9
|
+
|
|
10
|
+
const keepMe = () => 'keep-me';
|
|
11
|
+
|
|
12
|
+
export const apiCredentials = credential({
|
|
13
|
+
id: 'api-credentials',
|
|
14
|
+
name: 'Old API Credentials',
|
|
15
|
+
type: 'bearer',
|
|
16
|
+
credentialStoreId: 'main-store'
|
|
17
|
+
});
|
|
18
|
+
`.trimStart();
|
|
19
|
+
function createTestEnvironment() {
|
|
20
|
+
const testDir = join(tmpdir(), `introspect-v4-test-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`);
|
|
21
|
+
fs.mkdirSync(testDir, { recursive: true });
|
|
22
|
+
return {
|
|
23
|
+
testDir,
|
|
24
|
+
projectPaths: {
|
|
25
|
+
projectRoot: testDir,
|
|
26
|
+
agentsDir: join(testDir, "agents"),
|
|
27
|
+
toolsDir: join(testDir, "tools"),
|
|
28
|
+
dataComponentsDir: join(testDir, "data-components"),
|
|
29
|
+
artifactComponentsDir: join(testDir, "artifact-components"),
|
|
30
|
+
statusComponentsDir: join(testDir, "status-components"),
|
|
31
|
+
environmentsDir: join(testDir, "environments"),
|
|
32
|
+
credentialsDir: join(testDir, "credentials"),
|
|
33
|
+
contextConfigsDir: join(testDir, "context-configs"),
|
|
34
|
+
externalAgentsDir: join(testDir, "external-agents")
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function cleanupTestEnvironment(testDir) {
|
|
39
|
+
fs.rmSync(testDir, {
|
|
40
|
+
recursive: true,
|
|
41
|
+
force: true
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function getTestPath() {
|
|
45
|
+
return `../__snapshots__/introspect/${expect.getState().currentTestName?.split(" > ").at(-1)}`;
|
|
46
|
+
}
|
|
47
|
+
function createProjectFixture() {
|
|
48
|
+
return {
|
|
49
|
+
id: "support-project",
|
|
50
|
+
name: "Support Project",
|
|
51
|
+
description: "Support project for introspect v4 tests",
|
|
52
|
+
models: { base: { model: "gpt-4o-mini" } },
|
|
53
|
+
credentialReferences: { "api-credentials": {
|
|
54
|
+
id: "api-credentials",
|
|
55
|
+
name: "API Credentials",
|
|
56
|
+
type: "bearer",
|
|
57
|
+
credentialStoreId: "main-store",
|
|
58
|
+
retrievalParams: { key: "token" }
|
|
59
|
+
} },
|
|
60
|
+
dataComponents: { "customer-profile": {
|
|
61
|
+
id: "customer-profile",
|
|
62
|
+
name: "Customer Profile",
|
|
63
|
+
description: "Customer profile data component",
|
|
64
|
+
props: {
|
|
65
|
+
type: "object",
|
|
66
|
+
properties: {
|
|
67
|
+
fullName: { type: "string" },
|
|
68
|
+
avatarUrl: { type: "string" }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
render: {
|
|
72
|
+
component: "<img src=\"{{avatarUrl}}\" alt=\"{{fullName}}\" />",
|
|
73
|
+
mockData: {
|
|
74
|
+
fullName: "Ada Lovelace",
|
|
75
|
+
avatarUrl: "https://example.com/avatar.png"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} },
|
|
79
|
+
artifactComponents: { "ticket-summary": {
|
|
80
|
+
id: "ticket-summary",
|
|
81
|
+
name: "Ticket Summary",
|
|
82
|
+
props: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: { title: { type: "string" } }
|
|
85
|
+
}
|
|
86
|
+
} },
|
|
87
|
+
agents: { "support-agent": {
|
|
88
|
+
id: "support-agent",
|
|
89
|
+
name: "Support Agent",
|
|
90
|
+
defaultSubAgentId: "tier-one",
|
|
91
|
+
subAgents: { "tier-one": {
|
|
92
|
+
id: "tier-one",
|
|
93
|
+
name: "Tier One"
|
|
94
|
+
} },
|
|
95
|
+
contextConfig: {
|
|
96
|
+
id: "support-context",
|
|
97
|
+
headersSchema: {
|
|
98
|
+
type: "object",
|
|
99
|
+
properties: { user_id: { type: "string" } }
|
|
100
|
+
},
|
|
101
|
+
contextVariables: { userInfo: {
|
|
102
|
+
id: "user-info",
|
|
103
|
+
name: "User Information",
|
|
104
|
+
trigger: "initialization",
|
|
105
|
+
fetchConfig: {
|
|
106
|
+
url: "https://api.example.com/users/${headersSchema.toTemplate(\"user_id\")}",
|
|
107
|
+
method: "GET"
|
|
108
|
+
},
|
|
109
|
+
responseSchema: {
|
|
110
|
+
type: "object",
|
|
111
|
+
properties: { name: { type: "string" } }
|
|
112
|
+
},
|
|
113
|
+
defaultValue: "Unable to fetch user information"
|
|
114
|
+
} }
|
|
115
|
+
},
|
|
116
|
+
triggers: { "github-webhook": {
|
|
117
|
+
id: "github-webhook",
|
|
118
|
+
name: "GitHub Webhook",
|
|
119
|
+
messageTemplate: "New webhook event"
|
|
120
|
+
} },
|
|
121
|
+
statusUpdates: {
|
|
122
|
+
numEvents: 1,
|
|
123
|
+
statusComponents: [{
|
|
124
|
+
id: "tool-summary",
|
|
125
|
+
type: "tool_summary",
|
|
126
|
+
description: "Tool summary status component",
|
|
127
|
+
detailsSchema: {
|
|
128
|
+
type: "object",
|
|
129
|
+
properties: { tool_name: { type: "string" } }
|
|
130
|
+
}
|
|
131
|
+
}]
|
|
132
|
+
}
|
|
133
|
+
} },
|
|
134
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
135
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
async function createUnifiedDiff(filePath, before, after) {
|
|
139
|
+
return createTwoFilesPatch(filePath, filePath, before, after, "before", "after", { context: 3 });
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
//#endregion
|
|
143
|
+
export { beforeCredentialContent, cleanupTestEnvironment, createProjectFixture, createTestEnvironment, createUnifiedDiff, getTestPath };
|