@codeworksh/plugin 0.3.0-canary.69.1.g5be1ef81 → 0.3.0-canary.71.1.g8233e4eb
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/{ids-CHjmAdTc.d.mts → ids-CpPeP5Ks.d.mts} +11 -3
- package/ids.d.mts +2 -2
- package/ids.mjs +7 -2
- package/ids.mjs.map +1 -1
- package/index.d.mts +1 -1
- package/package.json +2 -2
- package/plugin/tool.d.mts +1 -1
- package/plugin/tool.mjs +2 -1
- package/plugin/tool.mjs.map +1 -1
- package/{plugin-ZmFbf49i.d.mts → plugin-BhornEkR.d.mts} +5 -3
- package/plugin.d.mts +2 -2
- package/{tool-B27F3Bhp.d.mts → tool-BZXrwclV.d.mts} +7 -1
|
@@ -3,7 +3,7 @@ import { Schema } from "effect";
|
|
|
3
3
|
/**
|
|
4
4
|
* The identifiers that cross the plugin boundary.
|
|
5
5
|
*
|
|
6
|
-
* A plugin reads a session id off its context and a message id off every tool call, so both
|
|
6
|
+
* A plugin reads a session and thread id off its context and a message id off every tool call, so both
|
|
7
7
|
* brands have to be the ones the harness itself mints -- a structurally identical brand declared
|
|
8
8
|
* twice is two types, and a plugin would have to cast to hand either back. They live here, in the
|
|
9
9
|
* package both sides depend on, rather than being re-declared on each side.
|
|
@@ -13,6 +13,14 @@ declare const SessionID: Schema.brand<Schema.String, "Session.ID"> & {
|
|
|
13
13
|
create: () => string & import("effect/Brand").Brand<"Session.ID">;
|
|
14
14
|
};
|
|
15
15
|
type SessionID = typeof SessionID.Type;
|
|
16
|
+
/**
|
|
17
|
+
* Thread identity: one linear transcript inside a session. Every session has a `main` thread;
|
|
18
|
+
* forks add more. Also the provider session and prompt-cache key, so it is fresh per thread.
|
|
19
|
+
*/
|
|
20
|
+
declare const ThreadID: Schema.brand<Schema.String, "Thread.ID"> & {
|
|
21
|
+
create: () => string & import("effect/Brand").Brand<"Thread.ID">;
|
|
22
|
+
};
|
|
23
|
+
type ThreadID = typeof ThreadID.Type;
|
|
16
24
|
/**
|
|
17
25
|
* A conversation message id.
|
|
18
26
|
*
|
|
@@ -39,5 +47,5 @@ declare const MessageID: Schema.brand<Schema.String, "Message.ID"> & {
|
|
|
39
47
|
};
|
|
40
48
|
type MessageID = typeof MessageID.Type;
|
|
41
49
|
//#endregion
|
|
42
|
-
export { SessionID as n, MessageID as t };
|
|
43
|
-
//# sourceMappingURL=ids-
|
|
50
|
+
export { SessionID as n, ThreadID as r, MessageID as t };
|
|
51
|
+
//# sourceMappingURL=ids-CpPeP5Ks.d.mts.map
|
package/ids.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SessionID, t as MessageID } from "./ids-
|
|
2
|
-
export { MessageID, SessionID };
|
|
1
|
+
import { n as SessionID, r as ThreadID, t as MessageID } from "./ids-CpPeP5Ks.mjs";
|
|
2
|
+
export { MessageID, SessionID, ThreadID };
|
package/ids.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { uuidv7 } from "uuidv7";
|
|
|
5
5
|
/**
|
|
6
6
|
* The identifiers that cross the plugin boundary.
|
|
7
7
|
*
|
|
8
|
-
* A plugin reads a session id off its context and a message id off every tool call, so both
|
|
8
|
+
* A plugin reads a session and thread id off its context and a message id off every tool call, so both
|
|
9
9
|
* brands have to be the ones the harness itself mints -- a structurally identical brand declared
|
|
10
10
|
* twice is two types, and a plugin would have to cast to hand either back. They live here, in the
|
|
11
11
|
* package both sides depend on, rather than being re-declared on each side.
|
|
@@ -19,6 +19,11 @@ const SessionID = Schema.String.check(Schema.isStartingWith("ses")).pipe(Schema.
|
|
|
19
19
|
create: () => schema.make("ses_" + uuidv7())
|
|
20
20
|
})));
|
|
21
21
|
/**
|
|
22
|
+
* Thread identity: one linear transcript inside a session. Every session has a `main` thread;
|
|
23
|
+
* forks add more. Also the provider session and prompt-cache key, so it is fresh per thread.
|
|
24
|
+
*/
|
|
25
|
+
const ThreadID = Schema.String.check(Schema.isStartingWith("thr")).pipe(Schema.brand("Thread.ID"), withStatics((schema) => ({ create: () => schema.make("thr_" + uuidv7()) })));
|
|
26
|
+
/**
|
|
22
27
|
* A conversation message id.
|
|
23
28
|
*
|
|
24
29
|
* Deliberately unprefixed. aikit mints assistant message ids itself, as bare
|
|
@@ -43,6 +48,6 @@ const MessageID = Schema.String.pipe(Schema.brand("Message.ID"), withStatics((sc
|
|
|
43
48
|
from: (id) => schema.make(id)
|
|
44
49
|
})));
|
|
45
50
|
//#endregion
|
|
46
|
-
export { MessageID, SessionID };
|
|
51
|
+
export { MessageID, SessionID, ThreadID };
|
|
47
52
|
|
|
48
53
|
//# sourceMappingURL=ids.mjs.map
|
package/ids.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.mjs","names":[],"sources":["../../src/ids.ts"],"sourcesContent":["import { Schema } from \"effect\";\nimport { uuidv7 } from \"uuidv7\";\nimport { withStatics } from \"./schema.ts\";\n\n/**\n * The identifiers that cross the plugin boundary.\n *\n * A plugin reads a session id off its context and a message id off every tool call, so both\n * brands have to be the ones the harness itself mints -- a structurally identical brand declared\n * twice is two types, and a plugin would have to cast to hand either back. They live here, in the\n * package both sides depend on, rather than being re-declared on each side.\n */\n\n// Session identity. Branded so a session ID is not interchangeable with an\n// entry, part, or workspace ID at the type level — service signatures take\n// `SessionID`, never a bare `string`.\n//\n// `create` mints a new one; `ascending` adopts an ID that came from outside\n// (a persisted row, a request payload) and rejects a foreign prefix rather\n// than branding it silently. uuidv7 keeps IDs lexicographically sortable by\n// creation time, so `ORDER BY id` is `ORDER BY created`.\nexport const SessionID = Schema.String.check(Schema.isStartingWith(\"ses\")).pipe(\n\tSchema.brand(\"Session.ID\"),\n\twithStatics((schema) => ({\n\t\tascending: (id?: string) => {\n\t\t\tif (!id) return schema.make(\"ses_\" + uuidv7());\n\t\t\tif (!id.startsWith(\"ses\")) throw new Error(`ID ${id} does not start with ses`);\n\t\t\treturn schema.make(id);\n\t\t},\n\t\tcreate: () => schema.make(\"ses_\" + uuidv7()),\n\t})),\n);\nexport type SessionID = typeof SessionID.Type;\n\n/**\n * A conversation message id.\n *\n * Deliberately unprefixed. aikit mints assistant message ids itself, as bare\n * uuidv7, and `stream()` accepts no id -- so any naming rule of ours would have\n * to be imposed on messages aikit hands us, by rewriting a field of the value we\n * were given. Sharing aikit's format instead means an id means the same thing on\n * both sides of the boundary and never needs translating.\n *\n * The brand carries the meaning; uuidv7 keeps ids time-ordered, so they sort by\n * creation.\n */\nexport const MessageID = Schema.String.pipe(\n\tSchema.brand(\"Message.ID\"),\n\twithStatics((schema) => ({\n\t\tcreate: () => schema.make(uuidv7()),\n\t\t/**\n\t\t * Adopt an id minted elsewhere -- in practice aikit's, which arrives as a\n\t\t * plain string on every stream event and inside every assistant message.\n\t\t *\n\t\t * `make` does the same thing. This exists so the boundary where a foreign\n\t\t * id enters the domain is named and greppable, and so the pairing with\n\t\t * `create` says which side chose the id.\n\t\t */\n\t\tfrom: (id: string) => schema.make(id),\n\t})),\n);\nexport type MessageID = typeof MessageID.Type;\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAa,YAAY,OAAO,OAAO,MAAM,OAAO,eAAe,KAAK,CAAC,CAAC,CAAC,KAC1E,OAAO,MAAM,YAAY,GACzB,aAAa,YAAY;CACxB,YAAY,OAAgB;EAC3B,IAAI,CAAC,IAAI,OAAO,OAAO,KAAK,SAAS,OAAO,CAAC;EAC7C,IAAI,CAAC,GAAG,WAAW,KAAK,GAAG,MAAM,IAAI,MAAM,MAAM,GAAG,yBAAyB;EAC7E,OAAO,OAAO,KAAK,EAAE;CACtB;CACA,cAAc,OAAO,KAAK,SAAS,OAAO,CAAC;AAC5C,EAAE,CACH;;;;;;;;;;;;;AAeA,MAAa,YAAY,OAAO,OAAO,KACtC,OAAO,MAAM,YAAY,GACzB,aAAa,YAAY;CACxB,cAAc,OAAO,KAAK,OAAO,CAAC;;;;;;;;;CASlC,OAAO,OAAe,OAAO,KAAK,EAAE;AACrC,EAAE,CACH"}
|
|
1
|
+
{"version":3,"file":"ids.mjs","names":[],"sources":["../../src/ids.ts"],"sourcesContent":["import { Schema } from \"effect\";\nimport { uuidv7 } from \"uuidv7\";\nimport { withStatics } from \"./schema.ts\";\n\n/**\n * The identifiers that cross the plugin boundary.\n *\n * A plugin reads a session and thread id off its context and a message id off every tool call, so both\n * brands have to be the ones the harness itself mints -- a structurally identical brand declared\n * twice is two types, and a plugin would have to cast to hand either back. They live here, in the\n * package both sides depend on, rather than being re-declared on each side.\n */\n\n// Session identity. Branded so a session ID is not interchangeable with an\n// entry, part, or workspace ID at the type level — service signatures take\n// `SessionID`, never a bare `string`.\n//\n// `create` mints a new one; `ascending` adopts an ID that came from outside\n// (a persisted row, a request payload) and rejects a foreign prefix rather\n// than branding it silently. uuidv7 keeps IDs lexicographically sortable by\n// creation time, so `ORDER BY id` is `ORDER BY created`.\nexport const SessionID = Schema.String.check(Schema.isStartingWith(\"ses\")).pipe(\n\tSchema.brand(\"Session.ID\"),\n\twithStatics((schema) => ({\n\t\tascending: (id?: string) => {\n\t\t\tif (!id) return schema.make(\"ses_\" + uuidv7());\n\t\t\tif (!id.startsWith(\"ses\")) throw new Error(`ID ${id} does not start with ses`);\n\t\t\treturn schema.make(id);\n\t\t},\n\t\tcreate: () => schema.make(\"ses_\" + uuidv7()),\n\t})),\n);\nexport type SessionID = typeof SessionID.Type;\n\n/**\n * Thread identity: one linear transcript inside a session. Every session has a `main` thread;\n * forks add more. Also the provider session and prompt-cache key, so it is fresh per thread.\n */\nexport const ThreadID = Schema.String.check(Schema.isStartingWith(\"thr\")).pipe(\n\tSchema.brand(\"Thread.ID\"),\n\twithStatics((schema) => ({\n\t\tcreate: () => schema.make(\"thr_\" + uuidv7()),\n\t})),\n);\nexport type ThreadID = typeof ThreadID.Type;\n\n/**\n * A conversation message id.\n *\n * Deliberately unprefixed. aikit mints assistant message ids itself, as bare\n * uuidv7, and `stream()` accepts no id -- so any naming rule of ours would have\n * to be imposed on messages aikit hands us, by rewriting a field of the value we\n * were given. Sharing aikit's format instead means an id means the same thing on\n * both sides of the boundary and never needs translating.\n *\n * The brand carries the meaning; uuidv7 keeps ids time-ordered, so they sort by\n * creation.\n */\nexport const MessageID = Schema.String.pipe(\n\tSchema.brand(\"Message.ID\"),\n\twithStatics((schema) => ({\n\t\tcreate: () => schema.make(uuidv7()),\n\t\t/**\n\t\t * Adopt an id minted elsewhere -- in practice aikit's, which arrives as a\n\t\t * plain string on every stream event and inside every assistant message.\n\t\t *\n\t\t * `make` does the same thing. This exists so the boundary where a foreign\n\t\t * id enters the domain is named and greppable, and so the pairing with\n\t\t * `create` says which side chose the id.\n\t\t */\n\t\tfrom: (id: string) => schema.make(id),\n\t})),\n);\nexport type MessageID = typeof MessageID.Type;\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAa,YAAY,OAAO,OAAO,MAAM,OAAO,eAAe,KAAK,CAAC,CAAC,CAAC,KAC1E,OAAO,MAAM,YAAY,GACzB,aAAa,YAAY;CACxB,YAAY,OAAgB;EAC3B,IAAI,CAAC,IAAI,OAAO,OAAO,KAAK,SAAS,OAAO,CAAC;EAC7C,IAAI,CAAC,GAAG,WAAW,KAAK,GAAG,MAAM,IAAI,MAAM,MAAM,GAAG,yBAAyB;EAC7E,OAAO,OAAO,KAAK,EAAE;CACtB;CACA,cAAc,OAAO,KAAK,SAAS,OAAO,CAAC;AAC5C,EAAE,CACH;;;;;AAOA,MAAa,WAAW,OAAO,OAAO,MAAM,OAAO,eAAe,KAAK,CAAC,CAAC,CAAC,KACzE,OAAO,MAAM,WAAW,GACxB,aAAa,YAAY,EACxB,cAAc,OAAO,KAAK,SAAS,OAAO,CAAC,EAC5C,EAAE,CACH;;;;;;;;;;;;;AAeA,MAAa,YAAY,OAAO,OAAO,KACtC,OAAO,MAAM,YAAY,GACzB,aAAa,YAAY;CACxB,cAAc,OAAO,KAAK,OAAO,CAAC;;;;;;;;;CASlC,OAAO,OAAe,OAAO,KAAK,EAAE;AACrC,EAAE,CACH"}
|
package/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as section_d_exports } from "./plugin/section.mjs";
|
|
2
2
|
import { v as tool_d_exports } from "./tool-BRTCmPch.mjs";
|
|
3
|
-
import { t as plugin_d_exports } from "./plugin-
|
|
3
|
+
import { t as plugin_d_exports } from "./plugin-BhornEkR.mjs";
|
|
4
4
|
export { plugin_d_exports as Plugin, section_d_exports as Section, tool_d_exports as Tool };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeworksh/plugin",
|
|
3
|
-
"version": "0.3.0-canary.
|
|
3
|
+
"version": "0.3.0-canary.71.1.g8233e4eb",
|
|
4
4
|
"description": "SDK for building CodeWork plugins — the plugin, tool, and sandbox contracts shared with @codeworksh/harness.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"uuidv7": "^1.2.1"
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
|
-
"@codeworksh/aikit": "0.12.1-canary.
|
|
171
|
+
"@codeworksh/aikit": "0.12.1-canary.71.1.g8233e4eb",
|
|
172
172
|
"effect": "4.0.5"
|
|
173
173
|
}
|
|
174
174
|
}
|
package/plugin/tool.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ToolAfterResult, c as ToolBeforeResult, d as ToolRegistry, f as ToolResultContent, i as ToolAfterFn, l as ToolDefPatch, n as ToolAddOptions, o as ToolBefore, r as ToolAfter, s as ToolBeforeFn, t as HookReturn, u as ToolRegistration } from "../tool-
|
|
1
|
+
import { a as ToolAfterResult, c as ToolBeforeResult, d as ToolRegistry, f as ToolResultContent, i as ToolAfterFn, l as ToolDefPatch, n as ToolAddOptions, o as ToolBefore, r as ToolAfter, s as ToolBeforeFn, t as HookReturn, u as ToolRegistration } from "../tool-BZXrwclV.mjs";
|
|
2
2
|
export { HookReturn, ToolAddOptions, ToolAfter, ToolAfterFn, ToolAfterResult, ToolBefore, ToolBeforeFn, ToolBeforeResult, ToolDefPatch, ToolRegistration, ToolRegistry, ToolResultContent };
|
package/plugin/tool.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { AikitToolCallTerminalPart } from "../event.mjs";
|
|
3
|
-
import { MessageID, SessionID } from "../ids.mjs";
|
|
3
|
+
import { MessageID, SessionID, ThreadID } from "../ids.mjs";
|
|
4
4
|
import { ToolCallContext } from "../tool.mjs";
|
|
5
5
|
import { Schema } from "effect";
|
|
6
6
|
//#region src/plugin/tool.ts
|
|
@@ -12,6 +12,7 @@ var tool_exports = /* @__PURE__ */ __exportAll({
|
|
|
12
12
|
const ToolBefore = Schema.Struct({
|
|
13
13
|
...ToolCallContext.fields,
|
|
14
14
|
sessionId: SessionID,
|
|
15
|
+
threadId: ThreadID,
|
|
15
16
|
messageId: MessageID,
|
|
16
17
|
params: Schema.Unknown
|
|
17
18
|
});
|
package/plugin/tool.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.mjs","names":[],"sources":["../../../src/plugin/tool.ts"],"sourcesContent":["import { type Effect, Schema } from \"effect\";\nimport { AikitToolCallTerminalPart } from \"../event.ts\";\nimport { MessageID, SessionID } from \"../ids.ts\";\nimport { type AnyToolDef, type ModelContent, type RegisteredTool, ToolCallContext } from \"../tool.ts\";\n\nexport const ToolBefore = Schema.Struct({\n\t...ToolCallContext.fields,\n\tsessionId: SessionID,\n\tmessageId: MessageID,\n\tparams: Schema.Unknown,\n});\nexport type ToolBefore = typeof ToolBefore.Type;\nexport const ToolAfter = Schema.Struct({ ...ToolBefore.fields, terminal: AikitToolCallTerminalPart });\nexport type ToolAfter = typeof ToolAfter.Type;\nexport const ToolBeforeResult = Schema.Struct({ block: Schema.Boolean, reason: Schema.optional(Schema.String) });\nexport type ToolBeforeResult = typeof ToolBeforeResult.Type;\nexport type ToolResultContent = ModelContent;\nexport interface ToolAfterResult {\n\treadonly content?: ToolResultContent;\n\treadonly details?: unknown;\n\treadonly isError?: boolean;\n}\nexport type HookReturn<A> = A | void | Promise<A | void> | Effect.Effect<A | void, unknown>;\nexport type ToolBeforeFn = (call: ToolBefore) => HookReturn<ToolBeforeResult>;\nexport type ToolAfterFn = (call: ToolAfter) => HookReturn<ToolAfterResult>;\nexport interface ToolAddOptions {\n\treadonly beforeToolCall?: ToolBeforeFn;\n\treadonly afterToolCall?: ToolAfterFn;\n}\nexport interface ToolDefPatch {\n\treadonly description?: string;\n\treadonly label?: string;\n\treadonly promptSnippet?: string;\n\treadonly promptGuidelines?: ReadonlyArray<string>;\n}\n/**\n * One frozen bucket entry: the winning tool for a name together with the hooks that\n * `add` declared alongside it. Kept here rather than in the bucket implementation so\n * the executor shares the contract without importing plugin assembly.\n */\nexport interface ToolRegistration {\n\treadonly tool: RegisteredTool;\n\treadonly hooks: ToolAddOptions;\n}\nexport interface ToolRegistry {\n\treadonly add: (tool: RegisteredTool, options?: ToolAddOptions) => void;\n\treadonly update: (name: string, patch: ToolDefPatch) => void;\n\treadonly list: () => ReadonlyArray<AnyToolDef>;\n\treadonly get: (name: string) => AnyToolDef | undefined;\n\treadonly has: (name: string) => boolean;\n}\n"],"mappings":";;;;;;;;;;;AAKA,MAAa,aAAa,OAAO,OAAO;CACvC,GAAG,gBAAgB;CACnB,WAAW;CACX,WAAW;CACX,QAAQ,OAAO;AAChB,CAAC;AAED,MAAa,YAAY,OAAO,OAAO;CAAE,GAAG,WAAW;CAAQ,UAAU;AAA0B,CAAC;AAEpG,MAAa,mBAAmB,OAAO,OAAO;CAAE,OAAO,OAAO;CAAS,QAAQ,OAAO,SAAS,OAAO,MAAM;AAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"tool.mjs","names":[],"sources":["../../../src/plugin/tool.ts"],"sourcesContent":["import { type Effect, Schema } from \"effect\";\nimport { AikitToolCallTerminalPart } from \"../event.ts\";\nimport { MessageID, SessionID, ThreadID } from \"../ids.ts\";\nimport { type AnyToolDef, type ModelContent, type RegisteredTool, ToolCallContext } from \"../tool.ts\";\n\nexport const ToolBefore = Schema.Struct({\n\t...ToolCallContext.fields,\n\tsessionId: SessionID,\n\tthreadId: ThreadID,\n\tmessageId: MessageID,\n\tparams: Schema.Unknown,\n});\nexport type ToolBefore = typeof ToolBefore.Type;\nexport const ToolAfter = Schema.Struct({ ...ToolBefore.fields, terminal: AikitToolCallTerminalPart });\nexport type ToolAfter = typeof ToolAfter.Type;\nexport const ToolBeforeResult = Schema.Struct({ block: Schema.Boolean, reason: Schema.optional(Schema.String) });\nexport type ToolBeforeResult = typeof ToolBeforeResult.Type;\nexport type ToolResultContent = ModelContent;\nexport interface ToolAfterResult {\n\treadonly content?: ToolResultContent;\n\treadonly details?: unknown;\n\treadonly isError?: boolean;\n}\nexport type HookReturn<A> = A | void | Promise<A | void> | Effect.Effect<A | void, unknown>;\nexport type ToolBeforeFn = (call: ToolBefore) => HookReturn<ToolBeforeResult>;\nexport type ToolAfterFn = (call: ToolAfter) => HookReturn<ToolAfterResult>;\nexport interface ToolAddOptions {\n\treadonly beforeToolCall?: ToolBeforeFn;\n\treadonly afterToolCall?: ToolAfterFn;\n}\nexport interface ToolDefPatch {\n\treadonly description?: string;\n\treadonly label?: string;\n\treadonly promptSnippet?: string;\n\treadonly promptGuidelines?: ReadonlyArray<string>;\n}\n/**\n * One frozen bucket entry: the winning tool for a name together with the hooks that\n * `add` declared alongside it. Kept here rather than in the bucket implementation so\n * the executor shares the contract without importing plugin assembly.\n */\nexport interface ToolRegistration {\n\treadonly tool: RegisteredTool;\n\treadonly hooks: ToolAddOptions;\n}\nexport interface ToolRegistry {\n\treadonly add: (tool: RegisteredTool, options?: ToolAddOptions) => void;\n\treadonly update: (name: string, patch: ToolDefPatch) => void;\n\treadonly list: () => ReadonlyArray<AnyToolDef>;\n\treadonly get: (name: string) => AnyToolDef | undefined;\n\treadonly has: (name: string) => boolean;\n}\n"],"mappings":";;;;;;;;;;;AAKA,MAAa,aAAa,OAAO,OAAO;CACvC,GAAG,gBAAgB;CACnB,WAAW;CACX,UAAU;CACV,WAAW;CACX,QAAQ,OAAO;AAChB,CAAC;AAED,MAAa,YAAY,OAAO,OAAO;CAAE,GAAG,WAAW;CAAQ,UAAU;AAA0B,CAAC;AAEpG,MAAa,mBAAmB,OAAO,OAAO;CAAE,OAAO,OAAO;CAAS,QAAQ,OAAO,SAAS,OAAO,MAAM;AAAE,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { i as Definition, o as Payload, r as Data, s as PublishOptions } from "./event-C6-oCzlq.mjs";
|
|
2
|
-
import { n as SessionID } from "./ids-
|
|
2
|
+
import { n as SessionID, r as ThreadID } from "./ids-CpPeP5Ks.mjs";
|
|
3
3
|
import { o as Service, r as Info } from "./location-Q39els63.mjs";
|
|
4
4
|
import { f as io_d_exports, i as Identity, s as Provides } from "./io-Br9WZTsG.mjs";
|
|
5
5
|
import { i as Info$1 } from "./settings-DGYWREuu.mjs";
|
|
6
6
|
import { t as section_d_exports } from "./plugin/section.mjs";
|
|
7
7
|
import { n as prompt_d_exports, t as PromptRegistry } from "./prompt-DWaA5ZXj.mjs";
|
|
8
|
-
import { d as ToolRegistry, p as tool_d_exports } from "./tool-
|
|
8
|
+
import { d as ToolRegistry, p as tool_d_exports } from "./tool-BZXrwclV.mjs";
|
|
9
9
|
import { Model } from "@codeworksh/aikit";
|
|
10
10
|
import { Effect } from "effect";
|
|
11
11
|
//#region src/plugin/registry.d.ts
|
|
@@ -51,6 +51,8 @@ interface Paths {
|
|
|
51
51
|
/** One object, shared by every plugin in one turn. */
|
|
52
52
|
interface SharedPluginContext {
|
|
53
53
|
readonly sessionId: SessionID;
|
|
54
|
+
/** The thread whose turn this is. `sandbox` and `location` are its placement, else the session's. */
|
|
55
|
+
readonly threadId: ThreadID;
|
|
54
56
|
readonly sandbox: Identity;
|
|
55
57
|
readonly paths: Paths;
|
|
56
58
|
readonly location: Info;
|
|
@@ -155,4 +157,4 @@ declare namespace plugin_d_exports {
|
|
|
155
157
|
}
|
|
156
158
|
//#endregion
|
|
157
159
|
export { PluginRegistry as _, define as a, PluginOptions as c, PluginSpec as d, Config as f, SharedPluginContext as g, PromptResolver as h, PluginKind as i, PluginPatch as l, Paths as m, Mount as n, domains as o, Events as p, Plugin as r, rank as s, plugin_d_exports as t, PluginRef as u };
|
|
158
|
-
//# sourceMappingURL=plugin-
|
|
160
|
+
//# sourceMappingURL=plugin-BhornEkR.d.mts.map
|
package/plugin.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as section_d_exports } from "./plugin/section.mjs";
|
|
2
2
|
import { n as prompt_d_exports } from "./prompt-DWaA5ZXj.mjs";
|
|
3
|
-
import { p as tool_d_exports } from "./tool-
|
|
4
|
-
import { _ as PluginRegistry, a as define, c as PluginOptions, d as PluginSpec, f as Config, g as SharedPluginContext, h as PromptResolver, i as PluginKind, l as PluginPatch, m as Paths, n as Mount, o as domains, p as Events, r as Plugin, s as rank, u as PluginRef } from "./plugin-
|
|
3
|
+
import { p as tool_d_exports } from "./tool-BZXrwclV.mjs";
|
|
4
|
+
import { _ as PluginRegistry, a as define, c as PluginOptions, d as PluginSpec, f as Config, g as SharedPluginContext, h as PromptResolver, i as PluginKind, l as PluginPatch, m as Paths, n as Mount, o as domains, p as Events, r as Plugin, s as rank, u as PluginRef } from "./plugin-BhornEkR.mjs";
|
|
5
5
|
export { type Config, type Events, type Mount, type Paths, type Plugin, type PluginKind, type PluginOptions, type PluginPatch, type PluginRef, type PluginRegistry, type PluginSpec, prompt_d_exports as Prompt, type PromptResolver, section_d_exports as Section, type SharedPluginContext, tool_d_exports as Tool, define, domains, rank };
|
|
@@ -12,6 +12,9 @@ declare const ToolBefore: Schema.Struct<{
|
|
|
12
12
|
ascending: (id?: string) => string & import("effect/Brand").Brand<"Session.ID">;
|
|
13
13
|
create: () => string & import("effect/Brand").Brand<"Session.ID">;
|
|
14
14
|
};
|
|
15
|
+
readonly threadId: Schema.brand<Schema.String, "Thread.ID"> & {
|
|
16
|
+
create: () => string & import("effect/Brand").Brand<"Thread.ID">;
|
|
17
|
+
};
|
|
15
18
|
readonly messageId: Schema.brand<Schema.String, "Message.ID"> & {
|
|
16
19
|
create: () => string & import("effect/Brand").Brand<"Message.ID">;
|
|
17
20
|
from: (id: string) => string & import("effect/Brand").Brand<"Message.ID">;
|
|
@@ -28,6 +31,9 @@ declare const ToolAfter: Schema.Struct<{
|
|
|
28
31
|
ascending: (id?: string) => string & import("effect/Brand").Brand<"Session.ID">;
|
|
29
32
|
create: () => string & import("effect/Brand").Brand<"Session.ID">;
|
|
30
33
|
};
|
|
34
|
+
readonly threadId: Schema.brand<Schema.String, "Thread.ID"> & {
|
|
35
|
+
create: () => string & import("effect/Brand").Brand<"Thread.ID">;
|
|
36
|
+
};
|
|
31
37
|
readonly messageId: Schema.brand<Schema.String, "Message.ID"> & {
|
|
32
38
|
create: () => string & import("effect/Brand").Brand<"Message.ID">;
|
|
33
39
|
from: (id: string) => string & import("effect/Brand").Brand<"Message.ID">;
|
|
@@ -278,4 +284,4 @@ interface ToolRegistry {
|
|
|
278
284
|
}
|
|
279
285
|
//#endregion
|
|
280
286
|
export { ToolAfterResult as a, ToolBeforeResult as c, ToolRegistry as d, ToolResultContent as f, ToolAfterFn as i, ToolDefPatch as l, ToolAddOptions as n, ToolBefore as o, tool_d_exports as p, ToolAfter as r, ToolBeforeFn as s, HookReturn as t, ToolRegistration as u };
|
|
281
|
-
//# sourceMappingURL=tool-
|
|
287
|
+
//# sourceMappingURL=tool-BZXrwclV.d.mts.map
|