@antelopejs/dms-assistant 0.2.7 → 0.2.8-next.452.gae7538c
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/pages/settings/availability.js +1 -16
- package/dist/pages/settings/availability.js.map +1 -1
- package/dist/pages/settings/options.d.ts +0 -2
- package/dist/pages/settings/options.js +3 -30
- package/dist/pages/settings/options.js.map +1 -1
- package/dist/pages/settings/page.d.ts +1 -0
- package/dist/pages/settings/page.js +2 -0
- package/dist/pages/settings/page.js.map +1 -1
- package/dist/pages/settings/sections.js +2 -74
- package/dist/pages/settings/sections.js.map +1 -1
- package/dist/routes/settings.d.ts +1 -1
- package/dist/routes/settings.js +22 -3
- package/dist/routes/settings.js.map +1 -1
- package/frontend-vue/app/components/GuardRails.vue +148 -0
- package/frontend-vue/app/plugins/ai.client.ts +8 -2
- package/frontend-vue/app/runtime/assistant-session.ts +4 -1
- package/frontend-vue/app/runtime/host-commands.ts +82 -47
- package/frontend-vue/app/views/composables/useGuardRails.ts +106 -0
- package/frontend-vue/app/views/constants.ts +1 -0
- package/frontend-vue/app/views/guard-rails.ts +113 -0
- package/frontend-vue/app/views/types.ts +2 -0
- package/frontend-vue/i18n/locales/dms-assistant-pages-en-GB.json +5 -1
- package/frontend-vue/i18n/locales/dms-assistant-pages-fr-FR.json +5 -1
- package/frontend-vue/i18n/locales/dms-assistant-views-en-GB.json +5 -0
- package/frontend-vue/i18n/locales/dms-assistant-views-fr-FR.json +5 -0
- package/package.json +2 -2
- package/sidecar/dist/agent/read-access.d.ts +1 -0
- package/sidecar/dist/agent/read-access.js +39 -6
- package/sidecar/dist/agent/read-access.js.map +1 -1
- package/sidecar/dist/constants/timing.d.ts +1 -1
- package/sidecar/dist/constants/timing.js +1 -1
- package/sidecar/dist/constants/timing.js.map +1 -1
- package/sidecar/dist/providers/claude/provider.js +2 -1
- package/sidecar/dist/providers/claude/provider.js.map +1 -1
- package/sidecar/dist/providers/claude/secret-files.js +1 -11
- package/sidecar/dist/providers/claude/secret-files.js.map +1 -1
- package/sidecar/dist/providers/claude/session-settings.d.ts +1 -0
- package/sidecar/dist/providers/claude/session-settings.js +4 -0
- package/sidecar/dist/providers/claude/session-settings.js.map +1 -1
- package/sidecar/dist/providers/claude/tool-guard.js +1 -1
- package/sidecar/dist/providers/claude/tool-guard.js.map +1 -1
|
@@ -24,7 +24,6 @@ const CAPABILITIES_ANSWER = zod_1.z.looseObject({
|
|
|
24
24
|
})
|
|
25
25
|
.optional())
|
|
26
26
|
.optional(),
|
|
27
|
-
builderAvailable: zod_1.z.boolean().optional(),
|
|
28
27
|
defaults: zod_1.z.record(zod_1.z.string(), JSON_ANSWER).optional(),
|
|
29
28
|
});
|
|
30
29
|
const OPTIONS_WITH_ITEMS = zod_1.z.looseObject({
|
|
@@ -57,16 +56,6 @@ function locksFor(capabilities) {
|
|
|
57
56
|
}
|
|
58
57
|
return locks;
|
|
59
58
|
}
|
|
60
|
-
const SAFE_MODE_FIELD = "safeMode";
|
|
61
|
-
function lockSafeMode(entry) {
|
|
62
|
-
if (!("component" in entry) || entry.id !== SAFE_MODE_FIELD)
|
|
63
|
-
return entry;
|
|
64
|
-
return {
|
|
65
|
-
...entry,
|
|
66
|
-
disabled: true,
|
|
67
|
-
description: (0, options_1.settingsText)("safe_mode", "builder_missing"),
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
59
|
const DEFAULT_VALUE = zod_1.z.lazy(() => zod_1.z.union([
|
|
71
60
|
zod_1.z.string(),
|
|
72
61
|
zod_1.z.number(),
|
|
@@ -100,11 +89,7 @@ async function applySidecarSettings(_permissions, options) {
|
|
|
100
89
|
const capabilities = await (0, sidecar_1.readSidecar)(SETTINGS_PATH, CAPABILITIES_ANSWER, {});
|
|
101
90
|
const defaults = (0, settings_values_1.asFormValues)(capabilities.defaults ?? {});
|
|
102
91
|
const locks = locksFor(capabilities);
|
|
103
|
-
const
|
|
104
|
-
const fields = options.fields.map((entry) => {
|
|
105
|
-
const locked = locks.reduce((current, lock) => lockField(current, lock), withDefaults(entry, defaults));
|
|
106
|
-
return isBuilderMissing ? lockSafeMode(locked) : locked;
|
|
107
|
-
});
|
|
92
|
+
const fields = options.fields.map((entry) => locks.reduce((current, lock) => lockField(current, lock), withDefaults(entry, defaults)));
|
|
108
93
|
return { ...options, fields };
|
|
109
94
|
}
|
|
110
95
|
//# sourceMappingURL=availability.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"availability.js","sourceRoot":"","sources":["../../../src/pages/settings/availability.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"availability.js","sourceRoot":"","sources":["../../../src/pages/settings/availability.ts"],"names":[],"mappings":";;AAqJA,oDAmBC;AAxKD,6BAAwB;AAQxB,mEAAgF;AAChF,iEAAkE;AAClE,2CAAuE;AACvE,uCAAyD;AAEzD,MAAM,aAAa,GAAG,WAAW,CAAC;AAQlC,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,CAAC,qBAAqB,EAAE,IAAA,sBAAY,EAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC;CACzE,CAAC,CAAC;AAEH,SAAS,QAAQ,CAAC,QAA8B;IAC9C,MAAM,GAAG,GACP,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5E,OAAO,GAAG,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAA,sBAAY,EAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAC3E,CAAC;AASD,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAW,oBAAU,CAAC,CAAC;AAEnD,MAAM,mBAAmB,GAAmC,OAAC,CAAC,WAAW,CAAC;IACxE,SAAS,EAAE,OAAC;SACT,MAAM,CACL,OAAC,CAAC,MAAM,EAAE,EACV,OAAC;SACE,WAAW,CAAC;QACX,SAAS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,CAC9B,CACF,CAAC;IACF,OAAO,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -3,7 +3,5 @@ export declare function settingsText(...segments: string[]): string;
|
|
|
3
3
|
export declare const CODEX_PROVIDER = "codex";
|
|
4
4
|
export declare const PROVIDER_OPTIONS: VocabularyOption[];
|
|
5
5
|
export declare const THINKING_OPTIONS: VocabularyOption[];
|
|
6
|
-
export declare const CLAUDE_MODE_OPTIONS: VocabularyOption[];
|
|
7
|
-
export declare const CODEX_MODE_OPTIONS: VocabularyOption[];
|
|
8
6
|
export declare const REQUEST_TIMEOUT_OPTIONS: VocabularyOption[];
|
|
9
7
|
export declare const RETENTION_OPTIONS: VocabularyOption[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RETENTION_OPTIONS = exports.REQUEST_TIMEOUT_OPTIONS = exports.
|
|
3
|
+
exports.RETENTION_OPTIONS = exports.REQUEST_TIMEOUT_OPTIONS = exports.THINKING_OPTIONS = exports.PROVIDER_OPTIONS = exports.CODEX_PROVIDER = void 0;
|
|
4
4
|
exports.settingsText = settingsText;
|
|
5
5
|
const i18n_1 = require("../../constants/i18n");
|
|
6
6
|
const vocabulary_1 = require("../../vocabulary");
|
|
@@ -9,10 +9,10 @@ function settingsText(...segments) {
|
|
|
9
9
|
return (0, vocabulary_1.i18nKey)(SECTION, ...segments);
|
|
10
10
|
}
|
|
11
11
|
function choices(field, declarations) {
|
|
12
|
-
return declarations.map(({ value, icon,
|
|
12
|
+
return declarations.map(({ value, icon, disabled }) => ({
|
|
13
13
|
value,
|
|
14
14
|
label: settingsText(field, value, "label"),
|
|
15
|
-
description: settingsText(field, value,
|
|
15
|
+
description: settingsText(field, value, "description"),
|
|
16
16
|
icon,
|
|
17
17
|
disabled,
|
|
18
18
|
}));
|
|
@@ -34,33 +34,6 @@ exports.THINKING_OPTIONS = labels("thinking", [
|
|
|
34
34
|
"medium",
|
|
35
35
|
"high",
|
|
36
36
|
]);
|
|
37
|
-
const NORMAL_MODE = {
|
|
38
|
-
value: "normal",
|
|
39
|
-
icon: "i-ph-hand-palm",
|
|
40
|
-
};
|
|
41
|
-
const AUTO_REVIEW_MODE = {
|
|
42
|
-
value: "auto",
|
|
43
|
-
icon: "i-ph-seal-check",
|
|
44
|
-
};
|
|
45
|
-
const ACCEPT_EDITS_MODE = {
|
|
46
|
-
value: "acceptEdits",
|
|
47
|
-
icon: "i-ph-pencil-simple-line",
|
|
48
|
-
};
|
|
49
|
-
const PLAN_MODE = {
|
|
50
|
-
value: "plan",
|
|
51
|
-
icon: "i-ph-list-checks",
|
|
52
|
-
};
|
|
53
|
-
exports.CLAUDE_MODE_OPTIONS = choices("mode", [
|
|
54
|
-
NORMAL_MODE,
|
|
55
|
-
AUTO_REVIEW_MODE,
|
|
56
|
-
ACCEPT_EDITS_MODE,
|
|
57
|
-
PLAN_MODE,
|
|
58
|
-
]);
|
|
59
|
-
exports.CODEX_MODE_OPTIONS = choices("mode", [
|
|
60
|
-
NORMAL_MODE,
|
|
61
|
-
{ ...ACCEPT_EDITS_MODE, descriptionKey: "description_codex" },
|
|
62
|
-
PLAN_MODE,
|
|
63
|
-
]);
|
|
64
37
|
exports.REQUEST_TIMEOUT_OPTIONS = labels("request_timeout", [
|
|
65
38
|
"5",
|
|
66
39
|
"15",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/pages/settings/options.ts"],"names":[],"mappings":";;;AAMA,oCAEC;AARD,+CAAqD;AACrD,iDAAkE;AAElE,MAAM,OAAO,GAAG,oBAAa,CAAC,QAAQ,CAAC;AAGvC,SAAgB,YAAY,CAAC,GAAG,QAAkB;IAChD,OAAO,IAAA,oBAAO,EAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,CAAC;AACvC,CAAC;
|
|
1
|
+
{"version":3,"file":"options.js","s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AiB,EAAE;IAC/D,GAAG;IACH,IAAI;IACJ,IAAI;CACL,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,MAAM,CAAC,sBAAsB,EAAE;IAC9D,GAAG;IACH,IAAI;IACJ,IAAI;CACL,CAAC,CAAC"}
|
|
@@ -7,6 +7,7 @@ export declare class AISettingsPage extends AISettingsPage_base {
|
|
|
7
7
|
static attention: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").BannerProps>;
|
|
8
8
|
static chatgpt: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").BannerProps>;
|
|
9
9
|
static settings: import("@antelopejs/interface-dms/base").FormBuilder;
|
|
10
|
+
static guardRails: import("@antelopejs/interface-dms").ComponentBuilder<unknown>;
|
|
10
11
|
static usage: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").SectionProps>;
|
|
11
12
|
}
|
|
12
13
|
export {};
|
|
@@ -8,6 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.AISettingsPage = void 0;
|
|
10
10
|
const base_1 = require("@antelopejs/interface-dms/base");
|
|
11
|
+
const custom_1 = require("@antelopejs/interface-dms/base/custom");
|
|
11
12
|
const layouts_1 = require("@antelopejs/interface-dms/base/layouts");
|
|
12
13
|
const page_1 = require("@antelopejs/interface-dms/page");
|
|
13
14
|
const pages_1 = require("../../constants/pages");
|
|
@@ -29,6 +30,7 @@ let AISettingsPage = class AISettingsPage extends (0, page_1.PageController)(pag
|
|
|
29
30
|
static attention = (0, base_1.Banner)({ fetchUrl: pages_1.PAGE_ROUTES.STATUS_BANNER }).meta((0, meta_1.blockMeta)("settings.status_banner", "i-ph-bell-ringing"));
|
|
30
31
|
static chatgpt = (0, base_1.Banner)({ fetchUrl: pages_1.PAGE_ROUTES.CODEX_ACCOUNT_BANNER }).meta((0, meta_1.blockMeta)("settings.chatgpt", "i-ph-open-ai-logo"));
|
|
31
32
|
static settings = settingsForm;
|
|
33
|
+
static guardRails = (0, custom_1.CustomComponent)("DmsAssistantGuardRails").meta((0, meta_1.blockMeta)("settings.guard_rails", "i-ph-shield-check"));
|
|
32
34
|
static usage = (0, base_1.Section)({
|
|
33
35
|
title: (0, meta_1.blockText)(USAGE_PATH, "title"),
|
|
34
36
|
description: (0, meta_1.blockText)(USAGE_PATH, "caption"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/pages/settings/page.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAOwC;AACxC,oEAAwE;AACxE,yDAA8E;AAC9E,iDAA0E;AAC1E,kCAAmE;AACnE,iDAAsD;AACtD,yCAA+C;AAE/C,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC;IACxB,QAAQ,EAAE,mBAAW,CAAC,QAAQ;IAC9B,SAAS,EAAE,mBAAW,CAAC,QAAQ;IAC/B,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,4BAAiB;CAC5B,CAAC;KACC,IAAI,CAAC,IAAA,gBAAS,EAAC,eAAe,EAAE,cAAc,CAAC,CAAC;KAChD,QAAQ,CAAC,mCAAoB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/pages/settings/page.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAOwC;AACxC,kEAAwE;AACxE,oEAAwE;AACxE,yDAA8E;AAC9E,iDAA0E;AAC1E,kCAAmE;AACnE,iDAAsD;AACtD,yCAA+C;AAE/C,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC;IACxB,QAAQ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I,CAAC,IAAA,gBAAS,EAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;SAC7C,KAAK,CACJ,QAAQ,EACR,IAAA,gBAAS,EAAC;QACR,KAAK,EAAE,IAAA,gBAAS,EAAC,sBAAsB,EAAE,OAAO,CAAC;QACjD,WAAW,EAAE,IAAA,gBAAS,EAAC,sBAAsB,EAAE,SAAS,CAAC;QACzD,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,mBAAW,CAAC,KAAK;QAC3B,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,IAAA,kBAAW,EAAC,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,eAAQ,EAAE,CAAC,CAAC,IAAI,CACjE,IAAA,gBAAS,EAAC,6BAA6B,EAAE,gBAAgB,CAAC,CAC3D;KACF,CAAC,CAAC,IAAI,CAAC,IAAA,gBAAS,EAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAAC,CAC7D;SACA,KAAK,CACJ,SAAS,EACT,IAAA,mBAAY,EAAC;QACX,KAAK,EAAE,IAAA,gBAAS,EAAC,wBAAwB,EAAE,OAAO,CAAC;QACnD,QAAQ,EAAE,mBAAW,CAAC,aAAa;QACnC,aAAa,EAAE,kBAAkB;KAClC,CAAC,CAAC,IAAI,CAAC,IAAA,gBAAS,EAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAAC,CAClE,CAAC;;AA9CO,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAY,GAAE;GACF,cAAc,CA+C1B"}
|
|
@@ -5,7 +5,6 @@ const data_types_1 = require("@antelopejs/interface-dms/base/data-types");
|
|
|
5
5
|
const options_1 = require("./options");
|
|
6
6
|
const NEXT_TURN_HINT = (0, options_1.settingsText)("hints", "next_turn");
|
|
7
7
|
const NEXT_MESSAGE_HINT = (0, options_1.settingsText)("hints", "next_message");
|
|
8
|
-
const NEW_CONVERSATIONS_HINT = (0, options_1.settingsText)("hints", "new_conversations");
|
|
9
8
|
function switchType(field) {
|
|
10
9
|
return new data_types_1.DefaultDataTypes.BooleanType({
|
|
11
10
|
label: (0, options_1.settingsText)(field, "label"),
|
|
@@ -44,30 +43,6 @@ const THINKING_FIELD = {
|
|
|
44
43
|
}),
|
|
45
44
|
required: true,
|
|
46
45
|
};
|
|
47
|
-
const DEFAULT_MODE_FIELDS = [
|
|
48
|
-
{
|
|
49
|
-
id: "defaultModeClaude",
|
|
50
|
-
label: (0, options_1.settingsText)("default_mode_claude", "label"),
|
|
51
|
-
description: (0, options_1.settingsText)("default_mode_claude", "description"),
|
|
52
|
-
hint: NEW_CONVERSATIONS_HINT,
|
|
53
|
-
type: new data_types_1.DefaultDataTypes.SelectType({
|
|
54
|
-
display: "cards",
|
|
55
|
-
items: options_1.CLAUDE_MODE_OPTIONS,
|
|
56
|
-
}),
|
|
57
|
-
required: true,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "defaultModeCodex",
|
|
61
|
-
label: (0, options_1.settingsText)("default_mode_codex", "label"),
|
|
62
|
-
description: (0, options_1.settingsText)("default_mode_codex", "description"),
|
|
63
|
-
hint: NEW_CONVERSATIONS_HINT,
|
|
64
|
-
type: new data_types_1.DefaultDataTypes.SelectType({
|
|
65
|
-
display: "cards",
|
|
66
|
-
items: options_1.CODEX_MODE_OPTIONS,
|
|
67
|
-
}),
|
|
68
|
-
required: true,
|
|
69
|
-
},
|
|
70
|
-
];
|
|
71
46
|
const UNANSWERED_GROUP = {
|
|
72
47
|
id: "unanswered",
|
|
73
48
|
label: (0, options_1.settingsText)("unanswered", "label"),
|
|
@@ -85,59 +60,12 @@ const UNANSWERED_GROUP = {
|
|
|
85
60
|
{ id: "notifyRequests", type: switchType("notify_requests") },
|
|
86
61
|
],
|
|
87
62
|
};
|
|
88
|
-
const LOCAL_SKILLS_FIELD = {
|
|
89
|
-
id: "allowLocalSkills",
|
|
90
|
-
label: (0, options_1.settingsText)("allow_local_skills", "title"),
|
|
91
|
-
hint: NEW_CONVERSATIONS_HINT,
|
|
92
|
-
type: switchType("allow_local_skills"),
|
|
93
|
-
};
|
|
94
63
|
const AI = {
|
|
95
64
|
id: "ai",
|
|
96
65
|
label: (0, options_1.settingsText)("sections", "ai", "label"),
|
|
97
66
|
description: (0, options_1.settingsText)("sections", "ai", "description"),
|
|
98
67
|
icon: "i-ph-sparkle",
|
|
99
|
-
fields: [
|
|
100
|
-
PROVIDER_FIELD,
|
|
101
|
-
MODEL_FIELD,
|
|
102
|
-
THINKING_FIELD,
|
|
103
|
-
...DEFAULT_MODE_FIELDS,
|
|
104
|
-
UNANSWERED_GROUP,
|
|
105
|
-
LOCAL_SKILLS_FIELD,
|
|
106
|
-
],
|
|
107
|
-
};
|
|
108
|
-
const SAFE_MODE_FIELD = {
|
|
109
|
-
id: "safeMode",
|
|
110
|
-
label: (0, options_1.settingsText)("safe_mode", "label"),
|
|
111
|
-
description: (0, options_1.settingsText)("safe_mode", "description"),
|
|
112
|
-
hint: NEW_CONVERSATIONS_HINT,
|
|
113
|
-
type: switchType("safe_mode"),
|
|
114
|
-
};
|
|
115
|
-
const ALWAYS_ASK_GROUP = {
|
|
116
|
-
id: "alwaysAsk",
|
|
117
|
-
label: (0, options_1.settingsText)("always_ask", "label"),
|
|
118
|
-
description: (0, options_1.settingsText)("always_ask", "description"),
|
|
119
|
-
orientation: "vertical",
|
|
120
|
-
fields: [
|
|
121
|
-
{
|
|
122
|
-
id: "alwaysAskDeletions",
|
|
123
|
-
label: (0, options_1.settingsText)("always_ask_deletions", "label"),
|
|
124
|
-
type: switchType("always_ask_deletions"),
|
|
125
|
-
readonly: {
|
|
126
|
-
badge: {
|
|
127
|
-
label: (0, options_1.settingsText)("always_ask_deletions", "locked"),
|
|
128
|
-
tone: "neutral",
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
id: "alwaysAskDependencies",
|
|
134
|
-
type: switchType("always_ask_dependencies"),
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
id: "alwaysAskBlockRemoval",
|
|
138
|
-
type: switchType("always_ask_block_removal"),
|
|
139
|
-
},
|
|
140
|
-
],
|
|
68
|
+
fields: [PROVIDER_FIELD, MODEL_FIELD, THINKING_FIELD, UNANSWERED_GROUP],
|
|
141
69
|
};
|
|
142
70
|
const RETENTION_FIELD = {
|
|
143
71
|
id: "checkpointRetentionDays",
|
|
@@ -151,7 +79,7 @@ const BUILDER = {
|
|
|
151
79
|
label: (0, options_1.settingsText)("sections", "builder", "label"),
|
|
152
80
|
description: (0, options_1.settingsText)("sections", "builder", "description"),
|
|
153
81
|
icon: "i-ph-hammer",
|
|
154
|
-
fields: [
|
|
82
|
+
fields: [RETENTION_FIELD],
|
|
155
83
|
};
|
|
156
84
|
exports.SETTINGS_SECTIONS = [AI, BUILDER];
|
|
157
85
|
//# sourceMappingURL=sections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../../src/pages/settings/sections.ts"],"names":[],"mappings":";;;AAAA,0EAA6E;AAM7E,
|
|
1
|
+
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../../src/pages/settings/sections.ts"],"names":[],"mappings":";;;AAAA,0EAA6E;AAM7E,uCAMmB;AAEnB,MAAM,cAAc,GAAG,IAAA,sBAAY,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAC1D,MAAM,iBAAiB,GAAG,IAAA,sBAAY,EAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAEhE,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,IAAI,6BAAgB,CAAC,WAAW,CAAC;QACtC,KAAK,EAAE,IAAA,sBAAY,EAAC,KAAK,EAAE,OAAO,CAAC;QACnC,WAAW,EAAE,IAAA,sBAAY,EAAC,KAAK,EAAE,aAAa,CAAC;KAChD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,cAAc,GAAc;IAChC,EAAE,EAAE,UAAU;IACd,KAAK,EAAE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} from "../sidecar/settings-values";
|
|
|
3
3
|
declare const AISettingsController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
4
4
|
export declare class AISettingsController extends AISettingsController_base {
|
|
5
5
|
getSettings(): Promise<SettingsBody | HTTPResult>;
|
|
6
|
-
updateSettings(body
|
|
6
|
+
updateSettings(body: SettingsBody | undefined, marker: string | undefined): Promise<SettingsBody | HTTPResult>;
|
|
7
7
|
}
|
|
8
8
|
export {};
|
package/dist/routes/settings.js
CHANGED
|
@@ -17,6 +17,7 @@ const interface_api_1 = require("@antelopejs/interface-api");
|
|
|
17
17
|
const auth_1 = require("@antelopejs/interface-dms/auth");
|
|
18
18
|
const module_1 = require("../constants/module");
|
|
19
19
|
const settings_values_1 = require("../sidecar/settings-values");
|
|
20
|
+
const owner_ui_1 = require("./owner-ui");
|
|
20
21
|
const sidecar_results_1 = require("./sidecar-results");
|
|
21
22
|
const sidecar_answers_1 = require("./sidecar-answers");
|
|
22
23
|
const SETTINGS_PATH = "/settings";
|
|
@@ -27,6 +28,17 @@ const READ_ONLY_SETTINGS = [
|
|
|
27
28
|
"defaults",
|
|
28
29
|
];
|
|
29
30
|
const ALWAYS_ASK_DELETIONS = true;
|
|
31
|
+
const FREE_SETTINGS = new Set([
|
|
32
|
+
"provider",
|
|
33
|
+
"thinking",
|
|
34
|
+
"claudeModel",
|
|
35
|
+
"requestTimeoutMinutes",
|
|
36
|
+
"notifyRequests",
|
|
37
|
+
"checkpointRetentionDays",
|
|
38
|
+
]);
|
|
39
|
+
function writesGuardRail(update) {
|
|
40
|
+
return Object.keys(update).some((key) => !FREE_SETTINGS.has(key));
|
|
41
|
+
}
|
|
30
42
|
function formSettings(settings) {
|
|
31
43
|
return {
|
|
32
44
|
...(0, settings_values_1.asFormValues)(settings),
|
|
@@ -43,10 +55,16 @@ let AISettingsController = class AISettingsController extends (0, interface_api_
|
|
|
43
55
|
getSettings() {
|
|
44
56
|
return (0, sidecar_results_1.relay)(SETTINGS_PATH, sidecar_answers_1.SETTINGS_ANSWER, formSettings);
|
|
45
57
|
}
|
|
46
|
-
updateSettings(body) {
|
|
58
|
+
async updateSettings(body, marker) {
|
|
59
|
+
const update = sidecarUpdate(body ?? {});
|
|
60
|
+
const refused = writesGuardRail(update)
|
|
61
|
+
? (0, owner_ui_1.outsideOwnerUi)(marker)
|
|
62
|
+
: undefined;
|
|
63
|
+
if (refused)
|
|
64
|
+
return refused;
|
|
47
65
|
return (0, sidecar_results_1.relay)(SETTINGS_PATH, sidecar_answers_1.SETTINGS_ANSWER, formSettings, {
|
|
48
66
|
method: "PUT",
|
|
49
|
-
body:
|
|
67
|
+
body: update,
|
|
50
68
|
});
|
|
51
69
|
}
|
|
52
70
|
};
|
|
@@ -60,8 +78,9 @@ __decorate([
|
|
|
60
78
|
__decorate([
|
|
61
79
|
(0, interface_api_1.Put)(SETTINGS_PATH),
|
|
62
80
|
__param(0, (0, interface_api_1.JSONBody)()),
|
|
81
|
+
__param(1, (0, interface_api_1.Parameter)(owner_ui_1.OWNER_UI_HEADER, "header")),
|
|
63
82
|
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", [Object]),
|
|
83
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
65
84
|
__metadata("design:returntype", Promise)
|
|
66
85
|
], AISettingsController.prototype, "updateSettings", null);
|
|
67
86
|
exports.AISettingsController = AISettingsController = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/routes/settings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/routes/settings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAOmC;AACnC,yDAA+D;AAC/D,gDAAmD;AACnD,gEAMoC;AACpC,yCAA6D;AAC7D,uDAA0C;AAC1C,uDAAoD;AAEpD,MAAM,aAAa,GAAG,WAAW,CAAC;AAGlC,MAAM,kBAAk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AAA,yBAAc,EAAC,MAAM,CAAC;YACxB,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,OAAO;YAAE,OAAO,OAAO,CAAC;QAC5B,OAAO,IAAA,uBAAK,EAAC,aAAa,EAAE,iCAAe,EAAE,YAAY,EAAE;YACzD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AArBY,oDAAoB;AAE/B;IADC,IAAA,mBAAG,EAAC,aAAa,CAAC;;;;uDAGlB;AAGK;IADL,IAAA,mBAAG,EAAC,aAAa,CAAC;IAEhB,WAAA,IAAA,wBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,yBAAS,EAAC,0BAAe,EAAE,QAAQ,CAAC,CAAA;;;;0DAWtC;+BApBU,oBAAoB;IADhC,IAAA,oBAAa,GAAE;GACH,oBAAoB,CAqBhC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import UnavailableState from "../views/UnavailableState.vue";
|
|
4
|
+
import { useGuardRails } from "../views/composables/useGuardRails";
|
|
5
|
+
import {
|
|
6
|
+
LOCKED_SWITCH_FIELD,
|
|
7
|
+
MODE_ROWS,
|
|
8
|
+
SWITCH_ROWS,
|
|
9
|
+
modeOf,
|
|
10
|
+
type ModeRow,
|
|
11
|
+
type SwitchRow,
|
|
12
|
+
} from "../views/guard-rails";
|
|
13
|
+
|
|
14
|
+
const { t } = useI18n();
|
|
15
|
+
const guard = useGuardRails();
|
|
16
|
+
|
|
17
|
+
function settingsText(...segments: string[]): string {
|
|
18
|
+
return t(["dms_assistant", "settings", ...segments].join("."));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const hint = computed(() => settingsText("hints", "new_conversations"));
|
|
22
|
+
|
|
23
|
+
const MODE_CARDS_UI = { fieldset: "grid gap-2.5 sm:grid-cols-2" };
|
|
24
|
+
|
|
25
|
+
function modeItems(row: ModeRow) {
|
|
26
|
+
return row.modes.map((mode) => ({
|
|
27
|
+
value: mode,
|
|
28
|
+
label: settingsText("mode", mode, "label"),
|
|
29
|
+
description: settingsText(
|
|
30
|
+
"mode",
|
|
31
|
+
mode,
|
|
32
|
+
row.provider === "codex" && mode === "acceptEdits"
|
|
33
|
+
? "description_codex"
|
|
34
|
+
: "description",
|
|
35
|
+
),
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function pickMode(row: ModeRow, value: unknown): void {
|
|
40
|
+
const mode = modeOf(row, value);
|
|
41
|
+
if (mode) void guard.save(row.field, mode);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Safe mode needs the Builder: without it the switch stays, off, saying why. */
|
|
45
|
+
function isBuilderMissing(row: SwitchRow): boolean {
|
|
46
|
+
return (
|
|
47
|
+
row.field === "safeMode" && guard.values.value?.builderAvailable === false
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function switchDescription(row: SwitchRow): string {
|
|
52
|
+
return settingsText(
|
|
53
|
+
row.text,
|
|
54
|
+
isBuilderMissing(row) ? "builder_missing" : "description",
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function switchAriaLabel(row: SwitchRow): string {
|
|
59
|
+
return settingsText(
|
|
60
|
+
row.text,
|
|
61
|
+
row.field === LOCKED_SWITCH_FIELD ? "locked" : "label",
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isSwitchDisabled(row: SwitchRow): boolean {
|
|
66
|
+
return (
|
|
67
|
+
row.field === LOCKED_SWITCH_FIELD ||
|
|
68
|
+
isBuilderMissing(row) ||
|
|
69
|
+
guard.isSaving(row.field)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function pickSwitch(row: SwitchRow, value: boolean): void {
|
|
74
|
+
if (row.field !== LOCKED_SWITCH_FIELD) void guard.save(row.field, value);
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<template>
|
|
79
|
+
<DmsCardPanel
|
|
80
|
+
v-if="!guard.isTurnedOff.value"
|
|
81
|
+
:padded="false"
|
|
82
|
+
:title="t('dms_assistant.views.guard_rails.title')"
|
|
83
|
+
>
|
|
84
|
+
<UnavailableState
|
|
85
|
+
v-if="guard.failure.value && !guard.values.value"
|
|
86
|
+
:failure="guard.failure.value"
|
|
87
|
+
:message="guard.message.value"
|
|
88
|
+
@retry="guard.reload"
|
|
89
|
+
/>
|
|
90
|
+
<div
|
|
91
|
+
v-else-if="!guard.values.value"
|
|
92
|
+
class="flex flex-col gap-4 p-5"
|
|
93
|
+
:aria-busy="true"
|
|
94
|
+
:aria-label="t('dms_assistant.views.common.loading')"
|
|
95
|
+
>
|
|
96
|
+
<USkeleton v-for="index in 4" :key="index" class="h-10 w-full" />
|
|
97
|
+
</div>
|
|
98
|
+
<div v-else class="flex flex-col">
|
|
99
|
+
<p class="text-muted px-5 pt-4 text-[12.5px]/normal">
|
|
100
|
+
{{ t("dms_assistant.views.guard_rails.description") }}
|
|
101
|
+
</p>
|
|
102
|
+
<DmsFieldRow
|
|
103
|
+
v-for="row in MODE_ROWS"
|
|
104
|
+
:key="row.field"
|
|
105
|
+
layout="stack"
|
|
106
|
+
:label="settingsText(row.text, 'label')"
|
|
107
|
+
:description="settingsText(row.text, 'description')"
|
|
108
|
+
>
|
|
109
|
+
<div class="flex flex-col gap-2">
|
|
110
|
+
<URadioGroup
|
|
111
|
+
:model-value="guard.values.value[row.field]"
|
|
112
|
+
:items="modeItems(row)"
|
|
113
|
+
:disabled="guard.isSaving(row.field)"
|
|
114
|
+
:aria-label="settingsText(row.text, 'label')"
|
|
115
|
+
variant="card"
|
|
116
|
+
:ui="MODE_CARDS_UI"
|
|
117
|
+
@update:model-value="pickMode(row, $event)"
|
|
118
|
+
/>
|
|
119
|
+
<p class="text-dimmed text-[12px]/normal">{{ hint }}</p>
|
|
120
|
+
</div>
|
|
121
|
+
</DmsFieldRow>
|
|
122
|
+
<template v-for="row in SWITCH_ROWS" :key="row.field">
|
|
123
|
+
<div v-if="row.startsAlwaysAsk" class="px-5 pt-4">
|
|
124
|
+
<b class="text-highlighted block text-[13px] font-semibold">
|
|
125
|
+
{{ settingsText("always_ask", "label") }}
|
|
126
|
+
</b>
|
|
127
|
+
<span class="text-muted block text-[12.5px]/normal">
|
|
128
|
+
{{ settingsText("always_ask", "description") }}
|
|
129
|
+
</span>
|
|
130
|
+
</div>
|
|
131
|
+
<DmsFieldRow
|
|
132
|
+
:label="settingsText(row.text, row.title)"
|
|
133
|
+
:description="switchDescription(row)"
|
|
134
|
+
>
|
|
135
|
+
<USwitch
|
|
136
|
+
:model-value="guard.values.value[row.field]"
|
|
137
|
+
:disabled="isSwitchDisabled(row)"
|
|
138
|
+
:aria-label="switchAriaLabel(row)"
|
|
139
|
+
@update:model-value="pickSwitch(row, $event)"
|
|
140
|
+
/>
|
|
141
|
+
<template v-if="row.hasHint" #details>
|
|
142
|
+
<span class="text-dimmed text-[12px]/normal">{{ hint }}</span>
|
|
143
|
+
</template>
|
|
144
|
+
</DmsFieldRow>
|
|
145
|
+
</template>
|
|
146
|
+
</div>
|
|
147
|
+
</DmsCardPanel>
|
|
148
|
+
</template>
|
|
@@ -77,6 +77,8 @@ import { mountFoldBar } from "../runtime/fold-bar";
|
|
|
77
77
|
import { createFrameRouter } from "../runtime/frame-router";
|
|
78
78
|
import {
|
|
79
79
|
createHostCommandDispatcher,
|
|
80
|
+
createNavigator,
|
|
81
|
+
type Navigator,
|
|
80
82
|
type HostCommandDispatcher,
|
|
81
83
|
} from "../runtime/host-commands";
|
|
82
84
|
import {
|
|
@@ -272,6 +274,7 @@ interface SessionParts {
|
|
|
272
274
|
activity: AssistantActivity;
|
|
273
275
|
launcher: LauncherStateHandle;
|
|
274
276
|
currentPage: Ref<CurrentPage | null>;
|
|
277
|
+
navigate: Navigator;
|
|
275
278
|
}
|
|
276
279
|
|
|
277
280
|
function createSession(parts: SessionParts): AssistantSession {
|
|
@@ -281,7 +284,7 @@ function createSession(parts: SessionParts): AssistantSession {
|
|
|
281
284
|
status: parts.status,
|
|
282
285
|
chat: parts.chat.transport,
|
|
283
286
|
panel,
|
|
284
|
-
navigate:
|
|
287
|
+
navigate: parts.navigate,
|
|
285
288
|
openConversation: (conversationId) => {
|
|
286
289
|
intents.push({ kind: "open", conversationId });
|
|
287
290
|
panel.open();
|
|
@@ -448,10 +451,12 @@ function createRuntime(
|
|
|
448
451
|
deps: DashboardDeps,
|
|
449
452
|
controller: SidecarStatusController,
|
|
450
453
|
): AssistantRuntime {
|
|
451
|
-
const
|
|
454
|
+
const navigate = createNavigator({
|
|
452
455
|
router: deps.router,
|
|
453
456
|
devReload: deps.devReload,
|
|
457
|
+
location: () => window.location.pathname,
|
|
454
458
|
});
|
|
459
|
+
const dispatchHostCommand = createHostCommandDispatcher({ navigate });
|
|
455
460
|
const { client, chat } = createAssistantChannel({
|
|
456
461
|
$authFetch: deps.$authFetch,
|
|
457
462
|
controller,
|
|
@@ -494,6 +499,7 @@ function createRuntime(
|
|
|
494
499
|
activity,
|
|
495
500
|
launcher,
|
|
496
501
|
currentPage,
|
|
502
|
+
navigate,
|
|
497
503
|
});
|
|
498
504
|
const stops = [
|
|
499
505
|
installToggleShortcut({ onToggle: panel.toggle }),
|
|
@@ -31,7 +31,10 @@ export interface AssistantSession {
|
|
|
31
31
|
status: Readonly<Ref<SidecarStatus>>;
|
|
32
32
|
chat: ChatTransport;
|
|
33
33
|
panel: ChatPanelState;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Opens a page of the dashboard once its site layout serves it, so a page the builder or the
|
|
36
|
+
* agent just wrote opens without a 404; navigations share the agent's queue.
|
|
37
|
+
*/
|
|
35
38
|
navigate: (path: string) => void;
|
|
36
39
|
/** Opens the panel on that conversation. */
|
|
37
40
|
openConversation: (conversationId: string) => void;
|