@project-ava-supernova/core 0.2.165 → 0.2.166
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.
|
@@ -2,7 +2,7 @@ import type { Tool, ToolResult, ToolExecutionContext, ToolRiskLevel } from './ty
|
|
|
2
2
|
import type { FunctionSchema } from '../providers/types.js';
|
|
3
3
|
export declare class SupportRequestTool implements Tool {
|
|
4
4
|
readonly name = "support_request";
|
|
5
|
-
readonly description = "
|
|
5
|
+
readonly description = "Open a PRIVATE support ticket with the Ava team, answered by a person. Public questions, bugs and ideas go to the Ava Supernova Discord first; use this for anything private (account, billing, personal data, security) or when the user would rather not post publicly.";
|
|
6
6
|
readonly riskLevel: ToolRiskLevel;
|
|
7
7
|
readonly requiresConfirmation = true;
|
|
8
8
|
readonly schema: FunctionSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-request.d.ts","sourceRoot":"","sources":["../../src/tools/support-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"support-request.d.ts","sourceRoot":"","sources":["../../src/tools/support-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAc5D,qBAAa,kBAAmB,YAAW,IAAI;IAC7C,QAAQ,CAAC,IAAI,qBAAqB;IAClC,QAAQ,CAAC,WAAW,+QAA+Q;IACnS,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAW;IAC5C,QAAQ,CAAC,oBAAoB,QAAQ;IAErC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAkC7B;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAsDjG"}
|
|
@@ -1,111 +1,99 @@
|
|
|
1
1
|
import { containsCredentials } from './security.js';
|
|
2
|
+
/**
|
|
3
|
+
* Open a private support TICKET (30 Oct 2026 — one ticket system replaced the
|
|
4
|
+
* old chat-style conversations). Every ticket is answered by a person: Ava's
|
|
5
|
+
* part is to help write it and send it, never to answer it.
|
|
6
|
+
*
|
|
7
|
+
* Tickets belong to an account, so this needs the platform key. Without one
|
|
8
|
+
* the user is pointed to the Discord for public questions; email support for
|
|
9
|
+
* people without an account comes later.
|
|
10
|
+
*/
|
|
11
|
+
const CATEGORIES = ['question', 'bug', 'feature', 'account', 'billing', 'privacy', 'security', 'other'];
|
|
2
12
|
export class SupportRequestTool {
|
|
3
13
|
name = 'support_request';
|
|
4
|
-
description = '
|
|
14
|
+
description = 'Open a PRIVATE support ticket with the Ava team, answered by a person. Public questions, bugs and ideas go to the Ava Supernova Discord first; use this for anything private (account, billing, personal data, security) or when the user would rather not post publicly.';
|
|
5
15
|
riskLevel = 'write';
|
|
6
16
|
requiresConfirmation = true;
|
|
7
17
|
schema = {
|
|
8
18
|
name: 'support_request',
|
|
9
|
-
description: '
|
|
10
|
-
'
|
|
19
|
+
description: 'Open a PRIVATE support ticket with the Ava team. A PERSON answers every ticket — never say you will ' +
|
|
20
|
+
'answer it yourself, and never promise a reply time. For public questions, bugs and ideas, point the ' +
|
|
21
|
+
'user to the Ava Supernova Discord first (https://discord.gg/bbtnKMW4rf — #help, #bug-reports, ' +
|
|
11
22
|
'#feature-requests), where answers stay searchable. Use this ticket for anything private — account, ' +
|
|
12
|
-
'billing, personal
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'The user\'s email is required so the team can reply. If the user has a platform account, ' +
|
|
16
|
-
'their email may already be available in shared state.',
|
|
23
|
+
'billing, personal data, a security issue — or when the user would rather not post publicly. ' +
|
|
24
|
+
'Draft the subject, category and message from the conversation, SHOW the user exactly what will be ' +
|
|
25
|
+
'sent, and only send once they confirm. Never include API keys, passwords or tokens.',
|
|
17
26
|
parameters: {
|
|
18
27
|
type: 'object',
|
|
19
28
|
properties: {
|
|
20
|
-
|
|
21
|
-
type: 'string',
|
|
22
|
-
description: 'The user\'s email address for receiving replies. Ask the user if not known.',
|
|
23
|
-
},
|
|
24
|
-
name: {
|
|
29
|
+
category: {
|
|
25
30
|
type: 'string',
|
|
26
|
-
|
|
31
|
+
enum: [...CATEGORIES],
|
|
32
|
+
description: 'question (how do I…), bug (something broken), feature (an idea), account (login, keys, profile), ' +
|
|
33
|
+
'billing (plans, credits, payments), privacy (their data — export, deletion, what is stored), ' +
|
|
34
|
+
'security (a vulnerability or a suspected compromise), other (anything else).',
|
|
27
35
|
},
|
|
28
36
|
subject: {
|
|
29
37
|
type: 'string',
|
|
30
|
-
description: '
|
|
38
|
+
description: 'A short, specific summary — "Can\'t sign in after changing email", not "help". Max 200 characters.',
|
|
31
39
|
},
|
|
32
40
|
message: {
|
|
33
41
|
type: 'string',
|
|
34
|
-
description: '
|
|
35
|
-
'
|
|
36
|
-
},
|
|
37
|
-
category: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
enum: ['bug', 'feature', 'question', 'account', 'feedback', 'teach', 'other'],
|
|
40
|
-
description: 'The type of support request. Categorise based on what the user is reporting: ' +
|
|
41
|
-
'bug (something broken), feature (feature request), question (how do I...), ' +
|
|
42
|
-
'account (billing/login/API keys), feedback (general feedback), ' +
|
|
43
|
-
'teach (Teach mode specific), other (anything else).',
|
|
42
|
+
description: 'The full detail: what they were doing, what happened, what they expected, any error text, and ' +
|
|
43
|
+
'their surface and version (extension or IDE) when relevant. Max 10,000 characters.',
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
|
-
required: ['
|
|
46
|
+
required: ['category', 'subject', 'message'],
|
|
47
47
|
},
|
|
48
48
|
};
|
|
49
49
|
async execute(args, context) {
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const message = args.message
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (!
|
|
56
|
-
return { success: false, output: 'A
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return { success: false, output: 'Message is required.' };
|
|
60
|
-
}
|
|
61
|
-
if (message.length > 10_000) {
|
|
62
|
-
return { success: false, output: 'Message must be 10,000 characters or fewer.' };
|
|
63
|
-
}
|
|
64
|
-
// Block credential submission
|
|
50
|
+
const category = CATEGORIES.includes(String(args.category)) ? String(args.category) : 'other';
|
|
51
|
+
const subject = String(args.subject ?? '').trim().slice(0, 200);
|
|
52
|
+
const message = String(args.message ?? '').trim();
|
|
53
|
+
if (!subject)
|
|
54
|
+
return { success: false, output: 'A subject is required.' };
|
|
55
|
+
if (!message)
|
|
56
|
+
return { success: false, output: 'A message is required.' };
|
|
57
|
+
if (message.length > 10_000)
|
|
58
|
+
return { success: false, output: 'The message must be 10,000 characters or fewer.' };
|
|
65
59
|
if (containsCredentials(subject) || containsCredentials(message)) {
|
|
66
60
|
return {
|
|
67
61
|
success: false,
|
|
68
|
-
output: 'Blocked: the
|
|
69
|
-
'Please remove sensitive data before submitting a support ticket.',
|
|
62
|
+
output: 'Blocked: the ticket appears to contain an API key, token or password. Remove it before sending — the team never needs a key to help.',
|
|
70
63
|
};
|
|
71
64
|
}
|
|
72
|
-
// Get the API base URL — prefer platform config, fall back to default
|
|
73
|
-
const apiBase = context.sharedState?.platformApiBase || 'https://avasupernova.com';
|
|
74
65
|
const platformKey = context.sharedState?.platformKey;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
if (!platformKey) {
|
|
67
|
+
return {
|
|
68
|
+
success: false,
|
|
69
|
+
output: 'A private ticket needs the user to be signed in to their Ava Supernova account, and they are not. ' +
|
|
70
|
+
'Tell them so plainly. For a public question, bug or idea, the Discord works without signing in: ' +
|
|
71
|
+
'https://discord.gg/bbtnKMW4rf. Do not ask them to paste anything private into Discord.',
|
|
78
72
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const response = await fetch(`${apiBase}/api/support/conversations`, {
|
|
73
|
+
}
|
|
74
|
+
const apiBase = context.sharedState?.platformApiBase || 'https://avasupernova.com';
|
|
75
|
+
try {
|
|
76
|
+
const response = await fetch(`${apiBase}/api/tickets`, {
|
|
84
77
|
method: 'POST',
|
|
85
|
-
headers,
|
|
86
|
-
body: JSON.stringify({
|
|
87
|
-
message: `[${category}] ${subject}\n\n${message}\n\nContact: ${email}${name ? ` (${name})` : ''}`,
|
|
88
|
-
platform: 'tool',
|
|
89
|
-
}),
|
|
78
|
+
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${platformKey}` },
|
|
79
|
+
body: JSON.stringify({ category, subject, message, source: 'ava' }),
|
|
90
80
|
});
|
|
91
81
|
if (!response.ok) {
|
|
92
82
|
const errorData = await response.json().catch(() => ({}));
|
|
93
|
-
|
|
94
|
-
return { success: false, output: `Failed to submit support request: ${errorMsg}` };
|
|
83
|
+
return { success: false, output: `The ticket was not sent: ${errorData.error || `HTTP ${response.status}`}` };
|
|
95
84
|
}
|
|
96
85
|
const data = await response.json();
|
|
97
|
-
const
|
|
86
|
+
const ref = data.ticket?.ref_label || 'a new ticket';
|
|
98
87
|
return {
|
|
99
88
|
success: true,
|
|
100
|
-
output: `
|
|
101
|
-
`
|
|
102
|
-
`the
|
|
103
|
-
`Support section of your dashboard.`,
|
|
89
|
+
output: `Ticket ${ref} is open. A person on the Ava team will answer it — not you. They will be emailed ` +
|
|
90
|
+
`when there is a reply, and can follow it in Help → Support (or Support in their dashboard on the ` +
|
|
91
|
+
`website). Tell them the reference and that it is private: only they and the team can see it.`,
|
|
104
92
|
};
|
|
105
93
|
}
|
|
106
94
|
catch (error) {
|
|
107
95
|
const msg = error instanceof Error ? error.message : String(error);
|
|
108
|
-
return { success: false, output: `
|
|
96
|
+
return { success: false, output: `The ticket was not sent: ${msg}` };
|
|
109
97
|
}
|
|
110
98
|
}
|
|
111
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-request.js","sourceRoot":"","sources":["../../src/tools/support-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,OAAO,kBAAkB;IACpB,IAAI,GAAG,iBAAiB,CAAC;IACzB,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"support-request.js","sourceRoot":"","sources":["../../src/tools/support-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAEjH,MAAM,OAAO,kBAAkB;IACpB,IAAI,GAAG,iBAAiB,CAAC;IACzB,WAAW,GAAG,2QAA2Q,CAAC;IAC1R,SAAS,GAAkB,OAAO,CAAC;IACnC,oBAAoB,GAAG,IAAI,CAAC;IAE5B,MAAM,GAAmB;QAChC,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,sGAAsG;YACtG,sGAAsG;YACtG,gGAAgG;YAChG,qGAAqG;YACrG,8FAA8F;YAC9F,oGAAoG;YACpG,qFAAqF;QACvF,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC;oBACrB,WAAW,EACT,mGAAmG;wBACnG,+FAA+F;wBAC/F,8EAA8E;iBACjF;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,oGAAoG;iBAClH;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE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