@agimon-ai/po-profile 0.0.0-alpha.97 → 0.0.0-alpha.99
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/apiContracts.cjs +67 -29
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +1 -0
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +67 -29
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/extensions/server.cjs +166 -11
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.mjs +166 -11
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{profileText-CVvJlSay.cjs → profileText-CNta8RJd.cjs} +18 -1
- package/dist/profileText-CNta8RJd.cjs.map +1 -0
- package/dist/{profileText-C0kldV5Y.mjs → profileText-D_bq8ve4.mjs} +13 -2
- package/dist/profileText-D_bq8ve4.mjs.map +1 -0
- package/package.json +9 -9
- package/src/prompts/help-how-to-profile/references/profiles-contract.md +31 -3
- package/dist/profileText-C0kldV5Y.mjs.map +0 -1
- package/dist/profileText-CVvJlSay.cjs.map +0 -1
package/dist/apiContracts.cjs
CHANGED
|
@@ -5,37 +5,75 @@ Object.defineProperties(exports, {
|
|
|
5
5
|
let _agimon_ai_po_core_apiContracts = require("@agimon-ai/po-core/apiContracts");
|
|
6
6
|
let typebox = require("typebox");
|
|
7
7
|
//#region src/schemas/apiContracts.ts
|
|
8
|
+
const ProfileSelectionSchema = typebox.Type.Object({ profile: typebox.Type.Union([typebox.Type.Null(), typebox.Type.String({ minLength: 1 })]) }, { additionalProperties: false });
|
|
9
|
+
const CurrentProfileSchema = typebox.Type.Object({ profile: typebox.Type.Union([typebox.Type.Null(), typebox.Type.String()]) });
|
|
10
|
+
const ProfileCatalogSchema = typebox.Type.Object({
|
|
11
|
+
profiles: typebox.Type.Array(typebox.Type.Object({
|
|
12
|
+
name: typebox.Type.String(),
|
|
13
|
+
identity: typebox.Type.Optional(typebox.Type.Object({
|
|
14
|
+
name: typebox.Type.Optional(typebox.Type.String()),
|
|
15
|
+
icon: typebox.Type.Optional(typebox.Type.String()),
|
|
16
|
+
role: typebox.Type.Optional(typebox.Type.String()),
|
|
17
|
+
contact: typebox.Type.Optional(typebox.Type.String())
|
|
18
|
+
})),
|
|
19
|
+
sourceId: typebox.Type.String()
|
|
20
|
+
})),
|
|
21
|
+
readiness: typebox.Type.Union([typebox.Type.Literal("ready"), typebox.Type.Literal("unavailable")])
|
|
22
|
+
});
|
|
8
23
|
const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
|
|
9
24
|
version: 1,
|
|
10
|
-
http: [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
http: [
|
|
26
|
+
{
|
|
27
|
+
id: "profile.current",
|
|
28
|
+
scope: "session",
|
|
29
|
+
basePath: "profile",
|
|
30
|
+
path: "/current",
|
|
31
|
+
method: "GET",
|
|
32
|
+
authentication: "owner",
|
|
33
|
+
description: "Read the current session selection.",
|
|
34
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(CurrentProfileSchema)
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "profile.launchProfiles",
|
|
38
|
+
scope: "workspace",
|
|
39
|
+
basePath: "profile",
|
|
40
|
+
path: "/launch-profiles",
|
|
41
|
+
method: "GET",
|
|
42
|
+
authentication: "owner",
|
|
43
|
+
description: "List the profiles a new session in this workspace can start with, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
44
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(ProfileCatalogSchema)
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "profile.profiles",
|
|
48
|
+
scope: "session",
|
|
49
|
+
basePath: "profile",
|
|
50
|
+
path: "/profiles",
|
|
51
|
+
method: "GET",
|
|
52
|
+
authentication: "owner",
|
|
53
|
+
description: "List profiles available to this session, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
54
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(ProfileCatalogSchema)
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "profile.select",
|
|
58
|
+
scope: "session",
|
|
59
|
+
basePath: "profile",
|
|
60
|
+
path: "/current",
|
|
61
|
+
method: "PUT",
|
|
62
|
+
authentication: "owner",
|
|
63
|
+
description: "Apply a profile at the next tool boundary, or clear it with null. Success means application finished.",
|
|
64
|
+
body: {
|
|
65
|
+
required: true,
|
|
66
|
+
contentType: "application/json",
|
|
67
|
+
schema: ProfileSelectionSchema
|
|
68
|
+
},
|
|
69
|
+
responses: {
|
|
70
|
+
...(0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(CurrentProfileSchema),
|
|
71
|
+
"400": { description: "Invalid profile selection." },
|
|
72
|
+
"404": { description: "Unknown profile." },
|
|
73
|
+
"503": { description: "Sources or integration unavailable; never automatically replay this write." }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
],
|
|
39
77
|
sockets: [],
|
|
40
78
|
dynamic: []
|
|
41
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.cjs","names":["
|
|
1
|
+
{"version":3,"file":"apiContracts.cjs","names":["Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nexport const ProfileSelectionSchema = Type.Object(\n {\n profile: Type.Union([Type.Null(), Type.String({ minLength: 1 })]),\n },\n { additionalProperties: false },\n);\n\nconst CurrentProfileSchema = Type.Object({ profile: Type.Union([Type.Null(), Type.String()]) });\n\nconst ProfileCatalogSchema = Type.Object({\n profiles: Type.Array(\n Type.Object({\n name: Type.String(),\n identity: Type.Optional(\n Type.Object({\n name: Type.Optional(Type.String()),\n icon: Type.Optional(Type.String()),\n role: Type.Optional(Type.String()),\n contact: Type.Optional(Type.String()),\n }),\n ),\n sourceId: Type.String(),\n }),\n ),\n readiness: Type.Union([Type.Literal('ready'), Type.Literal('unavailable')]),\n});\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [\n {\n id: 'profile.current',\n scope: 'session',\n basePath: 'profile',\n path: '/current',\n method: 'GET',\n authentication: 'owner',\n description: 'Read the current session selection.',\n responses: jsonApiResponses(CurrentProfileSchema),\n },\n {\n id: 'profile.launchProfiles',\n scope: 'workspace',\n basePath: 'profile',\n path: '/launch-profiles',\n method: 'GET',\n authentication: 'owner',\n description:\n 'List the profiles a new session in this workspace can start with, as names and display data only. Waits up to ten seconds for plugin sources.',\n responses: jsonApiResponses(ProfileCatalogSchema),\n },\n {\n id: 'profile.profiles',\n scope: 'session',\n basePath: 'profile',\n path: '/profiles',\n method: 'GET',\n authentication: 'owner',\n description:\n 'List profiles available to this session, as names and display data only. Waits up to ten seconds for plugin sources.',\n responses: jsonApiResponses(ProfileCatalogSchema),\n },\n {\n id: 'profile.select',\n scope: 'session',\n basePath: 'profile',\n path: '/current',\n method: 'PUT',\n authentication: 'owner',\n description:\n 'Apply a profile at the next tool boundary, or clear it with null. Success means application finished.',\n body: { required: true, contentType: 'application/json', schema: ProfileSelectionSchema },\n responses: {\n ...jsonApiResponses(CurrentProfileSchema),\n '400': { description: 'Invalid profile selection.' },\n '404': { description: 'Unknown profile.' },\n '503': { description: 'Sources or integration unavailable; never automatically replay this write.' },\n },\n },\n ],\n sockets: [],\n dynamic: [],\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;AAGA,MAAa,yBAAyBA,QAAAA,KAAK,OACzC,EACE,SAASA,QAAAA,KAAK,MAAM,CAACA,QAAAA,KAAK,KAAK,GAAGA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAClE,GACA,EAAE,sBAAsB,MAAM,CAChC;AAEA,MAAM,uBAAuBA,QAAAA,KAAK,OAAO,EAAE,SAASA,QAAAA,KAAK,MAAM,CAACA,QAAAA,KAAK,KAAK,GAAGA,QAAAA,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC;AAE9F,MAAM,uBAAuBA,QAAAA,KAAK,OAAO;CACvC,UAAUA,QAAAA,KAAK,MACbA,QAAAA,KAAK,OAAO;EACV,MAAMA,QAAAA,KAAK,OAAO;EAClB,UAAUA,QAAAA,KAAK,SACbA,QAAAA,KAAK,OAAO;GACV,MAAMA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO,CAAC;GACjC,MAAMA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO,CAAC;GACjC,MAAMA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO,CAAC;GACjC,SAASA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO,CAAC;EACtC,CAAC,CACH;EACA,UAAUA,QAAAA,KAAK,OAAO;CACxB,CAAC,CACH;CACA,WAAWA,QAAAA,KAAK,MAAM,CAACA,QAAAA,KAAK,QAAQ,OAAO,GAAGA,QAAAA,KAAK,QAAQ,aAAa,CAAC,CAAC;AAC5E,CAAC;AAED,MAAa,gBAAA,GAAeC,gCAAAA,kBAAAA,CAAkB;CAC5C,SAAS;CACT,MAAM;EACJ;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aAAa;GACb,YAAA,GAAWC,gCAAAA,iBAAAA,CAAiB,oBAAoB;EAClD;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aACE;GACF,YAAA,GAAWA,gCAAAA,iBAAAA,CAAiB,oBAAoB;EAClD;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aACE;GACF,YAAA,GAAWA,gCAAAA,iBAAAA,CAAiB,oBAAoB;EAClD;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aACE;GACF,MAAM;IAAE,UAAU;IAAM,aAAa;IAAoB,QAAQ;GAAuB;GACxF,WAAW;IACT,IAAA,GAAGA,gCAAAA,iBAAAA,CAAiB,oBAAoB;IACxC,OAAO,EAAE,aAAa,6BAA6B;IACnD,OAAO,EAAE,aAAa,mBAAmB;IACzC,OAAO,EAAE,aAAa,6EAA6E;GACrG;EACF;CACF;CACA,SAAS,CAAC;CACV,SAAS,CAAC;AACZ,CAAC"}
|
package/dist/apiContracts.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBA8Ba"}
|
package/dist/apiContracts.mjs
CHANGED
|
@@ -1,37 +1,75 @@
|
|
|
1
1
|
import { defineApiContract, jsonApiResponses } from "@agimon-ai/po-core/apiContracts";
|
|
2
2
|
import { Type } from "typebox";
|
|
3
3
|
//#region src/schemas/apiContracts.ts
|
|
4
|
+
const ProfileSelectionSchema = Type.Object({ profile: Type.Union([Type.Null(), Type.String({ minLength: 1 })]) }, { additionalProperties: false });
|
|
5
|
+
const CurrentProfileSchema = Type.Object({ profile: Type.Union([Type.Null(), Type.String()]) });
|
|
6
|
+
const ProfileCatalogSchema = Type.Object({
|
|
7
|
+
profiles: Type.Array(Type.Object({
|
|
8
|
+
name: Type.String(),
|
|
9
|
+
identity: Type.Optional(Type.Object({
|
|
10
|
+
name: Type.Optional(Type.String()),
|
|
11
|
+
icon: Type.Optional(Type.String()),
|
|
12
|
+
role: Type.Optional(Type.String()),
|
|
13
|
+
contact: Type.Optional(Type.String())
|
|
14
|
+
})),
|
|
15
|
+
sourceId: Type.String()
|
|
16
|
+
})),
|
|
17
|
+
readiness: Type.Union([Type.Literal("ready"), Type.Literal("unavailable")])
|
|
18
|
+
});
|
|
4
19
|
const apiContracts = defineApiContract({
|
|
5
20
|
version: 1,
|
|
6
|
-
http: [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
http: [
|
|
22
|
+
{
|
|
23
|
+
id: "profile.current",
|
|
24
|
+
scope: "session",
|
|
25
|
+
basePath: "profile",
|
|
26
|
+
path: "/current",
|
|
27
|
+
method: "GET",
|
|
28
|
+
authentication: "owner",
|
|
29
|
+
description: "Read the current session selection.",
|
|
30
|
+
responses: jsonApiResponses(CurrentProfileSchema)
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "profile.launchProfiles",
|
|
34
|
+
scope: "workspace",
|
|
35
|
+
basePath: "profile",
|
|
36
|
+
path: "/launch-profiles",
|
|
37
|
+
method: "GET",
|
|
38
|
+
authentication: "owner",
|
|
39
|
+
description: "List the profiles a new session in this workspace can start with, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
40
|
+
responses: jsonApiResponses(ProfileCatalogSchema)
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "profile.profiles",
|
|
44
|
+
scope: "session",
|
|
45
|
+
basePath: "profile",
|
|
46
|
+
path: "/profiles",
|
|
47
|
+
method: "GET",
|
|
48
|
+
authentication: "owner",
|
|
49
|
+
description: "List profiles available to this session, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
50
|
+
responses: jsonApiResponses(ProfileCatalogSchema)
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "profile.select",
|
|
54
|
+
scope: "session",
|
|
55
|
+
basePath: "profile",
|
|
56
|
+
path: "/current",
|
|
57
|
+
method: "PUT",
|
|
58
|
+
authentication: "owner",
|
|
59
|
+
description: "Apply a profile at the next tool boundary, or clear it with null. Success means application finished.",
|
|
60
|
+
body: {
|
|
61
|
+
required: true,
|
|
62
|
+
contentType: "application/json",
|
|
63
|
+
schema: ProfileSelectionSchema
|
|
64
|
+
},
|
|
65
|
+
responses: {
|
|
66
|
+
...jsonApiResponses(CurrentProfileSchema),
|
|
67
|
+
"400": { description: "Invalid profile selection." },
|
|
68
|
+
"404": { description: "Unknown profile." },
|
|
69
|
+
"503": { description: "Sources or integration unavailable; never automatically replay this write." }
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
],
|
|
35
73
|
sockets: [],
|
|
36
74
|
dynamic: []
|
|
37
75
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [\n {\n id: 'profile.current',\n scope: 'session',\n basePath: 'profile',\n path: '/current',\n method: 'GET',\n authentication: 'owner',\n description: 'Read the current session selection.',\n responses: jsonApiResponses(
|
|
1
|
+
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nexport const ProfileSelectionSchema = Type.Object(\n {\n profile: Type.Union([Type.Null(), Type.String({ minLength: 1 })]),\n },\n { additionalProperties: false },\n);\n\nconst CurrentProfileSchema = Type.Object({ profile: Type.Union([Type.Null(), Type.String()]) });\n\nconst ProfileCatalogSchema = Type.Object({\n profiles: Type.Array(\n Type.Object({\n name: Type.String(),\n identity: Type.Optional(\n Type.Object({\n name: Type.Optional(Type.String()),\n icon: Type.Optional(Type.String()),\n role: Type.Optional(Type.String()),\n contact: Type.Optional(Type.String()),\n }),\n ),\n sourceId: Type.String(),\n }),\n ),\n readiness: Type.Union([Type.Literal('ready'), Type.Literal('unavailable')]),\n});\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [\n {\n id: 'profile.current',\n scope: 'session',\n basePath: 'profile',\n path: '/current',\n method: 'GET',\n authentication: 'owner',\n description: 'Read the current session selection.',\n responses: jsonApiResponses(CurrentProfileSchema),\n },\n {\n id: 'profile.launchProfiles',\n scope: 'workspace',\n basePath: 'profile',\n path: '/launch-profiles',\n method: 'GET',\n authentication: 'owner',\n description:\n 'List the profiles a new session in this workspace can start with, as names and display data only. Waits up to ten seconds for plugin sources.',\n responses: jsonApiResponses(ProfileCatalogSchema),\n },\n {\n id: 'profile.profiles',\n scope: 'session',\n basePath: 'profile',\n path: '/profiles',\n method: 'GET',\n authentication: 'owner',\n description:\n 'List profiles available to this session, as names and display data only. Waits up to ten seconds for plugin sources.',\n responses: jsonApiResponses(ProfileCatalogSchema),\n },\n {\n id: 'profile.select',\n scope: 'session',\n basePath: 'profile',\n path: '/current',\n method: 'PUT',\n authentication: 'owner',\n description:\n 'Apply a profile at the next tool boundary, or clear it with null. Success means application finished.',\n body: { required: true, contentType: 'application/json', schema: ProfileSelectionSchema },\n responses: {\n ...jsonApiResponses(CurrentProfileSchema),\n '400': { description: 'Invalid profile selection.' },\n '404': { description: 'Unknown profile.' },\n '503': { description: 'Sources or integration unavailable; never automatically replay this write.' },\n },\n },\n ],\n sockets: [],\n dynamic: [],\n});\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,yBAAyB,KAAK,OACzC,EACE,SAAS,KAAK,MAAM,CAAC,KAAK,KAAK,GAAG,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAClE,GACA,EAAE,sBAAsB,MAAM,CAChC;AAEA,MAAM,uBAAuB,KAAK,OAAO,EAAE,SAAS,KAAK,MAAM,CAAC,KAAK,KAAK,GAAG,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC;AAE9F,MAAM,uBAAuB,KAAK,OAAO;CACvC,UAAU,KAAK,MACb,KAAK,OAAO;EACV,MAAM,KAAK,OAAO;EAClB,UAAU,KAAK,SACb,KAAK,OAAO;GACV,MAAM,KAAK,SAAS,KAAK,OAAO,CAAC;GACjC,MAAM,KAAK,SAAS,KAAK,OAAO,CAAC;GACjC,MAAM,KAAK,SAAS,KAAK,OAAO,CAAC;GACjC,SAAS,KAAK,SAAS,KAAK,OAAO,CAAC;EACtC,CAAC,CACH;EACA,UAAU,KAAK,OAAO;CACxB,CAAC,CACH;CACA,WAAW,KAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,GAAG,KAAK,QAAQ,aAAa,CAAC,CAAC;AAC5E,CAAC;AAED,MAAa,eAAe,kBAAkB;CAC5C,SAAS;CACT,MAAM;EACJ;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aAAa;GACb,WAAW,iBAAiB,oBAAoB;EAClD;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aACE;GACF,WAAW,iBAAiB,oBAAoB;EAClD;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aACE;GACF,WAAW,iBAAiB,oBAAoB;EAClD;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aACE;GACF,MAAM;IAAE,UAAU;IAAM,aAAa;IAAoB,QAAQ;GAAuB;GACxF,WAAW;IACT,GAAG,iBAAiB,oBAAoB;IACxC,OAAO,EAAE,aAAa,6BAA6B;IACnD,OAAO,EAAE,aAAa,mBAAmB;IACzC,OAAO,EAAE,aAAa,6EAA6E;GACrG;EACF;CACF;CACA,SAAS,CAAC;CACV,SAAS,CAAC;AACZ,CAAC"}
|
|
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
enumerable: true
|
|
25
25
|
}) : target, mod));
|
|
26
26
|
//#endregion
|
|
27
|
-
const require_profileText = require("../profileText-
|
|
27
|
+
const require_profileText = require("../profileText-CNta8RJd.cjs");
|
|
28
28
|
let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
|
|
29
29
|
let _agimon_ai_po_config_profiles = require("@agimon-ai/po-config/profiles");
|
|
30
30
|
let _agimon_ai_po_core_serverPlugin = require("@agimon-ai/po-core/serverPlugin");
|
|
@@ -35,6 +35,9 @@ let _agimon_ai_po_core_platform = require("@agimon-ai/po-core/platform");
|
|
|
35
35
|
let _agimon_ai_po_core_codemode = require("@agimon-ai/po-core/codemode");
|
|
36
36
|
let _agimon_ai_po_core_headless = require("@agimon-ai/po-core/headless");
|
|
37
37
|
let _agimon_ai_po_core_profileIdentity = require("@agimon-ai/po-core/profileIdentity");
|
|
38
|
+
let typebox_value = require("typebox/value");
|
|
39
|
+
let _agimon_ai_po_core_apiContracts = require("@agimon-ai/po-core/apiContracts");
|
|
40
|
+
let typebox = require("typebox");
|
|
38
41
|
let _agimon_ai_po_config = require("@agimon-ai/po-config");
|
|
39
42
|
//#region src/constants/profileMemory.ts
|
|
40
43
|
const PROFILE_MEMORY_STORE_SERVICE = "po/profile-memory-store";
|
|
@@ -479,14 +482,31 @@ async function deliverProfileWarning(execution, state) {
|
|
|
479
482
|
console.warn("[po-profile] Profile notice delivery unavailable.");
|
|
480
483
|
}
|
|
481
484
|
}
|
|
482
|
-
function createProfileServerCommand(host, state, sources) {
|
|
485
|
+
function createProfileServerCommand(host, state, sources, lifetime) {
|
|
483
486
|
return {
|
|
484
487
|
name: require_profileText.PROFILE_COMMAND,
|
|
485
488
|
description: "Show or change the active Po profile.",
|
|
486
489
|
selectionRecovery: true,
|
|
487
490
|
async execute(args, execution) {
|
|
488
|
-
const
|
|
491
|
+
const signal = AbortSignal.any([lifetime, ...execution.signal ? [execution.signal] : []]);
|
|
492
|
+
if (signal.aborted) return;
|
|
493
|
+
const files = (0, _agimon_ai_po_config_profiles.loadProfiles)(execution.repoRoot, execution.environment.HOME);
|
|
489
494
|
let requested = args.trim();
|
|
495
|
+
if (!requested || !require_profileText.mergeProfiles(files, sources).some(({ name }) => name === requested)) {
|
|
496
|
+
let readiness;
|
|
497
|
+
try {
|
|
498
|
+
readiness = await require_profileText.waitForSources(sources, void 0, signal, 5e3);
|
|
499
|
+
} catch (error) {
|
|
500
|
+
if (signal.aborted) return;
|
|
501
|
+
throw error;
|
|
502
|
+
}
|
|
503
|
+
if (signal.aborted) return;
|
|
504
|
+
if (readiness !== "done") Promise.resolve().then(() => execution.client.notify({
|
|
505
|
+
level: "info",
|
|
506
|
+
body: "Some profiles are unavailable. Showing the ones that loaded."
|
|
507
|
+
})).catch(() => console.warn("[po-profile] Profile notice delivery unavailable."));
|
|
508
|
+
}
|
|
509
|
+
const profiles = require_profileText.mergeProfiles(files, sources);
|
|
490
510
|
if (!requested) {
|
|
491
511
|
const selected = await execution.client.request({
|
|
492
512
|
kind: "select",
|
|
@@ -496,6 +516,7 @@ function createProfileServerCommand(host, state, sources) {
|
|
|
496
516
|
if (typeof selected !== "string") return;
|
|
497
517
|
requested = selected;
|
|
498
518
|
}
|
|
519
|
+
if (signal.aborted) return;
|
|
499
520
|
if (requested && !profiles.some(({ name }) => name === requested)) throw new Error(`Unknown profile: ${requested}`);
|
|
500
521
|
const profile = requested || void 0;
|
|
501
522
|
if (profile === execution.selection.profile && host.inspectCapabilities().ready) return;
|
|
@@ -721,26 +742,160 @@ var route_server_default$1 = (0, _agimon_ai_po_core_extensionFile.defineRoute)((
|
|
|
721
742
|
})
|
|
722
743
|
}));
|
|
723
744
|
//#endregion
|
|
745
|
+
//#region src/schemas/apiContracts.ts
|
|
746
|
+
const ProfileSelectionSchema = typebox.Type.Object({ profile: typebox.Type.Union([typebox.Type.Null(), typebox.Type.String({ minLength: 1 })]) }, { additionalProperties: false });
|
|
747
|
+
const CurrentProfileSchema = typebox.Type.Object({ profile: typebox.Type.Union([typebox.Type.Null(), typebox.Type.String()]) });
|
|
748
|
+
const ProfileCatalogSchema = typebox.Type.Object({
|
|
749
|
+
profiles: typebox.Type.Array(typebox.Type.Object({
|
|
750
|
+
name: typebox.Type.String(),
|
|
751
|
+
identity: typebox.Type.Optional(typebox.Type.Object({
|
|
752
|
+
name: typebox.Type.Optional(typebox.Type.String()),
|
|
753
|
+
icon: typebox.Type.Optional(typebox.Type.String()),
|
|
754
|
+
role: typebox.Type.Optional(typebox.Type.String()),
|
|
755
|
+
contact: typebox.Type.Optional(typebox.Type.String())
|
|
756
|
+
})),
|
|
757
|
+
sourceId: typebox.Type.String()
|
|
758
|
+
})),
|
|
759
|
+
readiness: typebox.Type.Union([typebox.Type.Literal("ready"), typebox.Type.Literal("unavailable")])
|
|
760
|
+
});
|
|
761
|
+
(0, _agimon_ai_po_core_apiContracts.defineApiContract)({
|
|
762
|
+
version: 1,
|
|
763
|
+
http: [
|
|
764
|
+
{
|
|
765
|
+
id: "profile.current",
|
|
766
|
+
scope: "session",
|
|
767
|
+
basePath: "profile",
|
|
768
|
+
path: "/current",
|
|
769
|
+
method: "GET",
|
|
770
|
+
authentication: "owner",
|
|
771
|
+
description: "Read the current session selection.",
|
|
772
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(CurrentProfileSchema)
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
id: "profile.launchProfiles",
|
|
776
|
+
scope: "workspace",
|
|
777
|
+
basePath: "profile",
|
|
778
|
+
path: "/launch-profiles",
|
|
779
|
+
method: "GET",
|
|
780
|
+
authentication: "owner",
|
|
781
|
+
description: "List the profiles a new session in this workspace can start with, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
782
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(ProfileCatalogSchema)
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
id: "profile.profiles",
|
|
786
|
+
scope: "session",
|
|
787
|
+
basePath: "profile",
|
|
788
|
+
path: "/profiles",
|
|
789
|
+
method: "GET",
|
|
790
|
+
authentication: "owner",
|
|
791
|
+
description: "List profiles available to this session, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
792
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(ProfileCatalogSchema)
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
id: "profile.select",
|
|
796
|
+
scope: "session",
|
|
797
|
+
basePath: "profile",
|
|
798
|
+
path: "/current",
|
|
799
|
+
method: "PUT",
|
|
800
|
+
authentication: "owner",
|
|
801
|
+
description: "Apply a profile at the next tool boundary, or clear it with null. Success means application finished.",
|
|
802
|
+
body: {
|
|
803
|
+
required: true,
|
|
804
|
+
contentType: "application/json",
|
|
805
|
+
schema: ProfileSelectionSchema
|
|
806
|
+
},
|
|
807
|
+
responses: {
|
|
808
|
+
...(0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(CurrentProfileSchema),
|
|
809
|
+
"400": { description: "Invalid profile selection." },
|
|
810
|
+
"404": { description: "Unknown profile." },
|
|
811
|
+
"503": { description: "Sources or integration unavailable; never automatically replay this write." }
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
],
|
|
815
|
+
sockets: [],
|
|
816
|
+
dynamic: []
|
|
817
|
+
});
|
|
818
|
+
//#endregion
|
|
819
|
+
//#region src/extensions/workspaces/sessions/(backend)/_lib/profileApi.ts
|
|
820
|
+
/** Session roots may differ from the workspace launcher's root. Only display data leaves the host. */
|
|
821
|
+
async function listSessionProfiles(input) {
|
|
822
|
+
let files;
|
|
823
|
+
try {
|
|
824
|
+
files = (0, _agimon_ai_po_config_profiles.loadProfiles)(input.agent.context.repoRoot, input.agent.context.environment.HOME);
|
|
825
|
+
} catch {
|
|
826
|
+
return Response.json({ error: "Profile configuration is unavailable" }, { status: 500 });
|
|
827
|
+
}
|
|
828
|
+
return Response.json(await listLaunchProfiles({
|
|
829
|
+
...input,
|
|
830
|
+
files
|
|
831
|
+
}));
|
|
832
|
+
}
|
|
833
|
+
/** A successful response means application finished, including a queued tool-boundary change. */
|
|
834
|
+
async function selectSessionProfile(input, request) {
|
|
835
|
+
let body;
|
|
836
|
+
try {
|
|
837
|
+
body = await request.json();
|
|
838
|
+
} catch {
|
|
839
|
+
return Response.json({ error: "Invalid profile selection" }, { status: 400 });
|
|
840
|
+
}
|
|
841
|
+
if (!(0, typebox_value.Check)(ProfileSelectionSchema, body)) return Response.json({ error: "Invalid profile selection" }, { status: 400 });
|
|
842
|
+
const { agent, sources, scope, signal } = input;
|
|
843
|
+
const profile = body.profile ?? void 0;
|
|
844
|
+
if (profile !== void 0) {
|
|
845
|
+
let files;
|
|
846
|
+
try {
|
|
847
|
+
files = (0, _agimon_ai_po_config_profiles.loadProfiles)(agent.context.repoRoot, agent.context.environment.HOME);
|
|
848
|
+
} catch {
|
|
849
|
+
return Response.json({ error: "Profile configuration is unavailable" }, { status: 500 });
|
|
850
|
+
}
|
|
851
|
+
const listed = () => files.some(({ name }) => name === profile) || sources?.list(scope).some(({ name }) => name === profile);
|
|
852
|
+
if (!listed()) {
|
|
853
|
+
const readiness = await require_profileText.waitForSources(sources, scope, signal, require_profileText.PROFILE_RESOLUTION_TIMEOUT_MS);
|
|
854
|
+
if (!listed()) return readiness === "done" ? Response.json({ error: "Unknown profile" }, { status: 404 }) : Response.json({ error: "Profiles are not ready. Try again." }, { status: 503 });
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
signal.throwIfAborted();
|
|
858
|
+
if (profile !== agent.context.selection.profile || !agent.inspectCapabilities().ready) try {
|
|
859
|
+
await agent.changeSelection({
|
|
860
|
+
axis: "profile",
|
|
861
|
+
profile
|
|
862
|
+
}, { atToolBoundary: true });
|
|
863
|
+
} catch (error) {
|
|
864
|
+
if (!(0, _agimon_ai_po_core_headless.isPoHeadlessPromptAdmissionError)(error)) throw error;
|
|
865
|
+
return Response.json({ error: "Profile integration is unavailable. Restore its credential or choose another profile." }, { status: 503 });
|
|
866
|
+
}
|
|
867
|
+
return Response.json({ profile: agent.context.selection.profile ?? null });
|
|
868
|
+
}
|
|
869
|
+
//#endregion
|
|
724
870
|
//#region src/extensions/workspaces/sessions/(backend)/api/profile/route.server.ts
|
|
725
|
-
var route_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoute)(({ agent }) => ({
|
|
871
|
+
var route_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoute)(({ agent, host, context, signal }) => ({
|
|
726
872
|
basePath: "profile",
|
|
727
873
|
start: () => ({
|
|
728
|
-
fetch(request) {
|
|
729
|
-
|
|
730
|
-
if (
|
|
874
|
+
async fetch(request) {
|
|
875
|
+
const path = new URL(request.url).pathname;
|
|
876
|
+
if (path !== "/current" && path !== "/profiles") return Response.json({ error: "Not found" }, { status: 404 });
|
|
877
|
+
const allow = path === "/current" ? "GET, PUT" : "GET";
|
|
878
|
+
if (request.method !== "GET" && !(path === "/current" && request.method === "PUT")) return Response.json({ error: "Method not allowed" }, {
|
|
731
879
|
status: 405,
|
|
732
|
-
headers: { Allow:
|
|
880
|
+
headers: { Allow: allow }
|
|
733
881
|
});
|
|
734
882
|
if (!agent) return Response.json({ error: "Session agent unavailable" }, { status: 404 });
|
|
735
|
-
|
|
736
|
-
|
|
883
|
+
if (path === "/current" && request.method === "GET") return Response.json({ profile: agent.context.selection.profile ?? null });
|
|
884
|
+
const scope = { workspaceId: host.context.workspaceId };
|
|
885
|
+
const input = {
|
|
886
|
+
agent,
|
|
887
|
+
sources: require_profileText.readProfileSources(context, scope),
|
|
888
|
+
scope,
|
|
889
|
+
signal: AbortSignal.any([request.signal, signal])
|
|
890
|
+
};
|
|
891
|
+
return path === "/profiles" ? listSessionProfiles(input) : selectSessionProfile(input, request);
|
|
737
892
|
},
|
|
738
893
|
close() {}
|
|
739
894
|
})
|
|
740
895
|
}));
|
|
741
896
|
//#endregion
|
|
742
897
|
//#region src/extensions/workspaces/sessions/(backend)/command/profile.server.ts
|
|
743
|
-
var profile_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)(({ agent, host, context }) => agent ? createProfileServerCommand(agent, profileSessionState(context), require_profileText.readProfileSources(context, { workspaceId: host.context.workspaceId })) : void 0, { cardinality: "optional" });
|
|
898
|
+
var profile_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)(({ agent, host, context, signal }) => agent ? createProfileServerCommand(agent, profileSessionState(context), require_profileText.readProfileSources(context, { workspaceId: host.context.workspaceId }), signal) : void 0, { cardinality: "optional" });
|
|
744
899
|
//#endregion
|
|
745
900
|
//#region src/services/profileMemoryExtraction/index.ts
|
|
746
901
|
const ROOT_CURSOR = "root";
|