@ai-primitives-hub/core 0.1.0 → 0.2.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/domain/bundle/id.d.ts +58 -7
- package/dist/domain/bundle/id.d.ts.map +1 -1
- package/dist/domain/bundle/id.js +68 -7
- package/dist/domain/bundle/id.js.map +1 -1
- package/dist/domain/bundle/types.d.ts +50 -0
- package/dist/domain/bundle/types.d.ts.map +1 -1
- package/dist/domain/bundle/types.js +110 -0
- package/dist/domain/bundle/types.js.map +1 -1
- package/dist/domain/bundle/version.d.ts +10 -0
- package/dist/domain/bundle/version.d.ts.map +1 -1
- package/dist/domain/bundle/version.js +21 -0
- package/dist/domain/bundle/version.js.map +1 -1
- package/dist/domain/collection/manifest-validator.d.ts +11 -3
- package/dist/domain/collection/manifest-validator.d.ts.map +1 -1
- package/dist/domain/collection/manifest-validator.js +13 -1
- package/dist/domain/collection/manifest-validator.js.map +1 -1
- package/dist/domain/collection/release-manifest-plan.d.ts +75 -0
- package/dist/domain/collection/release-manifest-plan.d.ts.map +1 -0
- package/dist/domain/collection/release-manifest-plan.js +476 -0
- package/dist/domain/collection/release-manifest-plan.js.map +1 -0
- package/dist/domain/hub/replicate.d.ts +58 -0
- package/dist/domain/hub/replicate.d.ts.map +1 -0
- package/dist/domain/hub/replicate.js +229 -0
- package/dist/domain/hub/replicate.js.map +1 -0
- package/dist/domain/hub/types.d.ts +10 -4
- package/dist/domain/hub/types.d.ts.map +1 -1
- package/dist/domain/hub/validate.d.ts +5 -0
- package/dist/domain/hub/validate.d.ts.map +1 -1
- package/dist/domain/hub/validate.js +32 -3
- package/dist/domain/hub/validate.js.map +1 -1
- package/dist/domain/index.d.ts +6 -0
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +6 -0
- package/dist/domain/index.js.map +1 -1
- package/dist/domain/install/installable.d.ts +1 -1
- package/dist/domain/install/installable.d.ts.map +1 -1
- package/dist/domain/install/integrity.d.ts +12 -18
- package/dist/domain/install/integrity.d.ts.map +1 -1
- package/dist/domain/install/integrity.js +28 -5
- package/dist/domain/install/integrity.js.map +1 -1
- package/dist/domain/install/layout.d.ts +15 -0
- package/dist/domain/install/layout.d.ts.map +1 -1
- package/dist/domain/install/layout.js +18 -7
- package/dist/domain/install/layout.js.map +1 -1
- package/dist/domain/mcp/env-placeholders.d.ts +29 -0
- package/dist/domain/mcp/env-placeholders.d.ts.map +1 -0
- package/dist/domain/mcp/env-placeholders.js +32 -0
- package/dist/domain/mcp/env-placeholders.js.map +1 -0
- package/dist/domain/mcp/index.d.ts +1 -0
- package/dist/domain/mcp/index.d.ts.map +1 -1
- package/dist/domain/mcp/index.js +1 -0
- package/dist/domain/mcp/index.js.map +1 -1
- package/dist/domain/plugin/agent-plugin-spec.d.ts +75 -0
- package/dist/domain/plugin/agent-plugin-spec.d.ts.map +1 -0
- package/dist/domain/plugin/agent-plugin-spec.js +270 -0
- package/dist/domain/plugin/agent-plugin-spec.js.map +1 -0
- package/dist/domain/registry-error.d.ts +1 -1
- package/dist/domain/registry-error.d.ts.map +1 -1
- package/dist/domain/registry-error.js +1 -1
- package/dist/domain/registry-error.js.map +1 -1
- package/dist/domain/source/artifactory-source-index.d.ts +58 -0
- package/dist/domain/source/artifactory-source-index.d.ts.map +1 -0
- package/dist/domain/source/artifactory-source-index.js +175 -0
- package/dist/domain/source/artifactory-source-index.js.map +1 -0
- package/dist/domain/source/github-repository-target.d.ts +16 -0
- package/dist/domain/source/github-repository-target.d.ts.map +1 -0
- package/dist/domain/source/github-repository-target.js +3 -0
- package/dist/domain/source/github-repository-target.js.map +1 -0
- package/dist/domain/source/github-source-authentication.d.ts +6 -0
- package/dist/domain/source/github-source-authentication.d.ts.map +1 -0
- package/dist/domain/source/github-source-authentication.js +3 -0
- package/dist/domain/source/github-source-authentication.js.map +1 -0
- package/dist/domain/source/types.d.ts +9 -2
- package/dist/domain/source/types.d.ts.map +1 -1
- package/dist/domain/source-id.d.ts +6 -3
- package/dist/domain/source-id.d.ts.map +1 -1
- package/dist/domain/source-id.js +14 -11
- package/dist/domain/source-id.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/ports/github-api.d.ts +4 -0
- package/dist/ports/github-api.d.ts.map +1 -1
- package/dist/ports/http-credentials.d.ts +10 -0
- package/dist/ports/http-credentials.d.ts.map +1 -0
- package/dist/ports/http-credentials.js +3 -0
- package/dist/ports/http-credentials.js.map +1 -0
- package/dist/ports/http.d.ts +6 -2
- package/dist/ports/http.d.ts.map +1 -1
- package/dist/ports/http.js +0 -9
- package/dist/ports/http.js.map +1 -1
- package/dist/ports/index.d.ts +3 -0
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js +3 -0
- package/dist/ports/index.js.map +1 -1
- package/dist/ports/process-executor.d.ts +13 -0
- package/dist/ports/process-executor.d.ts.map +1 -0
- package/dist/ports/process-executor.js +3 -0
- package/dist/ports/process-executor.js.map +1 -0
- package/dist/ports/registry-operations.d.ts +91 -4
- package/dist/ports/registry-operations.d.ts.map +1 -1
- package/dist/ports/release-source.d.ts +52 -0
- package/dist/ports/release-source.d.ts.map +1 -0
- package/dist/ports/release-source.js +3 -0
- package/dist/ports/release-source.js.map +1 -0
- package/dist/ports/target-writer.d.ts +15 -1
- package/dist/ports/target-writer.d.ts.map +1 -1
- package/dist/public/schemas/agent-plugins/1.0.0/plugin.schema.json +65 -0
- package/dist/public/schemas/artifactory-source-index.schema.json +44 -0
- package/dist/public/schemas/hub-config.schema.json +18 -3
- package/dist/public/schemas/lockfile.schema.json +37 -2
- package/package.json +3 -3
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ValidationResult } from './types';
|
|
2
|
+
export interface PublishedObject {
|
|
3
|
+
path: string;
|
|
4
|
+
size: number;
|
|
5
|
+
sha256: string;
|
|
6
|
+
mediaType?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ArtifactoryDependency {
|
|
9
|
+
bundleId: string;
|
|
10
|
+
versionRange: string;
|
|
11
|
+
optional: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ArtifactoryBundleIndexEntry {
|
|
14
|
+
id: string;
|
|
15
|
+
version: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
author: string;
|
|
19
|
+
environments: string[];
|
|
20
|
+
tags: string[];
|
|
21
|
+
lastUpdated: string;
|
|
22
|
+
dependencies: ArtifactoryDependency[];
|
|
23
|
+
homepage?: string;
|
|
24
|
+
repository?: string;
|
|
25
|
+
license: string;
|
|
26
|
+
manifest: PublishedObject;
|
|
27
|
+
archive: PublishedObject;
|
|
28
|
+
readme?: PublishedObject;
|
|
29
|
+
canonicalSource?: string;
|
|
30
|
+
revision?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ArtifactorySourceIndex {
|
|
33
|
+
formatVersion: 1;
|
|
34
|
+
source: {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
};
|
|
40
|
+
bundles: ArtifactoryBundleIndexEntry[];
|
|
41
|
+
}
|
|
42
|
+
/** Provider-neutral aliases for consumers that do not expose the backend name. */
|
|
43
|
+
export type PublishedBundleIndex = ArtifactorySourceIndex;
|
|
44
|
+
export type PublishedBundleIndexEntry = ArtifactoryBundleIndexEntry;
|
|
45
|
+
export declare const isValidSemVer: (version: string) => boolean;
|
|
46
|
+
export declare const compareSemVer: (a: string, b: string) => number;
|
|
47
|
+
/**
|
|
48
|
+
* Validate an Artifactory source index, including invariants not expressible in JSON Schema.
|
|
49
|
+
* @param input
|
|
50
|
+
* @param expectedSourceId
|
|
51
|
+
*/
|
|
52
|
+
export declare const validateArtifactorySourceIndex: (input: unknown, expectedSourceId?: string | {
|
|
53
|
+
hubSourceId?: string;
|
|
54
|
+
}) => ValidationResult;
|
|
55
|
+
export declare const validatePublishedBundleIndex: (input: unknown, expectedSourceId?: string | {
|
|
56
|
+
hubSourceId?: string;
|
|
57
|
+
}) => ValidationResult;
|
|
58
|
+
//# sourceMappingURL=artifactory-source-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifactory-source-index.d.ts","sourceRoot":"","sources":["../../../src/domain/source/artifactory-source-index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AACD,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,qBAAqB,EAAE,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,CAAC,CAAC;IACjB,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9E,OAAO,EAAE,2BAA2B,EAAE,CAAC;CACxC;AAED,kFAAkF;AAClF,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAC1D,MAAM,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AAEpE,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,OAAwE,CAAC;AACzH,eAAO,MAAM,aAAa,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAA8B,CAAC;AAqCpF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GAAI,OAAO,OAAO,EAAE,mBAAmB,MAAM,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,gBAkGrH,CAAC;AAEF,eAAO,MAAM,4BAA4B,UApGa,OAAO,qBAAqB,MAAM,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,gBAoG5C,CAAC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.validatePublishedBundleIndex = exports.validateArtifactorySourceIndex = exports.compareSemVer = exports.isValidSemVer = void 0;
|
|
37
|
+
/** Provider-neutral published bundle index contract used by Artifactory sources. */
|
|
38
|
+
const semver = __importStar(require("semver"));
|
|
39
|
+
const isValidSemVer = (version) => typeof version === 'string' && semver.valid(version) !== null;
|
|
40
|
+
exports.isValidSemVer = isValidSemVer;
|
|
41
|
+
const compareSemVer = (a, b) => semver.compare(a, b);
|
|
42
|
+
exports.compareSemVer = compareSemVer;
|
|
43
|
+
const RELATIVE_PATH = /^(?!\/)(?!.*%)(?!.*\\)(?!.*(?:^|\/)\.\.(?:\/|$))(?![a-zA-Z][a-zA-Z0-9+.-]*:).+$/;
|
|
44
|
+
const SHA256 = /^[a-f0-9]{64}$/;
|
|
45
|
+
const isRecord = (value) => typeof value === 'object' && value !== null;
|
|
46
|
+
const required = (value, fields, prefix, errors) => {
|
|
47
|
+
for (const field of fields) {
|
|
48
|
+
if (!(field in value)) {
|
|
49
|
+
errors.push(`${prefix}.${field} is required`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const noUnknown = (value, allowed, prefix, errors) => {
|
|
54
|
+
for (const key of Object.keys(value)) {
|
|
55
|
+
if (!allowed.includes(key)) {
|
|
56
|
+
errors.push(`${prefix}.${key} is not allowed`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const objectErrors = (value, prefix, errors) => {
|
|
61
|
+
if (!isRecord(value)) {
|
|
62
|
+
errors.push(`${prefix} must be an object`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
noUnknown(value, ['path', 'size', 'sha256', 'mediaType'], prefix, errors);
|
|
66
|
+
required(value, ['path', 'size', 'sha256'], prefix, errors);
|
|
67
|
+
if (typeof value.path !== 'string' || !RELATIVE_PATH.test(value.path)) {
|
|
68
|
+
errors.push(`${prefix}.path must be a safe relative path`);
|
|
69
|
+
}
|
|
70
|
+
if (!Number.isInteger(value.size) || value.size < 0) {
|
|
71
|
+
errors.push(`${prefix}.size must be a non-negative integer`);
|
|
72
|
+
}
|
|
73
|
+
if (typeof value.sha256 !== 'string' || !SHA256.test(value.sha256)) {
|
|
74
|
+
errors.push(`${prefix}.sha256 must be 64 lowercase hexadecimal characters`);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Validate an Artifactory source index, including invariants not expressible in JSON Schema.
|
|
79
|
+
* @param input
|
|
80
|
+
* @param expectedSourceId
|
|
81
|
+
*/
|
|
82
|
+
const validateArtifactorySourceIndex = (input, expectedSourceId) => {
|
|
83
|
+
const configuredSourceId = typeof expectedSourceId === 'string' ? expectedSourceId : expectedSourceId?.hubSourceId;
|
|
84
|
+
const errors = [];
|
|
85
|
+
if (!isRecord(input)) {
|
|
86
|
+
return { valid: false, errors: ['index must be an object'] };
|
|
87
|
+
}
|
|
88
|
+
noUnknown(input, ['formatVersion', 'source', 'bundles'], 'index', errors);
|
|
89
|
+
if (input.formatVersion !== 1) {
|
|
90
|
+
errors.push('formatVersion must be 1');
|
|
91
|
+
}
|
|
92
|
+
const source = input.source;
|
|
93
|
+
if (isRecord(source)) {
|
|
94
|
+
noUnknown(source, ['id', 'name', 'description', 'updatedAt'], 'source', errors);
|
|
95
|
+
required(source, ['id', 'name', 'updatedAt'], 'source', errors);
|
|
96
|
+
if (typeof source.id !== 'string' || !/^[a-zA-Z0-9_-]{1,50}$/.test(source.id)) {
|
|
97
|
+
errors.push('source.id is invalid');
|
|
98
|
+
}
|
|
99
|
+
if (typeof source.name !== 'string' || source.name.length === 0 || source.name.length > 100) {
|
|
100
|
+
errors.push('source.name is invalid');
|
|
101
|
+
}
|
|
102
|
+
if (typeof source.updatedAt !== 'string' || Number.isNaN(Date.parse(source.updatedAt))) {
|
|
103
|
+
errors.push('source.updatedAt is invalid');
|
|
104
|
+
}
|
|
105
|
+
if (configuredSourceId !== undefined && source.id !== configuredSourceId) {
|
|
106
|
+
errors.push('source.id does not match the configured hub source id');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
errors.push('source is required and must be an object');
|
|
111
|
+
}
|
|
112
|
+
if (Array.isArray(input.bundles)) {
|
|
113
|
+
const identities = new Set();
|
|
114
|
+
input.bundles.forEach((bundle, index) => {
|
|
115
|
+
const prefix = `bundles[${index}]`;
|
|
116
|
+
if (!isRecord(bundle)) {
|
|
117
|
+
errors.push(`${prefix} must be an object`);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
noUnknown(bundle, [
|
|
121
|
+
'id', 'version', 'name', 'description', 'author', 'environments', 'tags',
|
|
122
|
+
'lastUpdated', 'dependencies', 'homepage', 'repository', 'license', 'manifest',
|
|
123
|
+
'archive', 'readme', 'canonicalSource', 'revision'
|
|
124
|
+
], prefix, errors);
|
|
125
|
+
required(bundle, ['id', 'version', 'name', 'description', 'author', 'environments', 'tags',
|
|
126
|
+
'lastUpdated', 'dependencies', 'license', 'manifest', 'archive'], prefix, errors);
|
|
127
|
+
if (typeof bundle.id !== 'string' || !/^[\w.-]{1,200}$/.test(bundle.id)) {
|
|
128
|
+
errors.push(`${prefix}.id is invalid`);
|
|
129
|
+
}
|
|
130
|
+
if (typeof bundle.version !== 'string' || !(0, exports.isValidSemVer)(bundle.version)) {
|
|
131
|
+
errors.push(`${prefix}.version is not valid SemVer`);
|
|
132
|
+
}
|
|
133
|
+
const identity = `${String(bundle.id)}\0${String(bundle.version)}`;
|
|
134
|
+
if (identities.has(identity)) {
|
|
135
|
+
errors.push(`duplicate bundle id/version: ${bundle.id}@${bundle.version}`);
|
|
136
|
+
}
|
|
137
|
+
identities.add(identity);
|
|
138
|
+
for (const field of ['name', 'description', 'author', 'license']) {
|
|
139
|
+
if (typeof bundle[field] !== 'string') {
|
|
140
|
+
errors.push(`${prefix}.${field} is required`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
for (const field of ['environments', 'tags', 'dependencies']) {
|
|
144
|
+
if (!Array.isArray(bundle[field])) {
|
|
145
|
+
errors.push(`${prefix}.${field} must be an array`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
objectErrors(bundle.manifest, `${prefix}.manifest`, errors);
|
|
149
|
+
objectErrors(bundle.archive, `${prefix}.archive`, errors);
|
|
150
|
+
if (isRecord(bundle.archive) && bundle.archive.mediaType !== 'application/zip') {
|
|
151
|
+
errors.push(`${prefix}.archive.mediaType must be application/zip`);
|
|
152
|
+
}
|
|
153
|
+
if (bundle.readme !== undefined) {
|
|
154
|
+
objectErrors(bundle.readme, `${prefix}.readme`, errors);
|
|
155
|
+
}
|
|
156
|
+
const paths = [bundle.manifest, bundle.archive, bundle.readme]
|
|
157
|
+
.filter((object) => isRecord(object))
|
|
158
|
+
.map((object) => object.path);
|
|
159
|
+
if (new Set(paths).size !== paths.length) {
|
|
160
|
+
errors.push(`${prefix} object paths must be distinct`);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
errors.push('bundles is required and must be an array');
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
valid: errors.length === 0,
|
|
169
|
+
errors,
|
|
170
|
+
bundlesFound: Array.isArray(input.bundles) ? input.bundles.length : 0
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
exports.validateArtifactorySourceIndex = validateArtifactorySourceIndex;
|
|
174
|
+
exports.validatePublishedBundleIndex = exports.validateArtifactorySourceIndex;
|
|
175
|
+
//# sourceMappingURL=artifactory-source-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifactory-source-index.js","sourceRoot":"","sources":["../../../src/domain/source/artifactory-source-index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAAoF;AACpF,+CAAiC;AA6C1B,MAAM,aAAa,GAAG,CAAC,OAAe,EAAW,EAAE,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AAA5G,QAAA,aAAa,iBAA+F;AAClH,MAAM,aAAa,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAAvE,QAAA,aAAa,iBAA0D;AAEpF,MAAM,aAAa,GAAG,iFAAiF,CAAC;AACxG,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAChC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACnH,MAAM,QAAQ,GAAG,CAAC,KAA8B,EAAE,MAAyB,EAAE,MAAc,EAAE,MAAgB,EAAE,EAAE;IAC/G,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI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,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;iBACvE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;gBACzC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,gCAAgC,CAAC,CAAC;YACzD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM;QACN,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KACtE,CAAC;AACJ,CAAC,CAAC;AAlGW,QAAA,8BAA8B,kCAkGzC;AAEW,QAAA,4BAA4B,GAAG,sCAA8B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical repository context for a GitHub-backed source.
|
|
3
|
+
*
|
|
4
|
+
* The request host and repository host are intentionally separate: a request
|
|
5
|
+
* can target `api.github.com` or `raw.githubusercontent.com` while a
|
|
6
|
+
* repository-scoped credential must still be minted for `github.com/owner/repository`.
|
|
7
|
+
*/
|
|
8
|
+
export interface GitHubRepositoryTarget {
|
|
9
|
+
/** Host used when addressing the repository for authentication purposes. */
|
|
10
|
+
host: string;
|
|
11
|
+
/** Repository owner or organization. */
|
|
12
|
+
owner: string;
|
|
13
|
+
/** Repository name. */
|
|
14
|
+
repository: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=github-repository-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-repository-target.d.ts","sourceRoot":"","sources":["../../../src/domain/source/github-repository-target.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-repository-target.js","sourceRoot":"","sources":["../../../src/domain/source/github-repository-target.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-level authentication outcomes produced by GitHub preflight.
|
|
3
|
+
* @module domain/source/github-source-authentication
|
|
4
|
+
*/
|
|
5
|
+
export type GitHubSourceAuthCategory = 'public-anonymous' | 'public-generic' | 'app-authenticated' | 'unresolved';
|
|
6
|
+
//# sourceMappingURL=github-source-authentication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-source-authentication.d.ts","sourceRoot":"","sources":["../../../src/domain/source/github-source-authentication.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,kBAAkB,GAClB,gBAAgB,GAChB,mBAAmB,GACnB,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-source-authentication.js","sourceRoot":"","sources":["../../../src/domain/source/github-source-authentication.ts"],"names":[],"mappings":""}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
/**
|
|
13
13
|
* All source adapter types known to the registry.
|
|
14
14
|
*/
|
|
15
|
-
export type SourceType = 'github' | 'local' | 'awesome-copilot' | 'local-awesome-copilot' | 'apm' | 'local-apm' | 'skills' | 'local-skills' | 'azure-devops';
|
|
15
|
+
export type SourceType = 'github' | 'local' | 'awesome-copilot' | 'local-awesome-copilot' | 'apm' | 'local-apm' | 'skills' | 'local-skills' | 'azure-devops' | 'artifactory';
|
|
16
16
|
/**
|
|
17
17
|
* A configured bundle source.
|
|
18
18
|
*/
|
|
@@ -28,6 +28,13 @@ export interface RegistrySource {
|
|
|
28
28
|
token?: string;
|
|
29
29
|
/** Hub identifier, when this source was provisioned by a curated hub. */
|
|
30
30
|
hubId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The hub config `sources[].id` this source was provisioned from — the
|
|
33
|
+
* stable, author-assigned identity that survives a `url` change. Used to
|
|
34
|
+
* match a pre-rename orphan to its replacement. Absent on manually-added
|
|
35
|
+
* sources and on hub sources persisted before this field existed.
|
|
36
|
+
*/
|
|
37
|
+
hubSourceId?: string;
|
|
31
38
|
metadata?: {
|
|
32
39
|
description?: string;
|
|
33
40
|
homepage?: string;
|
|
@@ -38,7 +45,7 @@ export interface RegistrySource {
|
|
|
38
45
|
branch?: string;
|
|
39
46
|
/** Collections directory, for awesome-copilot sources. */
|
|
40
47
|
collectionsPath?: string;
|
|
41
|
-
/** Index file name, for awesome-copilot sources. */
|
|
48
|
+
/** Index file name, for awesome-copilot and Artifactory sources. */
|
|
42
49
|
indexFile?: string;
|
|
43
50
|
[key: string]: unknown;
|
|
44
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/domain/source/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,OAAO,GACP,iBAAiB,GACjB,uBAAuB,GACvB,KAAK,GACL,WAAW,GACX,QAAQ,GACR,cAAc,GACd,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/domain/source/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,OAAO,GACP,iBAAiB,GACjB,uBAAuB,GACvB,KAAK,GACL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;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -6,6 +6,8 @@ export interface SourceIdConfig {
|
|
|
6
6
|
branch?: string;
|
|
7
7
|
/** Path to the collections directory. Defaults to 'collections'. */
|
|
8
8
|
collectionsPath?: string;
|
|
9
|
+
/** Artifactory source index path. Defaults to 'index-v1.json'. */
|
|
10
|
+
indexFile?: string;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Lowercase host + path; strip protocol + trailing slashes.
|
|
@@ -13,15 +15,16 @@ export interface SourceIdConfig {
|
|
|
13
15
|
* Falls back to a regex-based normalization when `URL` parsing fails
|
|
14
16
|
* (matches the extension's behaviour for invalid URLs).
|
|
15
17
|
* @param url Raw URL.
|
|
18
|
+
* @param preservePathCase
|
|
16
19
|
* @returns Normalized URL string.
|
|
17
20
|
*/
|
|
18
|
-
export declare const normalizeUrl: (url: string) => string;
|
|
21
|
+
export declare const normalizeUrl: (url: string, preservePathCase?: boolean) => string;
|
|
19
22
|
/**
|
|
20
23
|
* Generate a stable sourceId of the form `{type}-{12hex}`.
|
|
21
24
|
*
|
|
22
25
|
* The hash includes (sourceType, normalizedUrl, branch,
|
|
23
|
-
* collectionsPath)
|
|
24
|
-
* id regardless of how the user typed the URL.
|
|
26
|
+
* collectionsPath), plus indexFile for Artifactory, so that the same
|
|
27
|
+
* logical source maps to the same id regardless of how the user typed the URL.
|
|
25
28
|
* @param sourceType e.g. 'github', 'awesome-copilot', 'apm'.
|
|
26
29
|
* @param url Source URL.
|
|
27
30
|
* @param config Optional branch + collections path.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-id.d.ts","sourceRoot":"","sources":["../../src/domain/source-id.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"source-id.d.ts","sourceRoot":"","sources":["../../src/domain/source-id.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,EAAE,0BAAwB,KAAG,MAUpE,CAAC;AAcF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAC3B,YAAY,MAAM,EAClB,KAAK,MAAM,EACX,SAAS,cAAc,KACtB,MAaF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,KAAG,MAQ7D,CAAC"}
|
package/dist/domain/source-id.js
CHANGED
|
@@ -18,20 +18,19 @@ const node_crypto_1 = require("node:crypto");
|
|
|
18
18
|
* Falls back to a regex-based normalization when `URL` parsing fails
|
|
19
19
|
* (matches the extension's behaviour for invalid URLs).
|
|
20
20
|
* @param url Raw URL.
|
|
21
|
+
* @param preservePathCase
|
|
21
22
|
* @returns Normalized URL string.
|
|
22
23
|
*/
|
|
23
|
-
const normalizeUrl = (url) => {
|
|
24
|
+
const normalizeUrl = (url, preservePathCase = false) => {
|
|
24
25
|
try {
|
|
25
26
|
const u = new URL(url);
|
|
26
27
|
const host = u.hostname.toLowerCase();
|
|
27
|
-
const path = u.pathname.
|
|
28
|
-
return host + path;
|
|
28
|
+
const path = u.pathname.replace(/\/+$/, '');
|
|
29
|
+
return host + (preservePathCase ? path : path.toLowerCase());
|
|
29
30
|
}
|
|
30
31
|
catch {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.replace(/^https?:\/\//, '')
|
|
34
|
-
.replace(/\/+$/, '');
|
|
32
|
+
const withoutProtocol = url.replace(/^https?:\/\//, '').replace(/\/+$/, '');
|
|
33
|
+
return preservePathCase ? withoutProtocol : withoutProtocol.toLowerCase();
|
|
35
34
|
}
|
|
36
35
|
};
|
|
37
36
|
exports.normalizeUrl = normalizeUrl;
|
|
@@ -50,19 +49,23 @@ const canonicalBranch = (branch) => {
|
|
|
50
49
|
* Generate a stable sourceId of the form `{type}-{12hex}`.
|
|
51
50
|
*
|
|
52
51
|
* The hash includes (sourceType, normalizedUrl, branch,
|
|
53
|
-
* collectionsPath)
|
|
54
|
-
* id regardless of how the user typed the URL.
|
|
52
|
+
* collectionsPath), plus indexFile for Artifactory, so that the same
|
|
53
|
+
* logical source maps to the same id regardless of how the user typed the URL.
|
|
55
54
|
* @param sourceType e.g. 'github', 'awesome-copilot', 'apm'.
|
|
56
55
|
* @param url Source URL.
|
|
57
56
|
* @param config Optional branch + collections path.
|
|
58
57
|
* @returns The sourceId.
|
|
59
58
|
*/
|
|
60
59
|
const generateSourceId = (sourceType, url, config) => {
|
|
61
|
-
const
|
|
60
|
+
const isArtifactory = sourceType === 'artifactory';
|
|
61
|
+
const normalizedUrl = (0, exports.normalizeUrl)(url, isArtifactory);
|
|
62
62
|
const branch = canonicalBranch(config?.branch);
|
|
63
63
|
const collectionsPath = config?.collectionsPath ?? 'collections';
|
|
64
|
+
const indexFile = config?.indexFile ?? 'index-v1.json';
|
|
64
65
|
const hash = (0, node_crypto_1.createHash)('sha256')
|
|
65
|
-
.update(
|
|
66
|
+
.update(isArtifactory
|
|
67
|
+
? `${sourceType}:${normalizedUrl}:${branch}:${collectionsPath}:${indexFile}`
|
|
68
|
+
: `${sourceType}:${normalizedUrl}:${branch}:${collectionsPath}`)
|
|
66
69
|
.digest('hex')
|
|
67
70
|
.substring(0, 12);
|
|
68
71
|
return `${sourceType}-${hash}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-id.js","sourceRoot":"","sources":["../../src/domain/source-id.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,6CAEqB;
|
|
1
|
+
{"version":3,"file":"source-id.js","sourceRoot":"","sources":["../../src/domain/source-id.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,6CAEqB;AAcrB;;;;;;;;GAQG;AACI,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,gBAAgB,GAAG,KAAK,EAAU,EAAE;IAC5E,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC5C,OAAO,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC5E,OAAO,gBAAgB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;IAC5E,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,YAAY,gBAUvB;AAEF;;;;GAIG;AACH,MAAM,eAAe,GAAG,CAAC,MAAe,EAAU,EAAE;IAClD,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACvE,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACI,MAAM,gBAAgB,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,CAAC,EAAE,CAAC;AAC9C,CAAC,CAAC;AARW,QAAA,cAAc,kBAQzB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,16 @@ export { default as DEPLOYMENT_MANIFEST_SCHEMA } from './public/schemas/deployme
|
|
|
21
21
|
* Hub configuration schema used by the CLI and other non-extension callers.
|
|
22
22
|
*/
|
|
23
23
|
export { default as HUB_CONFIG_SCHEMA } from './public/schemas/hub-config.schema.json';
|
|
24
|
+
/** Artifactory source index JSON schema. */
|
|
25
|
+
export { default as ARTIFACTORY_SOURCE_INDEX_SCHEMA } from './public/schemas/artifactory-source-index.schema.json';
|
|
26
|
+
/**
|
|
27
|
+
* Agent Plugins 1.0.0 `plugin.json` schema, vendored unmodified from
|
|
28
|
+
* https://github.com/agentplugins/agent-plugins-spec/blob/d92e6f443b8edcea42c039727a82afdc565779e2/schemas/1.0.0/plugin.schema.json
|
|
29
|
+
* (Copyright the Agent Plugins authors, Apache-2.0). Per the spec (§5.2),
|
|
30
|
+
* clients must not fetch the schema at load time, so it ships embedded.
|
|
31
|
+
* The validation rules live in `domain/plugin/agent-plugin-spec.ts`.
|
|
32
|
+
*/
|
|
33
|
+
export { default as AGENT_PLUGIN_MANIFEST_SCHEMA } from './public/schemas/agent-plugins/1.0.0/plugin.schema.json';
|
|
24
34
|
/**
|
|
25
35
|
* Phase 1 scaffolding marker, kept until `infra`/`app`/`cli` each have real
|
|
26
36
|
* code of their own to depend on instead of this placeholder re-export
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,UAAU,QAA2C,CAAC;AAEnE;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAEvF;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAEzG;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAEvF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,UAAU,QAA2C,CAAC;AAEnE;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAEvF;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAEzG;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAEvF,4CAA4C;AAC5C,OAAO,EAAE,OAAO,IAAI,+BAA+B,EAAE,MAAM,uDAAuD,CAAC;AAEnH;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,yDAAyD,CAAC;AAElH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.CORE_PACKAGE_READY = exports.HUB_CONFIG_SCHEMA = exports.DEPLOYMENT_MANIFEST_SCHEMA = exports.COLLECTION_SCHEMA = exports.SCHEMA_DIR = void 0;
|
|
42
|
+
exports.CORE_PACKAGE_READY = exports.AGENT_PLUGIN_MANIFEST_SCHEMA = exports.ARTIFACTORY_SOURCE_INDEX_SCHEMA = exports.HUB_CONFIG_SCHEMA = exports.DEPLOYMENT_MANIFEST_SCHEMA = exports.COLLECTION_SCHEMA = exports.SCHEMA_DIR = void 0;
|
|
43
43
|
/**
|
|
44
44
|
* The `@ai-primitives-hub/core` package.
|
|
45
45
|
*
|
|
@@ -76,6 +76,18 @@ Object.defineProperty(exports, "DEPLOYMENT_MANIFEST_SCHEMA", { enumerable: true,
|
|
|
76
76
|
*/
|
|
77
77
|
var hub_config_schema_json_1 = require("./public/schemas/hub-config.schema.json");
|
|
78
78
|
Object.defineProperty(exports, "HUB_CONFIG_SCHEMA", { enumerable: true, get: function () { return __importDefault(hub_config_schema_json_1).default; } });
|
|
79
|
+
/** Artifactory source index JSON schema. */
|
|
80
|
+
var artifactory_source_index_schema_json_1 = require("./public/schemas/artifactory-source-index.schema.json");
|
|
81
|
+
Object.defineProperty(exports, "ARTIFACTORY_SOURCE_INDEX_SCHEMA", { enumerable: true, get: function () { return __importDefault(artifactory_source_index_schema_json_1).default; } });
|
|
82
|
+
/**
|
|
83
|
+
* Agent Plugins 1.0.0 `plugin.json` schema, vendored unmodified from
|
|
84
|
+
* https://github.com/agentplugins/agent-plugins-spec/blob/d92e6f443b8edcea42c039727a82afdc565779e2/schemas/1.0.0/plugin.schema.json
|
|
85
|
+
* (Copyright the Agent Plugins authors, Apache-2.0). Per the spec (§5.2),
|
|
86
|
+
* clients must not fetch the schema at load time, so it ships embedded.
|
|
87
|
+
* The validation rules live in `domain/plugin/agent-plugin-spec.ts`.
|
|
88
|
+
*/
|
|
89
|
+
var plugin_schema_json_1 = require("./public/schemas/agent-plugins/1.0.0/plugin.schema.json");
|
|
90
|
+
Object.defineProperty(exports, "AGENT_PLUGIN_MANIFEST_SCHEMA", { enumerable: true, get: function () { return __importDefault(plugin_schema_json_1).default; } });
|
|
79
91
|
/**
|
|
80
92
|
* Phase 1 scaffolding marker, kept until `infra`/`app`/`cli` each have real
|
|
81
93
|
* code of their own to depend on instead of this placeholder re-export
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;GAQG;AACH,gDAAkC;AAElC,2CAAyB;AACzB,0CAAwB;AAExB;;;GAGG;AACU,QAAA,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;AAEnE;;;;GAIG;AACH,kFAAuF;AAA9E,4IAAA,OAAO,OAAqB;AAErC;;;;GAIG;AACH,oGAAyG;AAAhG,8JAAA,OAAO,OAA8B;AAE9C;;GAEG;AACH,kFAAuF;AAA9E,4IAAA,OAAO,OAAqB;AAErC;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;GAQG;AACH,gDAAkC;AAElC,2CAAyB;AACzB,0CAAwB;AAExB;;;GAGG;AACU,QAAA,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;AAEnE;;;;GAIG;AACH,kFAAuF;AAA9E,4IAAA,OAAO,OAAqB;AAErC;;;;GAIG;AACH,oGAAyG;AAAhG,8JAAA,OAAO,OAA8B;AAE9C;;GAEG;AACH,kFAAuF;AAA9E,4IAAA,OAAO,OAAqB;AAErC,4CAA4C;AAC5C,8GAAmH;AAA1G,wKAAA,OAAO,OAAmC;AAEnD;;;;;;GAMG;AACH,8FAAkH;AAAzG,mJAAA,OAAO,OAAgC;AAEhD;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,IAAI,CAAC"}
|
|
@@ -35,6 +35,10 @@ export interface GitHubApi {
|
|
|
35
35
|
* @param extraHeaders - Optional additional headers.
|
|
36
36
|
*/
|
|
37
37
|
getJson<T>(pathOrUrl: string, extraHeaders?: Record<string, string>): Promise<T>;
|
|
38
|
+
getJsonWithHeaders<T>(pathOrUrl: string, extraHeaders?: Record<string, string>): Promise<{
|
|
39
|
+
value: T;
|
|
40
|
+
headers: Record<string, string>;
|
|
41
|
+
}>;
|
|
38
42
|
/**
|
|
39
43
|
* GET returning the raw text body. Throws on a non-2xx response.
|
|
40
44
|
* @param pathOrUrl - Relative API path or absolute URL.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-api.d.ts","sourceRoot":"","sources":["../../src/ports/github-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,MAAM,EAAE,IAAI,CAAC;IACb,KAAK,EAAE,CAAC,CAAC;IACT,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AACD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,aAAa,CAAC;CACvB;AACD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC;AAEjE,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"github-api.d.ts","sourceRoot":"","sources":["../../src/ports/github-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,MAAM,EAAE,IAAI,CAAC;IACb,KAAK,EAAE,CAAC,CAAC;IACT,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AACD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,aAAa,CAAC;CACvB;AACD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC;AAEjE,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACjF,kBAAkB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;QACvF,KAAK,EAAE,CAAC,CAAC;QACT,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACjC,CAAC,CAAC;IAEH;;;;OAIG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnF;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAExF;;;;;;;;OAQG;IACH,eAAe,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;CACjF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Provider-neutral source-scoped HTTP credential port. */
|
|
2
|
+
export interface SourceRequestContext {
|
|
3
|
+
sourceId: string;
|
|
4
|
+
trustedOrigin: string;
|
|
5
|
+
trustedPathPrefix: string;
|
|
6
|
+
}
|
|
7
|
+
export interface HttpCredentialProvider {
|
|
8
|
+
headersFor(url: string, context: SourceRequestContext): Promise<Readonly<Record<string, string>>>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=http-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-credentials.d.ts","sourceRoot":"","sources":["../../src/ports/http-credentials.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CACnG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-credentials.js","sourceRoot":"","sources":["../../src/ports/http-credentials.ts"],"names":[],"mappings":""}
|
package/dist/ports/http.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* (`@ai-primitives-hub/infra`, Phase 3) wraps the real HTTP client.
|
|
8
8
|
* @module ports/http
|
|
9
9
|
*/
|
|
10
|
+
import type { GitHubRepositoryTarget } from '../domain/source/github-repository-target';
|
|
10
11
|
export interface HttpResponse {
|
|
11
12
|
/** Status code after redirect handling. */
|
|
12
13
|
statusCode: number;
|
|
@@ -21,13 +22,16 @@ export interface HttpRequest {
|
|
|
21
22
|
/** Absolute URL. */
|
|
22
23
|
url: string;
|
|
23
24
|
/** Defaults to `'GET'`. */
|
|
24
|
-
method?: 'GET' | 'HEAD' | 'POST';
|
|
25
|
+
method?: 'GET' | 'HEAD' | 'POST' | 'PUT';
|
|
25
26
|
/** Request headers (case-insensitive). */
|
|
26
27
|
headers?: Record<string, string>;
|
|
27
28
|
/** Request body, for `POST`. */
|
|
28
29
|
body?: Uint8Array | string;
|
|
30
|
+
/** Maximum request duration in milliseconds; defaults to the adapter's timeout. */
|
|
31
|
+
timeoutMs?: number;
|
|
29
32
|
/** Maximum redirect chain length; defaults to the adapter's own default. */
|
|
30
33
|
maxRedirects?: number;
|
|
34
|
+
followRedirects?: boolean;
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
33
37
|
* The minimal HTTP surface source adapters and the install pipeline need.
|
|
@@ -53,6 +57,6 @@ export interface HttpClient {
|
|
|
53
57
|
* needing its own retry-on-401 logic.
|
|
54
58
|
*/
|
|
55
59
|
export interface TokenProvider {
|
|
56
|
-
getToken(host: string): Promise<string | undefined>;
|
|
60
|
+
getToken(host: string, repositoryTarget?: GitHubRepositoryTarget): Promise<string | undefined>;
|
|
57
61
|
}
|
|
58
62
|
//# sourceMappingURL=http.d.ts.map
|
package/dist/ports/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/ports/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/ports/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,sBAAsB,EACvB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IACzC,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,gCAAgC;IAChC,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC3B,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACpD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAChG"}
|
package/dist/ports/http.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* HTTP port — network abstraction for source adapters and the install
|
|
4
|
-
* pipeline.
|
|
5
|
-
*
|
|
6
|
-
* `app`/`infra` non-adapter code depends only on this interface, never on
|
|
7
|
-
* `fetch`/`axios`/`node:http` directly. The production adapter
|
|
8
|
-
* (`@ai-primitives-hub/infra`, Phase 3) wraps the real HTTP client.
|
|
9
|
-
* @module ports/http
|
|
10
|
-
*/
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
//# sourceMappingURL=http.js.map
|
package/dist/ports/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/ports/http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/ports/http.ts"],"names":[],"mappings":""}
|