@solidxai/core 0.1.21 → 0.1.22-beta.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/CHANGELOG.md +18 -0
- package/dist/decorators/settings-provider.decorator.d.ts +2 -1
- package/dist/decorators/settings-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/settings-provider.decorator.js +3 -2
- package/dist/decorators/settings-provider.decorator.js.map +1 -1
- package/dist/dtos/create-agent-user-memory.dto.d.ts +1 -1
- package/dist/dtos/create-agent-user-memory.dto.d.ts.map +1 -1
- package/dist/dtos/create-agent-user-memory.dto.js +2 -2
- package/dist/dtos/create-agent-user-memory.dto.js.map +1 -1
- package/dist/dtos/update-agent-user-memory.dto.d.ts +1 -1
- package/dist/dtos/update-agent-user-memory.dto.d.ts.map +1 -1
- package/dist/dtos/update-agent-user-memory.dto.js +2 -2
- package/dist/dtos/update-agent-user-memory.dto.js.map +1 -1
- package/dist/entities/agent-user-memory.entity.d.ts +1 -1
- package/dist/entities/agent-user-memory.entity.d.ts.map +1 -1
- package/dist/entities/agent-user-memory.entity.js +2 -2
- package/dist/entities/agent-user-memory.entity.js.map +1 -1
- package/dist/helpers/setting-key.helper.d.ts +6 -0
- package/dist/helpers/setting-key.helper.d.ts.map +1 -0
- package/dist/helpers/setting-key.helper.js +28 -0
- package/dist/helpers/setting-key.helper.js.map +1 -0
- package/dist/helpers/setting-key.helper.spec.d.ts +2 -0
- package/dist/helpers/setting-key.helper.spec.d.ts.map +1 -0
- package/dist/helpers/setting-key.helper.spec.js +37 -0
- package/dist/helpers/setting-key.helper.spec.js.map +1 -0
- package/dist/resources/agent-embed/solid-agent-embed.js +42 -19
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +13 -1
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +2 -180
- package/dist/services/agent-tool-registry.service.js +5 -5
- package/dist/services/agent-tool-registry.service.js.map +1 -1
- package/dist/services/mail/smtp-email.service.d.ts.map +1 -1
- package/dist/services/mail/smtp-email.service.js +2 -6
- package/dist/services/mail/smtp-email.service.js.map +1 -1
- package/dist/services/model-metadata.service.d.ts.map +1 -1
- package/dist/services/model-metadata.service.js +4 -2
- package/dist/services/model-metadata.service.js.map +1 -1
- package/dist/services/setting.service.d.ts +1 -1
- package/dist/services/setting.service.d.ts.map +1 -1
- package/dist/services/setting.service.js +25 -8
- package/dist/services/setting.service.js.map +1 -1
- package/dist/services/setting.service.spec.d.ts +2 -0
- package/dist/services/setting.service.spec.d.ts.map +1 -0
- package/dist/services/setting.service.spec.js +110 -0
- package/dist/services/setting.service.spec.js.map +1 -0
- package/dist/services/settings/default-settings-provider.service.d.ts +146 -6
- package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
- package/dist/services/settings/default-settings-provider.service.js +81 -4
- package/dist/services/settings/default-settings-provider.service.js.map +1 -1
- package/dist/subscribers/agent-tool-registry.subscriber.d.ts.map +1 -1
- package/dist/subscribers/agent-tool-registry.subscriber.js +16 -11
- package/dist/subscribers/agent-tool-registry.subscriber.js.map +1 -1
- package/package.json +1 -1
- package/plan.md +480 -0
- package/resources/agent-embed/solid-agent-embed.js +42 -19
- package/src/decorators/settings-provider.decorator.ts +6 -3
- package/src/dtos/create-agent-user-memory.dto.ts +1 -1
- package/src/dtos/update-agent-user-memory.dto.ts +1 -1
- package/src/entities/agent-user-memory.entity.ts +2 -2
- package/src/helpers/setting-key.helper.spec.ts +32 -0
- package/src/helpers/setting-key.helper.ts +30 -0
- package/src/seeders/module-metadata-seeder.service.ts +12 -1
- package/src/seeders/seed-data/solid-core-metadata.json +2 -180
- package/src/services/agent-tool-registry.service.ts +5 -5
- package/src/services/mail/smtp-email.service.ts +3 -6
- package/src/services/model-metadata.service.ts +5 -2
- package/src/services/setting.service.spec.ts +117 -0
- package/src/services/setting.service.ts +29 -9
- package/src/services/settings/default-settings-provider.service.ts +81 -4
- package/src/subscribers/agent-tool-registry.subscriber.ts +16 -9
- package/src/services/1.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.22-beta.0] - 2026-10-29
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- upgrade SolidX AgentHub Embed SDK to version 5 with improved error handling and agent identification
|
|
8
|
+
- add SolidX Agent Hub configuration settings
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- prefer 'from' address from message payload, fallback to configured value (#206)
|
|
13
|
+
- update sessionId and agentSession properties to allow null values
|
|
14
|
+
- prevent duplicate ID columns in generated views (#203)
|
|
15
|
+
- update environment variable names and change setting levels for solid-core module
|
|
16
|
+
|
|
17
|
+
### Other
|
|
18
|
+
|
|
19
|
+
- fix settings provider collision (#194)
|
|
20
|
+
|
|
3
21
|
## [0.1.21] - 2026-10-26
|
|
4
22
|
|
|
5
23
|
### Added
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const IS_SETTINGS_PROVIDER = "IS_SETTINGS_PROVIDER";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const SETTINGS_PROVIDER_NAMESPACE = "SETTINGS_PROVIDER_NAMESPACE";
|
|
3
|
+
export declare const SettingsProvider: (namespace?: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
3
4
|
//# sourceMappingURL=settings-provider.decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-provider.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/settings-provider.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-provider.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/settings-provider.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,2BAA2B,gCAAgC,CAAC;AAEzE,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,gJAGlD,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SettingsProvider = exports.IS_SETTINGS_PROVIDER = void 0;
|
|
3
|
+
exports.SettingsProvider = exports.SETTINGS_PROVIDER_NAMESPACE = exports.IS_SETTINGS_PROVIDER = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
exports.IS_SETTINGS_PROVIDER = 'IS_SETTINGS_PROVIDER';
|
|
6
|
-
|
|
6
|
+
exports.SETTINGS_PROVIDER_NAMESPACE = 'SETTINGS_PROVIDER_NAMESPACE';
|
|
7
|
+
const SettingsProvider = (namespace) => (0, common_1.applyDecorators)((0, common_1.SetMetadata)(exports.IS_SETTINGS_PROVIDER, true), (0, common_1.SetMetadata)(exports.SETTINGS_PROVIDER_NAMESPACE, namespace));
|
|
7
8
|
exports.SettingsProvider = SettingsProvider;
|
|
8
9
|
//# sourceMappingURL=settings-provider.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-provider.decorator.js","sourceRoot":"","sources":["../../src/decorators/settings-provider.decorator.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"settings-provider.decorator.js","sourceRoot":"","sources":["../../src/decorators/settings-provider.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;AAEjD,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,2BAA2B,GAAG,6BAA6B,CAAC;AAElE,MAAM,gBAAgB,GAAG,CAAC,SAAkB,EAAE,EAAE,CAAC,IAAA,wBAAe,EACrE,IAAA,oBAAW,EAAC,4BAAoB,EAAE,IAAI,CAAC,EACvC,IAAA,oBAAW,EAAC,mCAA2B,EAAE,SAAS,CAAC,CACpD,CAAC;AAHW,QAAA,gBAAgB,oBAG3B","sourcesContent":["import { applyDecorators, SetMetadata } from \"@nestjs/common\";\n\nexport const IS_SETTINGS_PROVIDER = 'IS_SETTINGS_PROVIDER';\nexport const SETTINGS_PROVIDER_NAMESPACE = 'SETTINGS_PROVIDER_NAMESPACE';\n\nexport const SettingsProvider = (namespace?: string) => applyDecorators(\n SetMetadata(IS_SETTINGS_PROVIDER, true),\n SetMetadata(SETTINGS_PROVIDER_NAMESPACE, namespace),\n);\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-agent-user-memory.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-agent-user-memory.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,wBAAwB;IACG,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACuC,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"create-agent-user-memory.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-agent-user-memory.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,wBAAwB;IACG,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACuC,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpG"}
|
|
@@ -15,7 +15,7 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
15
15
|
const class_validator_1 = require("class-validator");
|
|
16
16
|
class CreateAgentUserMemoryDto {
|
|
17
17
|
static _OPENAPI_METADATA_FACTORY() {
|
|
18
|
-
return { userId: { required: true, type: () => Number }, agentId: { required: true, type: () => Number }, memory: { required: true, type: () => String }, type: { required: true, type: () => Object, enum: ['explicit', 'implicit'] }, sessionId: { required: false, type: () => Number } };
|
|
18
|
+
return { userId: { required: true, type: () => Number }, agentId: { required: true, type: () => Number }, memory: { required: true, type: () => String }, type: { required: true, type: () => Object, enum: ['explicit', 'implicit'] }, sessionId: { required: false, type: () => Number, nullable: true } };
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.CreateAgentUserMemoryDto = CreateAgentUserMemoryDto;
|
|
@@ -46,7 +46,7 @@ __decorate([
|
|
|
46
46
|
__decorate([
|
|
47
47
|
(0, class_validator_1.IsOptional)(),
|
|
48
48
|
(0, class_validator_1.IsInt)(),
|
|
49
|
-
(0, swagger_1.ApiProperty)({ required: false }),
|
|
49
|
+
(0, swagger_1.ApiProperty)({ required: false, nullable: true }),
|
|
50
50
|
__metadata("design:type", Number)
|
|
51
51
|
], CreateAgentUserMemoryDto.prototype, "sessionId", void 0);
|
|
52
52
|
//# sourceMappingURL=create-agent-user-memory.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-agent-user-memory.dto.js","sourceRoot":"","sources":["../../src/dtos/create-agent-user-memory.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAgF;AAEhF,MAAa,wBAAwB;;oNAIf,CAAC,UAAU,EAAE,UAAU,CAAC;;CAE7C;AAND,4DAMC;AALuC;IAArC,IAAA,4BAAU,GAAE;IAAE,IAAA,uBAAK,GAAE;IAAE,IAAA,qBAAW,GAAE;;wDAAgB;AACf;IAArC,IAAA,4BAAU,GAAE;IAAE,IAAA,uBAAK,GAAE;IAAE,IAAA,qBAAW,GAAE;;yDAAiB;AACb;IAAxC,IAAA,4BAAU,GAAE;IAAE,IAAA,0BAAQ,GAAE;IAAE,IAAA,qBAAW,GAAE;;wDAAgB;AACuC;IAA9F,IAAA,4BAAU,GAAE;IAAE,IAAA,sBAAI,EAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAAE,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC;;sDAA+B;
|
|
1
|
+
{"version":3,"file":"create-agent-user-memory.dto.js","sourceRoot":"","sources":["../../src/dtos/create-agent-user-memory.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAgF;AAEhF,MAAa,wBAAwB;;oNAIf,CAAC,UAAU,EAAE,UAAU,CAAC;;CAE7C;AAND,4DAMC;AALuC;IAArC,IAAA,4BAAU,GAAE;IAAE,IAAA,uBAAK,GAAE;IAAE,IAAA,qBAAW,GAAE;;wDAAgB;AACf;IAArC,IAAA,4BAAU,GAAE;IAAE,IAAA,uBAAK,GAAE;IAAE,IAAA,qBAAW,GAAE;;yDAAiB;AACb;IAAxC,IAAA,4BAAU,GAAE;IAAE,IAAA,0BAAQ,GAAE;IAAE,IAAA,qBAAW,GAAE;;wDAAgB;AACuC;IAA9F,IAAA,4BAAU,GAAE;IAAE,IAAA,sBAAI,EAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAAE,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC;;sDAA+B;AACpD;IAAxE,IAAA,4BAAU,GAAE;IAAE,IAAA,uBAAK,GAAE;IAAE,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DAA2B","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsIn, IsInt, IsNotEmpty, IsOptional, IsString } from 'class-validator';\n\nexport class CreateAgentUserMemoryDto {\n @IsNotEmpty() @IsInt() @ApiProperty() userId: number;\n @IsNotEmpty() @IsInt() @ApiProperty() agentId: number;\n @IsNotEmpty() @IsString() @ApiProperty() memory: string;\n @IsNotEmpty() @IsIn(['explicit', 'implicit']) @ApiProperty({ enum: ['explicit', 'implicit'] }) type: 'explicit' | 'implicit';\n @IsOptional() @IsInt() @ApiProperty({ required: false, nullable: true }) sessionId?: number | null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-agent-user-memory.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-agent-user-memory.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,wBAAwB;IACsB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IACoC,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"update-agent-user-memory.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-agent-user-memory.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,wBAAwB;IACsB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IACoC,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpG"}
|
|
@@ -15,7 +15,7 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
15
15
|
const class_validator_1 = require("class-validator");
|
|
16
16
|
class UpdateAgentUserMemoryDto {
|
|
17
17
|
static _OPENAPI_METADATA_FACTORY() {
|
|
18
|
-
return { id: { required: false, type: () => Number }, userId: { required: false, type: () => Number }, agentId: { required: false, type: () => Number }, memory: { required: false, type: () => String }, type: { required: false, type: () => Object, enum: ['explicit', 'implicit'] }, sessionId: { required: false, type: () => Number } };
|
|
18
|
+
return { id: { required: false, type: () => Number }, userId: { required: false, type: () => Number }, agentId: { required: false, type: () => Number }, memory: { required: false, type: () => String }, type: { required: false, type: () => Object, enum: ['explicit', 'implicit'] }, sessionId: { required: false, type: () => Number, nullable: true } };
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.UpdateAgentUserMemoryDto = UpdateAgentUserMemoryDto;
|
|
@@ -52,7 +52,7 @@ __decorate([
|
|
|
52
52
|
__decorate([
|
|
53
53
|
(0, class_validator_1.IsOptional)(),
|
|
54
54
|
(0, class_validator_1.IsInt)(),
|
|
55
|
-
(0, swagger_1.ApiProperty)({ required: false }),
|
|
55
|
+
(0, swagger_1.ApiProperty)({ required: false, nullable: true }),
|
|
56
56
|
__metadata("design:type", Number)
|
|
57
57
|
], UpdateAgentUserMemoryDto.prototype, "sessionId", void 0);
|
|
58
58
|
//# sourceMappingURL=update-agent-user-memory.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-agent-user-memory.dto.js","sourceRoot":"","sources":["../../src/dtos/update-agent-user-memory.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAoE;AAEpE,MAAa,wBAAwB;;qQAKf,CAAC,UAAU,EAAE,UAAU,CAAC;;CAE7C;AAPD,4DAOC;AAN0D;IAAxD,IAAA,4BAAU,GAAE;IAAE,IAAA,uBAAK,GAAE;IAAE,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;oDAAa;AACZ;IAAxD,IAAA,4BAAU,GAAE;IAAE,IAAA,uBAAK,GAAE;IAAE,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;wDAAiB;AAChB;IAAxD,IAAA,4BAAU,GAAE;IAAE,IAAA,uBAAK,GAAE;IAAE,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;yDAAkB;AACd;IAA3D,IAAA,4BAAU,GAAE;IAAE,IAAA,0BAAQ,GAAE;IAAE,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;wDAAiB;AACoC;IAA/G,IAAA,4BAAU,GAAE;IAAE,IAAA,sBAAI,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,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DAA2B","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsIn, IsInt, IsOptional, IsString } from 'class-validator';\n\nexport class UpdateAgentUserMemoryDto {\n @IsOptional() @IsInt() @ApiProperty({ required: false }) id?: number;\n @IsOptional() @IsInt() @ApiProperty({ required: false }) userId?: number;\n @IsOptional() @IsInt() @ApiProperty({ required: false }) agentId?: number;\n @IsOptional() @IsString() @ApiProperty({ required: false }) memory?: string;\n @IsOptional() @IsIn(['explicit', 'implicit']) @ApiProperty({ enum: ['explicit', 'implicit'], required: false }) type?: 'explicit' | 'implicit';\n @IsOptional() @IsInt() @ApiProperty({ required: false, nullable: true }) sessionId?: number | null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-user-memory.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-user-memory.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,qBACa,eAAgB,SAAQ,YAAY;IAG7C,IAAI,EAAE,IAAI,CAAC;IAIX,KAAK,EAAE,aAAa,CAAC;IAGrB,MAAM,EAAE,MAAM,CAAC;IAGf,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAI9B,OAAO,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-user-memory.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-user-memory.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,qBACa,eAAgB,SAAQ,YAAY;IAG7C,IAAI,EAAE,IAAI,CAAC;IAIX,KAAK,EAAE,aAAa,CAAC;IAGrB,MAAM,EAAE,MAAM,CAAC;IAGf,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAI9B,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;CAChC"}
|
|
@@ -18,7 +18,7 @@ const agent_registry_entity_1 = require("./agent-registry.entity");
|
|
|
18
18
|
const agent_session_entity_1 = require("./agent-session.entity");
|
|
19
19
|
let AgentUserMemory = class AgentUserMemory extends common_entity_1.CommonEntity {
|
|
20
20
|
static _OPENAPI_METADATA_FACTORY() {
|
|
21
|
-
return { user: { required: true, type: () => require("./user.entity").User }, agent: { required: true, type: () => require("./agent-registry.entity").AgentRegistry }, memory: { required: true, type: () => String }, type: { required: true, type: () => Object }, session: { required: true, type: () => require("./agent-session.entity").AgentSession } };
|
|
21
|
+
return { user: { required: true, type: () => require("./user.entity").User }, agent: { required: true, type: () => require("./agent-registry.entity").AgentRegistry }, memory: { required: true, type: () => String }, type: { required: true, type: () => Object }, session: { required: true, type: () => require("./agent-session.entity").AgentSession, nullable: true } };
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
exports.AgentUserMemory = AgentUserMemory;
|
|
@@ -41,7 +41,7 @@ __decorate([
|
|
|
41
41
|
__metadata("design:type", String)
|
|
42
42
|
], AgentUserMemory.prototype, "type", void 0);
|
|
43
43
|
__decorate([
|
|
44
|
-
(0, typeorm_1.ManyToOne)(() => agent_session_entity_1.AgentSession, { onDelete: 'SET NULL', nullable:
|
|
44
|
+
(0, typeorm_1.ManyToOne)(() => agent_session_entity_1.AgentSession, { onDelete: 'SET NULL', nullable: true }),
|
|
45
45
|
(0, typeorm_1.JoinColumn)(),
|
|
46
46
|
__metadata("design:type", agent_session_entity_1.AgentSession)
|
|
47
47
|
], AgentUserMemory.prototype, "session", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-user-memory.entity.js","sourceRoot":"","sources":["../../src/entities/agent-user-memory.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAgE;AAChE,+CAAqC;AACrC,mEAAwD;AACxD,iEAAsD;AAG/C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,4BAAY;;;;CAkBhD,CAAA;AAlBY,0CAAe;AAGxB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC/D,IAAA,oBAAU,GAAE;8BACP,kBAAI;6CAAC;AAIX;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxE,IAAA,oBAAU,GAAE;8BACN,qCAAa;8CAAC;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACV;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;6CACE;AAI9B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAY,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"agent-user-memory.entity.js","sourceRoot":"","sources":["../../src/entities/agent-user-memory.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAgE;AAChE,+CAAqC;AACrC,mEAAwD;AACxD,iEAAsD;AAG/C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,4BAAY;;;;CAkBhD,CAAA;AAlBY,0CAAe;AAGxB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC/D,IAAA,oBAAU,GAAE;8BACP,kBAAI;6CAAC;AAIX;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxE,IAAA,oBAAU,GAAE;8BACN,qCAAa;8CAAC;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACV;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;6CACE;AAI9B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAY,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvE,IAAA,oBAAU,GAAE;8BACJ,mCAAY;gDAAQ;0BAjBpB,eAAe;IAD3B,IAAA,gBAAM,EAAC,sBAAsB,CAAC;GAClB,eAAe,CAkB3B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';\nimport { User } from './user.entity';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentSession } from './agent-session.entity';\n\n@Entity('ss_agent_user_memory')\nexport class AgentUserMemory extends CommonEntity {\n @ManyToOne(() => User, { onDelete: 'CASCADE', nullable: false })\n @JoinColumn()\n user: User;\n\n @ManyToOne(() => AgentRegistry, { onDelete: 'CASCADE', nullable: false })\n @JoinColumn()\n agent: AgentRegistry;\n\n @Column({ type: 'text' })\n memory: string;\n\n @Column({ type: 'varchar' })\n type: 'explicit' | 'implicit';\n\n @ManyToOne(() => AgentSession, { onDelete: 'SET NULL', nullable: true })\n @JoinColumn()\n session: AgentSession | null;\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const SETTINGS_KEY_SEPARATOR = ":";
|
|
2
|
+
export declare const SETTINGS_NAMESPACE_PATTERN: RegExp;
|
|
3
|
+
export declare function validateSettingNamespace(namespace: string): void;
|
|
4
|
+
export declare function validateLocalSettingKey(localKey: string): void;
|
|
5
|
+
export declare function buildSettingKey(namespace: string, localKey: string): string;
|
|
6
|
+
//# sourceMappingURL=setting-key.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting-key.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/setting-key.helper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,0BAA0B,QAA0C,CAAC;AAElF,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAOhE;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAU9D;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI3E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SETTINGS_NAMESPACE_PATTERN = exports.SETTINGS_KEY_SEPARATOR = void 0;
|
|
4
|
+
exports.validateSettingNamespace = validateSettingNamespace;
|
|
5
|
+
exports.validateLocalSettingKey = validateLocalSettingKey;
|
|
6
|
+
exports.buildSettingKey = buildSettingKey;
|
|
7
|
+
exports.SETTINGS_KEY_SEPARATOR = ':';
|
|
8
|
+
exports.SETTINGS_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)*$/;
|
|
9
|
+
function validateSettingNamespace(namespace) {
|
|
10
|
+
if (!exports.SETTINGS_NAMESPACE_PATTERN.test(namespace)) {
|
|
11
|
+
throw new Error(`Invalid settings provider namespace "${namespace}". ` +
|
|
12
|
+
'Use lowercase letters, digits, hyphens, and optional dot-separated segments.');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function validateLocalSettingKey(localKey) {
|
|
16
|
+
if (!localKey?.trim()) {
|
|
17
|
+
throw new Error('A namespaced setting must have a non-empty local key.');
|
|
18
|
+
}
|
|
19
|
+
if (localKey.includes(exports.SETTINGS_KEY_SEPARATOR)) {
|
|
20
|
+
throw new Error(`Local setting key "${localKey}" must not contain "${exports.SETTINGS_KEY_SEPARATOR}".`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function buildSettingKey(namespace, localKey) {
|
|
24
|
+
validateSettingNamespace(namespace);
|
|
25
|
+
validateLocalSettingKey(localKey);
|
|
26
|
+
return `${namespace}${exports.SETTINGS_KEY_SEPARATOR}${localKey}`;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=setting-key.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting-key.helper.js","sourceRoot":"","sources":["../../src/helpers/setting-key.helper.ts"],"names":[],"mappings":";;;AAIA,4DAOC;AAED,0DAUC;AAED,0CAIC;AA7BY,QAAA,sBAAsB,GAAG,GAAG,CAAC;AAE7B,QAAA,0BAA0B,GAAG,uCAAuC,CAAC;AAElF,SAAgB,wBAAwB,CAAC,SAAiB;IACxD,IAAI,CAAC,kCAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,wCAAwC,SAAS,KAAK;YACtD,8EAA8E,CAC/E,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAgB,uBAAuB,CAAC,QAAgB;IACtD,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,8BAAsB,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACb,sBAAsB,QAAQ,uBAAuB,8BAAsB,IAAI,CAChF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAgB,eAAe,CAAC,SAAiB,EAAE,QAAgB;IACjE,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACpC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,GAAG,SAAS,GAAG,8BAAsB,GAAG,QAAQ,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["export const SETTINGS_KEY_SEPARATOR = ':';\n\nexport const SETTINGS_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)*$/;\n\nexport function validateSettingNamespace(namespace: string): void {\n if (!SETTINGS_NAMESPACE_PATTERN.test(namespace)) {\n throw new Error(\n `Invalid settings provider namespace \"${namespace}\". ` +\n 'Use lowercase letters, digits, hyphens, and optional dot-separated segments.',\n );\n }\n}\n\nexport function validateLocalSettingKey(localKey: string): void {\n if (!localKey?.trim()) {\n throw new Error('A namespaced setting must have a non-empty local key.');\n }\n\n if (localKey.includes(SETTINGS_KEY_SEPARATOR)) {\n throw new Error(\n `Local setting key \"${localKey}\" must not contain \"${SETTINGS_KEY_SEPARATOR}\".`,\n );\n }\n}\n\nexport function buildSettingKey(namespace: string, localKey: string): string {\n validateSettingNamespace(namespace);\n validateLocalSettingKey(localKey);\n return `${namespace}${SETTINGS_KEY_SEPARATOR}${localKey}`;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting-key.helper.spec.d.ts","sourceRoot":"","sources":["../../src/helpers/setting-key.helper.spec.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
require("reflect-metadata");
|
|
10
|
+
const settings_provider_decorator_1 = require("../decorators/settings-provider.decorator");
|
|
11
|
+
const setting_key_helper_1 = require("./setting-key.helper");
|
|
12
|
+
describe('setting key helpers', () => {
|
|
13
|
+
it('builds a canonical setting key', () => {
|
|
14
|
+
expect((0, setting_key_helper_1.buildSettingKey)('acme-payments', 'clientID')).toBe('acme-payments:clientID');
|
|
15
|
+
});
|
|
16
|
+
it('rejects invalid namespaces', () => {
|
|
17
|
+
expect(() => (0, setting_key_helper_1.validateSettingNamespace)('Acme Payments')).toThrow('Invalid settings provider namespace');
|
|
18
|
+
});
|
|
19
|
+
it('rejects the namespace separator in a local key', () => {
|
|
20
|
+
expect(() => (0, setting_key_helper_1.validateLocalSettingKey)('acme:clientID')).toThrow('must not contain ":"');
|
|
21
|
+
});
|
|
22
|
+
it('keeps the provider namespace optional', () => {
|
|
23
|
+
let LegacyProvider = class LegacyProvider {
|
|
24
|
+
};
|
|
25
|
+
LegacyProvider = __decorate([
|
|
26
|
+
(0, settings_provider_decorator_1.SettingsProvider)()
|
|
27
|
+
], LegacyProvider);
|
|
28
|
+
let NamespacedProvider = class NamespacedProvider {
|
|
29
|
+
};
|
|
30
|
+
NamespacedProvider = __decorate([
|
|
31
|
+
(0, settings_provider_decorator_1.SettingsProvider)('acme-payments')
|
|
32
|
+
], NamespacedProvider);
|
|
33
|
+
expect(Reflect.getMetadata(settings_provider_decorator_1.SETTINGS_PROVIDER_NAMESPACE, LegacyProvider)).toBeUndefined();
|
|
34
|
+
expect(Reflect.getMetadata(settings_provider_decorator_1.SETTINGS_PROVIDER_NAMESPACE, NamespacedProvider)).toBe('acme-payments');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=setting-key.helper.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting-key.helper.spec.js","sourceRoot":"","sources":["../../src/helpers/setting-key.helper.spec.ts"],"names":[],"mappings":";;;;;;;;AAAA,4BAA0B;AAC1B,2FAA0G;AAC1G,6DAI8B;AAE9B,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,CAAC,IAAA,oCAAe,EAAC,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,6CAAwB,EAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAC;IACzG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,4CAAuB,EAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACzF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAE/C,IAAM,cAAc,GAApB,MAAM,cAAc;SAAI,CAAA;QAAlB,cAAc;YADnB,IAAA,8CAAgB,GAAE;WACb,cAAc,CAAI;QAGxB,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;SAAI,CAAA;QAAtB,kBAAkB;YADvB,IAAA,8CAAgB,EAAC,eAAe,CAAC;WAC5B,kBAAkB,CAAI;QAE5B,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,yDAA2B,EAAE,cAAc,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QACzF,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,yDAA2B,EAAE,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACrG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import 'reflect-metadata';\nimport { SETTINGS_PROVIDER_NAMESPACE, SettingsProvider } from '../decorators/settings-provider.decorator';\nimport {\n buildSettingKey,\n validateLocalSettingKey,\n validateSettingNamespace,\n} from './setting-key.helper';\n\ndescribe('setting key helpers', () => {\n it('builds a canonical setting key', () => {\n expect(buildSettingKey('acme-payments', 'clientID')).toBe('acme-payments:clientID');\n });\n\n it('rejects invalid namespaces', () => {\n expect(() => validateSettingNamespace('Acme Payments')).toThrow('Invalid settings provider namespace');\n });\n\n it('rejects the namespace separator in a local key', () => {\n expect(() => validateLocalSettingKey('acme:clientID')).toThrow('must not contain \":\"');\n });\n\n it('keeps the provider namespace optional', () => {\n @SettingsProvider()\n class LegacyProvider { }\n\n @SettingsProvider('acme-payments')\n class NamespacedProvider { }\n\n expect(Reflect.getMetadata(SETTINGS_PROVIDER_NAMESPACE, LegacyProvider)).toBeUndefined();\n expect(Reflect.getMetadata(SETTINGS_PROVIDER_NAMESPACE, NamespacedProvider)).toBe('acme-payments');\n });\n});\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* SolidX AgentHub Embed SDK
|
|
1
|
+
/* SolidX AgentHub Embed SDK v5. No dependencies; credentials stay in memory.
|
|
2
2
|
* mode: "popup" (default) owns its launcher and floating window.
|
|
3
3
|
* mode: "inline" fills the supplied container; the host owns its layout.
|
|
4
4
|
*/
|
|
5
5
|
(function (global) {
|
|
6
6
|
"use strict";
|
|
7
|
-
if (global.SolidAgentEmbed && global.SolidAgentEmbed.version >=
|
|
7
|
+
if (global.SolidAgentEmbed && global.SolidAgentEmbed.version >= 5) return;
|
|
8
8
|
var channel = "solidx-agent-embed";
|
|
9
9
|
var publicProtocolVersion = 2;
|
|
10
10
|
var maxContextBytes = 32 * 1024;
|
|
@@ -18,14 +18,19 @@
|
|
|
18
18
|
var inline = mode === "inline";
|
|
19
19
|
var container = typeof options.container === "string" ? document.querySelector(options.container) : options.container;
|
|
20
20
|
if (!container || !container.appendChild) throw new Error("Provide an existing container element.");
|
|
21
|
-
|
|
22
|
-
var
|
|
21
|
+
var hasAgentId = options.agentId !== undefined;
|
|
22
|
+
var hasAgentName = options.agentName !== undefined;
|
|
23
|
+
if (hasAgentId === hasAgentName) throw new Error("Provide exactly one of agentId or agentName.");
|
|
24
|
+
if (hasAgentId && (!Number.isSafeInteger(options.agentId) || options.agentId <= 0)) throw new Error("Provide a valid agentId.");
|
|
25
|
+
if (hasAgentName && (typeof options.agentName !== "string" || !options.agentName.trim())) throw new Error("Provide a valid agentName.");
|
|
26
|
+
var resolvedAgentId = hasAgentId ? options.agentId : null;
|
|
27
|
+
var embedUrl = new URL("/embed/agent/" + (resolvedAgentId || ""), hostedUiOrigin);
|
|
23
28
|
var endpoint = new URL(options.tokenEndpoint, location.href);
|
|
24
29
|
if (!/^https?:$/.test(embedUrl.protocol) || !/^https?:$/.test(endpoint.protocol)) throw new Error("Use HTTP or HTTPS URLs.");
|
|
25
30
|
if (embedUrl.username || embedUrl.password || endpoint.username || endpoint.password) throw new Error("Credentials cannot be placed in URLs.");
|
|
26
31
|
if (location.protocol === "https:" && (embedUrl.protocol !== "https:" || endpoint.protocol !== "https:")) throw new Error("Use HTTPS URLs on HTTPS pages.");
|
|
27
32
|
var id = crypto.randomUUID();
|
|
28
|
-
debug(id, "mount", { agentId: options.
|
|
33
|
+
debug(id, "mount", { agentId: resolvedAgentId, agentName: options.agentName, hostedUiOrigin: hostedUiOrigin, iframePath: embedUrl.pathname,
|
|
29
34
|
tokenEndpointOrigin: endpoint.origin, tokenEndpointPath: endpoint.pathname, pageOrigin: location.origin });
|
|
30
35
|
embedUrl.searchParams.set("parentOrigin", location.origin);
|
|
31
36
|
embedUrl.searchParams.set("instanceId", id);
|
|
@@ -33,7 +38,7 @@
|
|
|
33
38
|
var destroyed = false, initialized = false, locked = false, open = false, windowMode = "popup", ready = false, tokenFlight = null;
|
|
34
39
|
var pending = new Map();
|
|
35
40
|
var listeners = new Map(), beforeSendListeners = [], contextSnapshots = new Map(), listenerOrder = 0, eventSequence = 0;
|
|
36
|
-
var controller = null, loadTimer = null;
|
|
41
|
+
var controller = null, loadTimer = null, bootstrapAuth = null;
|
|
37
42
|
var launcherHost = null, button = null;
|
|
38
43
|
if (!inline) {
|
|
39
44
|
launcherHost = document.createElement("span");
|
|
@@ -123,7 +128,7 @@
|
|
|
123
128
|
return Object.keys(value).every(function (key) { return isJsonValue(value[key], depth + 1); });
|
|
124
129
|
}
|
|
125
130
|
function emit(event, payload) {
|
|
126
|
-
var notification = Object.assign({ protocolVersion: publicProtocolVersion, instanceId: id, agentId:
|
|
131
|
+
var notification = Object.assign({ protocolVersion: publicProtocolVersion, instanceId: id, agentId: resolvedAgentId,
|
|
127
132
|
eventId: crypto.randomUUID(), sequence: ++eventSequence, occurredAt: new Date().toISOString() }, payload || {});
|
|
128
133
|
(listeners.get(event) || []).slice().forEach(function (entry) {
|
|
129
134
|
try { entry.listener(notification); } catch (error) { debug(id, "public listener failed", { event: event, message: error && error.message }); }
|
|
@@ -246,18 +251,23 @@
|
|
|
246
251
|
var extraHeaders = typeof options.getTokenHeaders === "function" ? options.getTokenHeaders() : (options.tokenHeaders || {});
|
|
247
252
|
debug(id, "sending token exchange", { hasAuthorizationHeader: !!(extraHeaders && extraHeaders.Authorization) });
|
|
248
253
|
return fetch(endpoint.href, { method: "POST", credentials: "same-origin", cache: "no-store", signal: controller.signal,
|
|
249
|
-
headers: Object.assign({ "Content-Type": "application/json" }, extraHeaders),
|
|
254
|
+
headers: Object.assign({ "Content-Type": "application/json" }, extraHeaders),
|
|
255
|
+
body: JSON.stringify(hasAgentName ? { agentName: options.agentName } : { agentId: options.agentId }) });
|
|
250
256
|
}).then(function (response) {
|
|
251
257
|
debug(id, "token endpoint response", { status: response.status, ok: response.ok, contentType: response.headers.get("content-type") });
|
|
252
258
|
if (!response.ok) throw new Error("Chat authentication failed (HTTP " + response.status + ").");
|
|
253
259
|
return response.json();
|
|
254
260
|
}).then(function (auth) {
|
|
255
|
-
var valid = !!auth && auth.embed === true && auth.agentId
|
|
261
|
+
var valid = !!auth && auth.embed === true && Number.isSafeInteger(auth.agentId) && auth.agentId > 0
|
|
262
|
+
&& (!hasAgentId || auth.agentId === options.agentId) && !!auth.agentToken && !!auth.wsUrl && !!auth.httpUrl && Array.isArray(auth.requiredInputs);
|
|
256
263
|
debug(id, "token response validated", { valid: valid, embed: !!auth && auth.embed === true,
|
|
257
|
-
agentIdMatches: !!auth && auth.agentId === options.agentId, hasAgentToken: !!auth && !!auth.agentToken,
|
|
264
|
+
agentIdMatches: !!auth && (!hasAgentId || auth.agentId === options.agentId), hasAgentToken: !!auth && !!auth.agentToken,
|
|
258
265
|
hasWsUrl: !!auth && !!auth.wsUrl, hasHttpUrl: !!auth && !!auth.httpUrl,
|
|
259
266
|
requiredInputsIsArray: !!auth && Array.isArray(auth.requiredInputs) });
|
|
260
267
|
if (!valid) throw new Error("The token endpoint returned an invalid embed response.");
|
|
268
|
+
if (resolvedAgentId && resolvedAgentId !== auth.agentId) throw new Error("The token endpoint resolved a different agent.");
|
|
269
|
+
resolvedAgentId = auth.agentId;
|
|
270
|
+
embedUrl.pathname = "/embed/agent/" + resolvedAgentId;
|
|
261
271
|
return auth;
|
|
262
272
|
}).catch(function (error) {
|
|
263
273
|
debug(id, "token exchange failed", { name: error && error.name, message: error && error.message });
|
|
@@ -283,7 +293,7 @@
|
|
|
283
293
|
if (missing.length) { emitError(new Error("This hosted chat needs an upgrade. Missing capabilities: " + missing.join(", "))); return; }
|
|
284
294
|
ready = true;
|
|
285
295
|
clearTimeout(loadTimer);
|
|
286
|
-
emit("onReady", { protocolVersion: publicProtocolVersion, instanceId: id, agentId:
|
|
296
|
+
emit("onReady", { protocolVersion: publicProtocolVersion, instanceId: id, agentId: resolvedAgentId, capabilities: frameCapabilities });
|
|
287
297
|
debug(id, "iframe ready", { protocolVersion: publicProtocolVersion, capabilities: frameCapabilities });
|
|
288
298
|
}
|
|
289
299
|
else if (data.type === "close") hide();
|
|
@@ -298,7 +308,11 @@
|
|
|
298
308
|
if (command) { clearTimeout(command.timer); pending.delete(data.requestId); data.ok ? command.resolve(data.result) : command.reject(new Error(data.error || "Embed command failed.")); }
|
|
299
309
|
}
|
|
300
310
|
else if (data.type === "token_request") {
|
|
301
|
-
|
|
311
|
+
(bootstrapAuth ? Promise.resolve(bootstrapAuth) : fetchToken()).then(function (auth) {
|
|
312
|
+
bootstrapAuth = null;
|
|
313
|
+
debug(id, "sending token bootstrap to iframe", { requestId: data.requestId, inputsCount: Object.keys(inputs).length });
|
|
314
|
+
post("token", { requestId: data.requestId, auth: auth, inputs: inputs });
|
|
315
|
+
})
|
|
302
316
|
.catch(function (error) { post("token_error", { requestId: data.requestId, error: error.message }); emitError(error); });
|
|
303
317
|
} else if (data.type === "authenticated") { emitRecovered(); emit("onAuthenticationStateChanged", { state: "authenticated" }); }
|
|
304
318
|
else if (data.type === "error") { emit("onAuthenticationStateChanged", { state: "failed", code: "embed_error" }); emitError(new Error(data.error)); }
|
|
@@ -310,15 +324,24 @@
|
|
|
310
324
|
}
|
|
311
325
|
function show() {
|
|
312
326
|
if (destroyed) throw new Error("This embed was destroyed.");
|
|
313
|
-
if (open) return;
|
|
327
|
+
if (open && initialized) return;
|
|
328
|
+
var wasOpen = open;
|
|
314
329
|
open = true;
|
|
315
|
-
emit("onPanelVisibilityChanged", { visible: true, reason: "open" });
|
|
330
|
+
if (!wasOpen) emit("onPanelVisibilityChanged", { visible: true, reason: "open" });
|
|
316
331
|
surfaceHost.style.display = "block";
|
|
317
332
|
if (button) button.setAttribute("aria-expanded", "true");
|
|
318
333
|
position();
|
|
319
334
|
if (!initialized) {
|
|
320
|
-
initialized = true;
|
|
321
|
-
|
|
335
|
+
initialized = true;
|
|
336
|
+
var openFrame = function () {
|
|
337
|
+
if (destroyed) return;
|
|
338
|
+
debug(id, "opening hosted iframe", { iframeUrl: embedUrl.href }); frame.src = embedUrl.href; panel.appendChild(frame);
|
|
339
|
+
loadTimer = setTimeout(function () { if (!ready) emitError(new Error("The hosted chat did not load. Check its URL and framing policy.")); }, 20000);
|
|
340
|
+
};
|
|
341
|
+
if (hasAgentName) {
|
|
342
|
+
fetchToken().then(function (auth) { bootstrapAuth = auth; openFrame(); })
|
|
343
|
+
.catch(function (error) { initialized = false; emitError(error); });
|
|
344
|
+
} else openFrame();
|
|
322
345
|
}
|
|
323
346
|
if (!inline) closeButton.focus();
|
|
324
347
|
}
|
|
@@ -404,7 +427,7 @@
|
|
|
404
427
|
}
|
|
405
428
|
catch (error) { return Promise.reject(error); }
|
|
406
429
|
contextSnapshots.set(namespace, JSON.parse(JSON.stringify(contribution)));
|
|
407
|
-
emit("onContextChanged", { protocolVersion: publicProtocolVersion, instanceId: id, agentId:
|
|
430
|
+
emit("onContextChanged", { protocolVersion: publicProtocolVersion, instanceId: id, agentId: resolvedAgentId, namespace: namespace, revision: revision, displaySummary: displaySummary });
|
|
408
431
|
return sendCommand("setContext", { namespace: namespace, contribution: contribution });
|
|
409
432
|
},
|
|
410
433
|
sendMessage: function (message) {
|
|
@@ -433,7 +456,7 @@
|
|
|
433
456
|
},
|
|
434
457
|
destroy: function () {
|
|
435
458
|
if (destroyed) return;
|
|
436
|
-
emit("onDestroyed", { protocolVersion: publicProtocolVersion, instanceId: id, agentId:
|
|
459
|
+
emit("onDestroyed", { protocolVersion: publicProtocolVersion, instanceId: id, agentId: resolvedAgentId,
|
|
437
460
|
eventId: crypto.randomUUID(), sequence: ++eventSequence, occurredAt: new Date().toISOString() });
|
|
438
461
|
destroyed = true;
|
|
439
462
|
clearTimeout(loadTimer);
|
|
@@ -452,5 +475,5 @@
|
|
|
452
475
|
}
|
|
453
476
|
};
|
|
454
477
|
}
|
|
455
|
-
global.SolidAgentEmbed = { version:
|
|
478
|
+
global.SolidAgentEmbed = { version: 5, mount: mount };
|
|
456
479
|
})(window);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-metadata-seeder.service.d.ts","sourceRoot":"","sources":["../../src/seeders/module-metadata-seeder.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAWtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAkB,MAAM,SAAS,CAAC;AAIrD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,mCAAmC,EAAE,MAAM,qDAAqD,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,C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eAAe;YA2Kf,iBAAiB;YAmFjB,eAAe;YAkEf,eAAe;YAyDf,uBAAuB;YA8CvB,4BAA4B;YAkD5B,qBAAqB;IAwInC,OAAO,CAAC,YAAY;YAIN,wBAAwB;YAcxB,sBAAsB;YAuBtB,qBAAqB;YA0BrB,oBAAoB;YA0BpB,uBAAuB;YAqBvB,yBAAyB;IAqBvC,OAAO,CAAC,uBAAuB;IAkC/B,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,wBAAwB;YAuBlB,uCAAuC;YAiCvC,yCAAyC;YAgCzC,wCAAwC;YA4CxC,uBAAuB;YAevB,sBAAsB;YAoBtB,uBAAuB;YAcvB,sBAAsB;YAetB,6BAA6B;YA8C7B,iBAAiB;IA0C/B,OAAO,CAAC,mCAAmC;YAmB7B,wBAAwB;YAcxB,mBAAmB;YA2CnB,iBAAiB;YA4CjB,kBAAkB;YA2ClB,kBAAkB;YA4ClB,wBAAwB;YA2CxB,iBAAiB;YAoDjB,UAAU;YAmDV,UAAU;YAgEV,YAAY;YAoEZ,mBAAmB;YAkCnB,WAAW;IA4CzB,OAAO,CAAC,yBAAyB;YAoBnB,gBAAgB;IA8D9B,OAAO,CAAC,oBAAoB;IA0B5B,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,0BAA0B;IAMlC,OAAO,CAAC,eAAe;CAe1B"}
|
|
@@ -261,7 +261,10 @@ let ModuleMetadataSeederService = ModuleMetadataSeederService_1 = class ModuleMe
|
|
|
261
261
|
const secretCounts = await this.timeOperation('seed-secrets', () => this.seedSecrets(overallMetadata), { moduleName: moduleMetadata.name, component: 'secrets' });
|
|
262
262
|
console.log(`${this.formatSeedResult(moduleMetadata.name, 'Secrets', secretCounts)}`);
|
|
263
263
|
currentStep = 'seedAgentHubRegistries';
|
|
264
|
-
|
|
264
|
+
let agentHubCounts = { pruned: 0, upserted: 0 };
|
|
265
|
+
if (process.env.AGENT_HUB_ENABLED === 'true') {
|
|
266
|
+
agentHubCounts = await this.timeOperation('seed-agenthub-registries', () => this.seedAgentHubRegistries(overallMetadata), { moduleName: moduleMetadata.name, component: 'agenthub-registries' });
|
|
267
|
+
}
|
|
265
268
|
console.log(`${this.formatSeedResult(moduleMetadata.name, 'AgentHub Registries', agentHubCounts)}`);
|
|
266
269
|
currentStep = 'seedActions';
|
|
267
270
|
this.logger.log(`Seeding Actions`);
|
|
@@ -804,6 +807,15 @@ let ModuleMetadataSeederService = ModuleMetadataSeederService_1 = class ModuleMe
|
|
|
804
807
|
const recordModule = await this.getAgentHubSeedModule(record, defaultModule);
|
|
805
808
|
const existing = await repo.findOne({ where: { name: record.name }, relations: { module: true, tags: true }, withDeleted: true });
|
|
806
809
|
const { tags: tagNames = [], moduleUserKey, ...data } = record;
|
|
810
|
+
const toolSourcePath = path.resolve(process.cwd(), 'src', recordModule.name, 'agent-hub', 'tools', `${record.name}.py`);
|
|
811
|
+
try {
|
|
812
|
+
data.sourceCode = await fs.promises.readFile(toolSourcePath, 'utf8');
|
|
813
|
+
}
|
|
814
|
+
catch (error) {
|
|
815
|
+
if (error?.code !== 'ENOENT' || typeof data.sourceCode !== 'string') {
|
|
816
|
+
throw new Error(`Tool source file not found or unreadable for ${record.name}: ${toolSourcePath}`);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
807
819
|
const tags = await this.getAgentHubSeedTags(tagNames, record.name);
|
|
808
820
|
if (existing) {
|
|
809
821
|
if (typeof data.sourceCode === 'string' && !data.checksum) {
|