@howaboua/pi-durable-sites 0.11.0 → 0.13.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/NOTICE +4 -0
- package/README.md +2 -2
- package/dist/activation.js +451 -230
- package/dist/index.js +451 -230
- package/dist/packages/sites/src/auth.d.ts +1 -1
- package/dist/packages/sites/src/client.d.ts +3 -0
- package/dist/packages/sites/src/documentation.d.ts +1 -1
- package/dist/packages/sites/src/facade.d.ts +15 -2
- package/dist/packages/sites/src/index.d.ts +20 -4
- package/dist/packages/sites/src/local-project.d.ts +7 -2
- package/dist/packages/sites/src/native-git.d.ts +1 -8
- package/dist/packages/sites/src/operations.d.ts +1 -1
- package/dist/packages/sites/src/source-git.d.ts +16 -0
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Context } from "@earendil-works/chord";
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
2
|
import type { Models } from "@earendil-works/pi-ai";
|
|
3
3
|
/** OAuth resolves through Models, not ambient Pi auth files or model-selected URLs. */
|
|
4
4
|
export declare function getSitesAuth(models: Models, providerId: string, context: Context): Promise<{
|
|
@@ -16,6 +16,9 @@ interface SitesTool {
|
|
|
16
16
|
inputSchema?: JsonSchema;
|
|
17
17
|
_meta: Record<string, unknown>;
|
|
18
18
|
}
|
|
19
|
+
export declare class SitesOperationUnavailable extends Error {
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
19
22
|
export declare class SitesClient {
|
|
20
23
|
private fetchImpl;
|
|
21
24
|
private authProvider;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SitesClient } from "./client.ts";
|
|
2
2
|
export declare function documentation(input: string | undefined, client: Pick<SitesClient, "schema">): Promise<string>;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import type { Context } from "@earendil-works/chord";
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
2
|
import type { SitesClient } from "./client.ts";
|
|
3
3
|
import type { SitesProjectCapability } from "./local-project.ts";
|
|
4
|
-
export declare
|
|
4
|
+
export declare const openSchema: {
|
|
5
|
+
type: string;
|
|
6
|
+
properties: {
|
|
7
|
+
project_id: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
project_dir: {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
required: string[];
|
|
15
|
+
additionalProperties: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function call(request: unknown, client: Pick<SitesClient, "schema" | "call">, cwd: string, capability: SitesProjectCapability, context: Context): Promise<unknown>;
|
|
@@ -49,7 +49,12 @@ export declare function createSitesTool(options: SitesOptions): {
|
|
|
49
49
|
resource?: string;
|
|
50
50
|
action?: string;
|
|
51
51
|
params?: Record<string, unknown>;
|
|
52
|
-
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord").JsonValue>, context: import("@earendil-works/chord").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<import("@earendil-works/chord").JsonValue>>;
|
|
52
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue>, context: import("@earendil-works/chord/context").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<import("@earendil-works/chord/json").JsonValue> | import("@earendil-works/pi-durable").ToolPark<import("@earendil-works/chord/json").JsonValue>>;
|
|
53
|
+
cancel?(args: {
|
|
54
|
+
resource?: string;
|
|
55
|
+
action?: string;
|
|
56
|
+
params?: Record<string, unknown>;
|
|
57
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue>, context: import("@earendil-works/chord/context").Context): Promise<void>;
|
|
53
58
|
executionHints: {
|
|
54
59
|
discovery: "help";
|
|
55
60
|
deferLoading: boolean;
|
|
@@ -77,7 +82,10 @@ export declare function createSitesDocumentationTool(options: Pick<SitesOptions,
|
|
|
77
82
|
};
|
|
78
83
|
execute(args: {
|
|
79
84
|
topic?: string;
|
|
80
|
-
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord").JsonValue>, context: import("@earendil-works/chord").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<import("@earendil-works/chord").JsonValue>>;
|
|
85
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue>, context: import("@earendil-works/chord/context").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<import("@earendil-works/chord/json").JsonValue> | import("@earendil-works/pi-durable").ToolPark<import("@earendil-works/chord/json").JsonValue>>;
|
|
86
|
+
cancel?(args: {
|
|
87
|
+
topic?: string;
|
|
88
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue>, context: import("@earendil-works/chord/context").Context): Promise<void>;
|
|
81
89
|
executionHints: {
|
|
82
90
|
discovery: "help";
|
|
83
91
|
deferLoading: boolean;
|
|
@@ -111,7 +119,12 @@ export declare function createSitesExtension(options: SitesOptions): import("@ea
|
|
|
111
119
|
resource?: string;
|
|
112
120
|
action?: string;
|
|
113
121
|
params?: Record<string, unknown>;
|
|
114
|
-
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord").JsonValue>, context: import("@earendil-works/chord").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<import("@earendil-works/chord").JsonValue>>;
|
|
122
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue>, context: import("@earendil-works/chord/context").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<import("@earendil-works/chord/json").JsonValue> | import("@earendil-works/pi-durable").ToolPark<import("@earendil-works/chord/json").JsonValue>>;
|
|
123
|
+
cancel?(args: {
|
|
124
|
+
resource?: string;
|
|
125
|
+
action?: string;
|
|
126
|
+
params?: Record<string, unknown>;
|
|
127
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue>, context: import("@earendil-works/chord/context").Context): Promise<void>;
|
|
115
128
|
executionHints: {
|
|
116
129
|
discovery: "help";
|
|
117
130
|
deferLoading: boolean;
|
|
@@ -138,7 +151,10 @@ export declare function createSitesExtension(options: SitesOptions): import("@ea
|
|
|
138
151
|
};
|
|
139
152
|
execute(args: {
|
|
140
153
|
topic?: string;
|
|
141
|
-
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord").JsonValue>, context: import("@earendil-works/chord").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<import("@earendil-works/chord").JsonValue>>;
|
|
154
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue>, context: import("@earendil-works/chord/context").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<import("@earendil-works/chord/json").JsonValue> | import("@earendil-works/pi-durable").ToolPark<import("@earendil-works/chord/json").JsonValue>>;
|
|
155
|
+
cancel?(args: {
|
|
156
|
+
topic?: string;
|
|
157
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue>, context: import("@earendil-works/chord/context").Context): Promise<void>;
|
|
142
158
|
executionHints: {
|
|
143
159
|
discovery: "help";
|
|
144
160
|
deferLoading: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Context } from "@earendil-works/chord";
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
2
|
export interface ProjectContext {
|
|
3
3
|
root: string;
|
|
4
4
|
manifestPath: string;
|
|
@@ -6,12 +6,17 @@ export interface ProjectContext {
|
|
|
6
6
|
/** Host-authorized filesystem and Git owner for exactly one execution namespace. */
|
|
7
7
|
export interface SitesProjectCapability {
|
|
8
8
|
readonly id: string;
|
|
9
|
+
openSource?(directory: unknown, cwd: string, projectId: string, credential: () => Promise<unknown>, context: Context): Promise<{
|
|
10
|
+
project_id: string;
|
|
11
|
+
checkout_path: string;
|
|
12
|
+
commit_sha: string;
|
|
13
|
+
}>;
|
|
9
14
|
projectContext(projectDir: unknown, cwd: string, context: Context): Promise<ProjectContext>;
|
|
10
15
|
acquireHostingLock(project: ProjectContext, context: Context): Promise<() => Promise<void>>;
|
|
11
16
|
readHosting(project: ProjectContext, context: Context): Promise<Record<string, unknown>>;
|
|
12
17
|
persistProjectId(project: ProjectContext, projectId: string, context: Context): Promise<void>;
|
|
13
18
|
resolveProjectId(params: Record<string, unknown>, project: ProjectContext, context: Context): Promise<unknown>;
|
|
14
|
-
inspectCleanCommit(project: ProjectContext, context: Context): Promise<{
|
|
19
|
+
inspectCleanCommit(project: ProjectContext, context: Context, projectId: string): Promise<{
|
|
15
20
|
root: string;
|
|
16
21
|
commitSha: string;
|
|
17
22
|
}>;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import type { Context } from "@earendil-works/chord";
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
2
|
import type { NodeExecutionEnv } from "@earendil-works/pi-durable/env/node";
|
|
3
3
|
export type RunGit = (cwd: string, args: string[], env?: NodeJS.ProcessEnv, signal?: AbortSignal) => Promise<string>;
|
|
4
|
-
export declare function pushCommit({ root, commitSha, credential, git, signal, }: {
|
|
5
|
-
root: string;
|
|
6
|
-
commitSha: string;
|
|
7
|
-
credential: unknown;
|
|
8
|
-
git: RunGit;
|
|
9
|
-
signal: AbortSignal | undefined;
|
|
10
|
-
}): Promise<void>;
|
|
11
4
|
export declare function gitForContext(environment: NodeExecutionEnv, context: Context): RunGit;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RunGit } from "./native-git.ts";
|
|
2
|
+
interface GitOptions {
|
|
3
|
+
run: RunGit;
|
|
4
|
+
env?: NodeJS.ProcessEnv | undefined;
|
|
5
|
+
signal?: AbortSignal | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare function requireGitWorktreeEnvironment(): void;
|
|
8
|
+
export declare function verifyCommitProject(root: string, commitSha: string, projectId: string, options: GitOptions): Promise<void>;
|
|
9
|
+
export declare function newCheckoutPath(projectDir: unknown, cwd: string): Promise<string>;
|
|
10
|
+
export declare function openSource(destination: string, projectId: string, credential: unknown, options: GitOptions): Promise<{
|
|
11
|
+
project_id: string;
|
|
12
|
+
checkout_path: string;
|
|
13
|
+
commit_sha: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function pushCommit(root: string, commitSha: string, credential: unknown, options: GitOptions): Promise<void>;
|
|
16
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howaboua/pi-durable-sites",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "ChatGPT Sites tools for Pi Durable",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
],
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"typebox": "1.
|
|
37
|
-
"@howaboua/pi-durable-components": "0.
|
|
36
|
+
"typebox": "1.4.7",
|
|
37
|
+
"@howaboua/pi-durable-components": "0.13.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@earendil-works/chord": "1.
|
|
41
|
-
"@earendil-works/pi-ai": "1.
|
|
42
|
-
"@earendil-works/pi-durable": "1.
|
|
43
|
-
"@modelcontextprotocol/sdk": ">=1.
|
|
40
|
+
"@earendil-works/chord": "1.8.0",
|
|
41
|
+
"@earendil-works/pi-ai": "1.8.0",
|
|
42
|
+
"@earendil-works/pi-durable": "1.8.0",
|
|
43
|
+
"@modelcontextprotocol/sdk": ">=1.32.2 <2"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|