@sudodevstudio/astro-ai 0.2.0 → 0.4.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/README.md +1 -0
- package/package.json +2 -3
- package/src/agent/agent-fallback.ts +0 -95
- package/src/agent/cli-agent-fallback.ts +0 -1382
- package/src/integration/index.ts +0 -475
- package/src/resolver/astro-resolver.ts +0 -1024
- package/src/resolver/types.ts +0 -47
- package/src/shared/protocol.ts +0 -181
- package/src/shared/selection-context.ts +0 -91
- package/src/shared/visual-components.ts +0 -16
- package/src/toolbar/action-model.ts +0 -67
- package/src/toolbar/app.ts +0 -294
- package/src/toolbar/chat-drawer.ts +0 -1742
- package/src/toolbar/chat-windows.ts +0 -331
- package/src/toolbar/contextual-actions.ts +0 -401
- package/src/toolbar/diagnostic-actions.ts +0 -151
- package/src/toolbar/layers.ts +0 -32
- package/src/toolbar/overlay.ts +0 -638
- package/src/visual/capability-resolver.ts +0 -83
- package/src/visual/command-engine.ts +0 -250
- package/src/visual/commands.ts +0 -37
- package/src/visual/patch-transactions.ts +0 -270
- package/src/vite/build-ai-plugin.ts +0 -46
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudodevstudio/astro-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Development-only Build with AI tooling for Astro projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Maninderpreet Singh",
|
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
"./package.json": "./package.json"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
|
-
"dist"
|
|
48
|
-
"src"
|
|
47
|
+
"dist"
|
|
49
48
|
],
|
|
50
49
|
"scripts": {
|
|
51
50
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { SelectionContext } from '../shared/selection-context.js';
|
|
2
|
-
import type {
|
|
3
|
-
AgentExternalContext,
|
|
4
|
-
AgentFileAttachment,
|
|
5
|
-
AgentRequestMode,
|
|
6
|
-
} from '../shared/protocol.js';
|
|
7
|
-
import type {
|
|
8
|
-
PatchTransactionStore,
|
|
9
|
-
PatchTransactionSummary,
|
|
10
|
-
} from '../visual/patch-transactions.js';
|
|
11
|
-
|
|
12
|
-
export type AgentFallbackRequest = {
|
|
13
|
-
instruction: string;
|
|
14
|
-
reason: string;
|
|
15
|
-
/** Chat window this run belongs to. Each session keeps its own turns and workspace. */
|
|
16
|
-
sessionId?: string;
|
|
17
|
-
mode?: AgentRequestMode;
|
|
18
|
-
selections?: SelectionContext[];
|
|
19
|
-
/** Project-relative files that the provider may modify. Undefined means project-wide. */
|
|
20
|
-
editableFiles?: string[];
|
|
21
|
-
externalContext?: AgentExternalContext;
|
|
22
|
-
files?: AgentFileAttachment[];
|
|
23
|
-
signal?: AbortSignal;
|
|
24
|
-
onProgress?(state: AgentProgressState, message: string): void;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type AgentProgressState =
|
|
28
|
-
| 'queued'
|
|
29
|
-
| 'reading'
|
|
30
|
-
| 'editing'
|
|
31
|
-
| 'validation'
|
|
32
|
-
| 'diagnostics'
|
|
33
|
-
| 'tool';
|
|
34
|
-
|
|
35
|
-
export type AgentProviderStatus = {
|
|
36
|
-
provider: string;
|
|
37
|
-
available: boolean;
|
|
38
|
-
authenticated: boolean;
|
|
39
|
-
message: string;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export type AgentFallbackResult = {
|
|
43
|
-
provider?: string;
|
|
44
|
-
response: string;
|
|
45
|
-
transaction?: PatchTransactionSummary;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Boundary for operations rejected by deterministic capability checks.
|
|
50
|
-
* Implementations must apply all proposed file changes through the provided
|
|
51
|
-
* transaction store; browser code never receives provider credentials.
|
|
52
|
-
*/
|
|
53
|
-
export abstract class AgentFallback {
|
|
54
|
-
abstract status(): Promise<AgentProviderStatus>;
|
|
55
|
-
|
|
56
|
-
dispose(): void | Promise<void> {}
|
|
57
|
-
|
|
58
|
-
/** Releases the conversation and workspace held for one closed chat window. */
|
|
59
|
-
closeSession(_sessionId: string): void | Promise<void> {}
|
|
60
|
-
|
|
61
|
-
/** Releases every idle session outside the set the page still has open. */
|
|
62
|
-
retainSessions(_sessionIds: readonly string[]): void | Promise<void> {}
|
|
63
|
-
|
|
64
|
-
abstract execute(
|
|
65
|
-
request: AgentFallbackRequest,
|
|
66
|
-
transactions: PatchTransactionStore,
|
|
67
|
-
): Promise<AgentFallbackResult>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export class UnavailableAgentFallback extends AgentFallback {
|
|
71
|
-
readonly #message: string;
|
|
72
|
-
|
|
73
|
-
constructor(message = 'No CLI agent provider is configured.') {
|
|
74
|
-
super();
|
|
75
|
-
this.#message = message;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
status(): Promise<AgentProviderStatus> {
|
|
79
|
-
return Promise.resolve({
|
|
80
|
-
provider: 'none',
|
|
81
|
-
available: false,
|
|
82
|
-
authenticated: false,
|
|
83
|
-
message: this.#message,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
execute(
|
|
88
|
-
_request: AgentFallbackRequest,
|
|
89
|
-
_transactions: PatchTransactionStore,
|
|
90
|
-
): Promise<AgentFallbackResult> {
|
|
91
|
-
return Promise.reject(
|
|
92
|
-
new Error(this.#message),
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
}
|