@nexusclawhq/cli 0.3.10 → 0.3.12

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 (42) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/build-info.json +4 -4
  3. package/dist/nexus-cli/src/cli.js +0 -0
  4. package/dist/nexus-cli/src/commands/employee/bundle-candidate.test.js +138 -0
  5. package/dist/nexus-cli/src/commands/employee/bundle-candidate.test.js.map +1 -0
  6. package/dist/nexus-cli/src/commands/employee/bundle.d.ts +1 -0
  7. package/dist/nexus-cli/src/commands/employee/bundle.js +67 -8
  8. package/dist/nexus-cli/src/commands/employee/bundle.js.map +1 -1
  9. package/dist/nexus-cli/src/commands/employee/deploy.e2e.test.js +111 -0
  10. package/dist/nexus-cli/src/commands/employee/deploy.e2e.test.js.map +1 -1
  11. package/dist/nexus-cli/src/commands/employee/deploy.js +60 -1
  12. package/dist/nexus-cli/src/commands/employee/deploy.js.map +1 -1
  13. package/dist/nexus-cli/src/contracts/command-contract.guard.js +1 -0
  14. package/dist/nexus-cli/src/contracts/command-contract.guard.js.map +1 -1
  15. package/dist/nexus-cli/src/contracts/command-contract.registry.js +24 -0
  16. package/dist/nexus-cli/src/contracts/command-contract.registry.js.map +1 -1
  17. package/dist/nexus-cli/src/services/api-client.d.ts +91 -3
  18. package/dist/nexus-cli/src/services/api-client.js +74 -7
  19. package/dist/nexus-cli/src/services/api-client.js.map +1 -1
  20. package/dist/nexus-cli/src/services/api-client.test.js +25 -2
  21. package/dist/nexus-cli/src/services/api-client.test.js.map +1 -1
  22. package/dist/nexus-cli/src/services/workforce-bundle-archive.d.ts +1 -1
  23. package/dist/nexus-cli/src/services/workforce-bundle-remote.d.ts +1 -1
  24. package/dist/nexus-cli/src/services/workforce-remote-operations.d.ts +12 -0
  25. package/dist/nexus-cli/src/services/workforce-remote-operations.js +16 -0
  26. package/dist/nexus-cli/src/services/workforce-remote-operations.js.map +1 -1
  27. package/dist/nexus-cli/src/services/workforce-test-remote.d.ts +2 -3
  28. package/dist/nexus-cli/src/services/workforce-test-remote.js +16 -2
  29. package/dist/nexus-cli/src/services/workforce-test-remote.js.map +1 -1
  30. package/dist/nexus-cli/src/services/workforce-test-remote.test.js +24 -0
  31. package/dist/nexus-cli/src/services/workforce-test-remote.test.js.map +1 -0
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +1 -1
  34. package/dist/nexus-cli/src/services/__env-probe.test.js +0 -13
  35. package/dist/nexus-cli/src/services/__env-probe.test.js.map +0 -1
  36. package/dist/nexus-cli/src/services/ai-authoring-context-v2.pack.e2e.test.js +0 -132
  37. package/dist/nexus-cli/src/services/ai-authoring-context-v2.pack.e2e.test.js.map +0 -1
  38. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/src/components/drill-code-extension-page/index.js +0 -70
  39. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/src/metadata/drill-code-extension-page.manifest.json +0 -63
  40. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/src/tests/drill-code-extension-page.assertions.json +0 -13
  41. /package/dist/nexus-cli/src/{services/__env-probe.test.d.ts → commands/employee/bundle-candidate.test.d.ts} +0 -0
  42. /package/dist/nexus-cli/src/services/{ai-authoring-context-v2.pack.e2e.test.d.ts → workforce-test-remote.test.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexusclawhq/cli",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "files": ["dist", "README.md", "CHANGELOG.md"],
5
5
  "description": "NexusClaw CLI - 元数据管理命令行工具",
6
6
  "main": "dist/nexus-cli/src/cli.js",
@@ -1,13 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_test_1 = __importDefault(require("node:test"));
7
- (0, node_test_1.default)('dump npm env', () => {
8
- const npmEnv = Object.entries(process.env)
9
- .filter(([k]) => k.startsWith('npm_'))
10
- .reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {});
11
- console.log('NPM_ENV:', JSON.stringify(npmEnv, null, 2));
12
- });
13
- //# sourceMappingURL=__env-probe.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"__env-probe.test.js","sourceRoot":"","sources":["../../../../src/services/__env-probe.test.ts"],"names":[],"mappings":";;;;;AAAA,0DAA6B;AAC7B,IAAA,mBAAI,EAAC,cAAc,EAAE,GAAG,EAAE;IACxB,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;SACvC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SACrC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC,CAAC"}
@@ -1,132 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const strict_1 = __importDefault(require("node:assert/strict"));
7
- const node_child_process_1 = require("node:child_process");
8
- const node_fs_1 = __importDefault(require("node:fs"));
9
- const node_os_1 = __importDefault(require("node:os"));
10
- const node_path_1 = __importDefault(require("node:path"));
11
- const node_test_1 = __importDefault(require("node:test"));
12
- const PACKAGE_ROOT = node_path_1.default.resolve(__dirname, '../..');
13
- const RUNNING_INSIDE_PUBLISH = process.env.npm_command === 'publish';
14
- const SKIP_REASON = RUNNING_INSIDE_PUBLISH
15
- ? 'skipped inside npm publish lifecycle (npm reserves the pack operation)'
16
- : null;
17
- function run(cmd, args, opts = { cwd: PACKAGE_ROOT }) {
18
- return (0, node_child_process_1.execFileSync)(cmd, args, {
19
- cwd: opts.cwd,
20
- encoding: 'utf8',
21
- env: { ...process.env, ...(opts.env ?? {}) },
22
- stdio: ['ignore', 'pipe', 'pipe'],
23
- });
24
- }
25
- async function buildTarballInTempDest() {
26
- const dest = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'nexus-pack-dest-'));
27
- const stdout = run('npm', ['pack', '--json', '--pack-destination', dest], {
28
- cwd: PACKAGE_ROOT,
29
- });
30
- const jsonStart = stdout.indexOf('[\n');
31
- let filename;
32
- if (jsonStart !== -1) {
33
- const jsonEnd = stdout.indexOf('\n]\n', jsonStart);
34
- const sliceEnd = jsonEnd === -1 ? stdout.length : jsonEnd + 2;
35
- try {
36
- const parsed = JSON.parse(stdout.slice(jsonStart, sliceEnd));
37
- filename = parsed[0]?.filename;
38
- }
39
- catch {
40
- }
41
- }
42
- if (!filename) {
43
- const tgzLine = stdout
44
- .split('\n')
45
- .map((line) => line.trim())
46
- .filter((line) => line.endsWith('.tgz'))
47
- .pop();
48
- strict_1.default.ok(tgzLine, `npm pack produced no tarball: ${stdout}`);
49
- filename = tgzLine;
50
- }
51
- return { tarballPath: node_path_1.default.join(dest, filename), dest };
52
- }
53
- (0, node_test_1.default)('the npm-packed CLI exports the complete action fixture schema (not a shell)', { timeout: 180_000, skip: SKIP_REASON ?? false }, async () => {
54
- const { tarballPath, dest: packDest } = await buildTarballInTempDest();
55
- strict_1.default.ok(node_fs_1.default.existsSync(tarballPath), `npm pack did not produce a tarball at ${tarballPath}`);
56
- const installRoot = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'nexus-packed-install-'));
57
- try {
58
- run('npm', ['install', '--no-audit', '--no-fund', tarballPath], {
59
- cwd: installRoot,
60
- });
61
- const nexusBin = node_path_1.default.join(installRoot, 'node_modules', '.bin', 'nexus');
62
- strict_1.default.ok(node_fs_1.default.existsSync(nexusBin), 'installed nexus binary not found');
63
- const packDir = node_path_1.default.join(installRoot, 'context');
64
- run(nexusBin, ['ai', 'context', 'export', '--surface', 'code', '--offline', '--workspace', installRoot, '--out', packDir], {
65
- cwd: installRoot,
66
- env: { ...process.env, HOME: process.env.HOME },
67
- });
68
- const schemaPath = node_path_1.default.join(packDir, 'schemas', 'code-action-cases-v1.schema.json');
69
- strict_1.default.ok(node_fs_1.default.existsSync(schemaPath), 'schema file not exported');
70
- const schema = JSON.parse(node_fs_1.default.readFileSync(schemaPath, 'utf8'));
71
- const isShell = typeof schema === 'object' &&
72
- schema !== null &&
73
- Object.keys(schema).length <= 2 &&
74
- schema.type === 'object';
75
- strict_1.default.equal(isShell, false, 'packed CLI exported an anonymous schema shell');
76
- const callsSchema = schema.properties.cases.items.properties.hostFixtures.properties.calls
77
- .items;
78
- const recordsCall = callsSchema.oneOf.find((candidate) => candidate.properties?.namespace?.const === 'records');
79
- strict_1.default.ok(recordsCall, 'records fixture variant missing from packed schema');
80
- strict_1.default.deepEqual(recordsCall.properties.method.enum, [
81
- 'get',
82
- 'query',
83
- 'create',
84
- 'update',
85
- 'delete',
86
- ]);
87
- strict_1.default.equal(recordsCall.properties.method.enum.includes('records.query'), false);
88
- }
89
- finally {
90
- try {
91
- node_fs_1.default.rmSync(installRoot, { recursive: true, force: true });
92
- }
93
- catch {
94
- }
95
- try {
96
- node_fs_1.default.rmSync(packDest, { recursive: true, force: true });
97
- }
98
- catch {
99
- }
100
- }
101
- });
102
- (0, node_test_1.default)('the npm-packed CLI exposes build-info with gitSha and contentDigest', { timeout: 180_000, skip: SKIP_REASON ?? false }, async () => {
103
- const { tarballPath, dest: packDest } = await buildTarballInTempDest();
104
- const installRoot = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'nexus-packed-buildinfo-'));
105
- try {
106
- run('npm', ['install', '--no-audit', '--no-fund', tarballPath], {
107
- cwd: installRoot,
108
- });
109
- const nexusBin = node_path_1.default.join(installRoot, 'node_modules', '.bin', 'nexus');
110
- const output = run(nexusBin, ['--build-info', '--json'], {
111
- cwd: installRoot,
112
- });
113
- const info = JSON.parse(output);
114
- strict_1.default.equal(info.packageName, '@nexusclawhq/cli');
115
- strict_1.default.ok(typeof info.gitSha === 'string' && info.gitSha !== 'unknown');
116
- strict_1.default.match(info.contentDigest, /^sha256:[0-9a-f]{64}$/);
117
- strict_1.default.ok(typeof info.version === 'string' && info.version !== '0.0.0');
118
- }
119
- finally {
120
- try {
121
- node_fs_1.default.rmSync(installRoot, { recursive: true, force: true });
122
- }
123
- catch {
124
- }
125
- try {
126
- node_fs_1.default.rmSync(packDest, { recursive: true, force: true });
127
- }
128
- catch {
129
- }
130
- }
131
- });
132
- //# sourceMappingURL=ai-authoring-context-v2.pack.e2e.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-authoring-context-v2.pack.e2e.test.js","sourceRoot":"","sources":["../../../../src/services/ai-authoring-context-v2.pack.e2e.test.ts"],"names":[],"mappings":";;;;;AAqBA,gEAAwC;AACxC,2DAAkD;AAClD,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAC7B,0DAA6B;AAE7B,MAAM,YAAY,GAAG,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAStD,MAAM,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC;AACrE,MAAM,WAAW,GAAG,sBAAsB;IACxC,CAAC,CAAC,wEAAwE;IAC1E,CAAC,CAAC,IAAI,CAAC;AAET,SAAS,GAAG,CAAC,GAAW,EAAE,IAAc,EAAE,OAAiD,EAAE,GAAG,EAAE,YAAY,EAAE;IAC9G,OAAO,IAAA,iCAAY,EAAC,GAAG,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AAC,EAAE;YAC9D,GAAG,EAAE,WAAW;SACjB,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QACzE,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE;YACvD,GAAG,EAAE,WAAW;SACjB,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAChC,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QACnD,gBAAM,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;QACxE,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC;QAC1D,gBAAM,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IAC1E,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,iBAAE,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;QACD,IAAI,CAAC;YACH,iBAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1,70 +0,0 @@
1
- (() => {
2
- const root = window.NexusExtensionRoot || document.getElementById('root') || document.body;
3
- const context = window.NexusExtensionContext || {};
4
- const accounts = context.datasets?.accounts;
5
- const accountRows = Array.isArray(accounts?.records) ? accounts.records : [];
6
-
7
- const escapeHtml = (value) => String(value ?? '')
8
- .replace(/&/g, '&amp;')
9
- .replace(/</g, '&lt;')
10
- .replace(/>/g, '&gt;')
11
- .replace(/"/g, '&quot;');
12
-
13
- const pick = (record, keys) => {
14
- for (const key of keys) {
15
- const value = record?.[key];
16
- if (value !== undefined && value !== null && value !== '') {
17
- if (typeof value === 'object') return value.name || value.label || value.id || JSON.stringify(value);
18
- return value;
19
- }
20
- }
21
- return '-';
22
- };
23
-
24
- const accountTableRows = accountRows.length > 0
25
- ? accountRows.map((record) => [
26
- '<tr>',
27
- `<td>${escapeHtml(pick(record, ['displayName', 'name', 'Name']))}</td>`,
28
- `<td>${escapeHtml(pick(record, ['industry', 'Industry']))}</td>`,
29
- `<td>${escapeHtml(pick(record, ['phone', 'Phone']))}</td>`,
30
- `<td>${escapeHtml(pick(record, ['ownerId', 'owner']))}</td>`,
31
- '</tr>',
32
- ].join('')).join('')
33
- : '<tr><td colspan="4" style="color:#667085;">No account records returned.</td></tr>';
34
-
35
- root.innerHTML = [
36
- '<main style="font-family:Inter,Arial,sans-serif;color:#172033;background:#f7f9fc;min-height:100%;padding:18px;box-sizing:border-box;">',
37
- '<section style="background:#ffffff;border:1px solid #d7dde8;border-radius:8px;padding:18px;box-shadow:0 6px 18px rgba(19,36,64,0.08);">',
38
- '<div style="font-size:12px;color:#2357c6;font-weight:700;text-transform:uppercase;">Code Extension Bundle Mounted</div>',
39
- '<h1 style="font-size:22px;line-height:1.25;margin:8px 0 6px;">Drill Code Extension Page</h1>',
40
- '<p style="font-size:13px;line-height:1.6;margin:0;color:#4a5568;">Workspace-owned code-extension bundle with governed Account data.</p>',
41
- '<dl style="display:grid;grid-template-columns:140px 1fr;gap:8px 14px;margin:18px 0 0;font-size:13px;">',
42
- '<dt style="font-weight:700;color:#24324a;">Workspace</dt><dd style="margin:0;">E2E-L2-Drill-001</dd>',
43
- '<dt style="font-weight:700;color:#24324a;">Custom object</dt><dd style="margin:0;">drillExtensionPage01</dd>',
44
- '<dt style="font-weight:700;color:#24324a;">Component ID</dt><dd style="margin:0;">drill-code-extension-page</dd>',
45
- '<dt style="font-weight:700;color:#24324a;">Source owner</dt><dd style="margin:0;">workspace project</dd>',
46
- '</dl>',
47
- '<section style="margin-top:18px;">',
48
- '<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px;">',
49
- '<h2 style="font-size:16px;margin:0;">Account records</h2>',
50
- `<span style="font-size:12px;color:#667085;">${escapeHtml(accounts?.loading ? 'Loading' : `${accountRows.length} shown / ${accounts?.totalCount ?? 0} total`)}</span>`,
51
- '</div>',
52
- accounts?.error ? `<div style="border:1px solid #fda29b;background:#fff1f0;color:#b42318;border-radius:6px;padding:10px;font-size:13px;">${escapeHtml(accounts.error)}</div>` : [
53
- '<table style="width:100%;border-collapse:collapse;font-size:13px;background:#fff;">',
54
- '<thead><tr style="background:#f2f5fa;color:#344054;text-align:left;">',
55
- '<th style="padding:8px;border:1px solid #d7dde8;">Name</th>',
56
- '<th style="padding:8px;border:1px solid #d7dde8;">Industry</th>',
57
- '<th style="padding:8px;border:1px solid #d7dde8;">Phone</th>',
58
- '<th style="padding:8px;border:1px solid #d7dde8;">Owner</th>',
59
- '</tr></thead>',
60
- `<tbody>${accountTableRows}</tbody>`,
61
- '</table>',
62
- ].join(''),
63
- '</section>',
64
- '<pre style="white-space:pre-wrap;background:#111827;color:#e5e7eb;border-radius:6px;padding:10px;margin:18px 0 0;font-size:12px;line-height:1.5;">',
65
- escapeHtml(JSON.stringify({ componentId: context.componentId, bundleHash: context.bundleHash, datasets: Object.keys(context.datasets || {}) }, null, 2)),
66
- '</pre>',
67
- '</section>',
68
- '</main>',
69
- ].join('');
70
- })();
@@ -1,63 +0,0 @@
1
- {
2
- "schemaVersion": "workspace-extension-page/v1",
3
- "targetEnvironment": "drill",
4
- "targetWorkspace": "E2E-L2-Drill-001",
5
- "object": {
6
- "apiName": "drillExtensionPage01",
7
- "labelSingular": "Drill Extension Page 01",
8
- "labelPlural": "Drill Extension Page 01s",
9
- "description": "Workspace-owned custom object used by the Drill code-extension page.",
10
- "isCustom": true
11
- },
12
- "component": {
13
- "componentId": "drill-code-extension-page",
14
- "apiName": "drill_code_extension_page",
15
- "name": "Drill Code Extension Page",
16
- "sourcePath": "src/components/drill-code-extension-page/index.js",
17
- "permissions": [
18
- { "type": "ui" },
19
- { "type": "data:read", "scope": ["drillExtensionPage01"] },
20
- { "type": "data:read", "scope": ["account"] }
21
- ]
22
- },
23
- "customPage": {
24
- "apiName": "drill_code_extension_page",
25
- "name": "Drill Code Extension Page",
26
- "type": "APP",
27
- "schema": {
28
- "id": "drill-code-extension-page-schema",
29
- "name": "Drill Code Extension Page",
30
- "type": "app",
31
- "layout": {
32
- "id": "root",
33
- "component": "CodeExtensionFrame",
34
- "props": {
35
- "componentId": "drill-code-extension-page",
36
- "title": "Drill Code Extension Page",
37
- "description": "Rendered from a governed workspace-owned code-extension bundle.",
38
- "minHeight": 620,
39
- "dataSources": [
40
- {
41
- "id": "accounts",
42
- "type": "records",
43
- "label": "Account records",
44
- "config": {
45
- "objectName": "account",
46
- "first": 5,
47
- "orderBy": [{ "name": "AscNullsLast" }]
48
- }
49
- }
50
- ]
51
- }
52
- }
53
- }
54
- },
55
- "menuItem": {
56
- "appApiName": "e2e_drill_app",
57
- "apiName": "drill_tab_code_extension_page",
58
- "name": "Code Extension Page",
59
- "type": "PAGE",
60
- "position": 4,
61
- "isActive": true
62
- }
63
- }
@@ -1,13 +0,0 @@
1
- {
2
- "schemaVersion": "workspace-runtime-assertions/v1",
3
- "targetWorkspace": "E2E-L2-Drill-001",
4
- "expectedVisibleText": [
5
- "Code Extension Bundle Mounted",
6
- "Account records",
7
- "Name",
8
- "drillExtensionPage01",
9
- "E2E-L2-Drill-001"
10
- ],
11
- "expectedMenuItemApiName": "drill_tab_code_extension_page",
12
- "expectedComponentId": "drill-code-extension-page"
13
- }