@xiaozhiclaw/qlogicagent-core 0.6.0 → 0.6.2
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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolDefinition } from "./contracts.js";
|
|
2
|
+
export interface CoreCapabilities {
|
|
3
|
+
schemaVersion: 1;
|
|
4
|
+
packageName: "@xiaozhiclaw/qlogicagent-core";
|
|
5
|
+
packageVersion: string;
|
|
6
|
+
builtInTools: ToolDefinition[];
|
|
7
|
+
}
|
|
8
|
+
/** Describes this artifact only; product-injected tools are not core tools. */
|
|
9
|
+
export declare function getCoreCapabilities(): CoreCapabilities;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { ToolDefinition, ToolResult } from "./contracts.js";
|
|
2
|
+
import type { CloudToolInvocation, CloudToolWait } from "./cloud-agent.js";
|
|
3
|
+
export interface CoreResourceRead {
|
|
4
|
+
resourceId: string;
|
|
5
|
+
version?: string;
|
|
6
|
+
cursor?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface CorePlanStep {
|
|
10
|
+
id: string;
|
|
11
|
+
description: string;
|
|
12
|
+
status: "pending" | "in_progress" | "completed" | "blocked" | "cancelled";
|
|
13
|
+
dependsOn?: string[];
|
|
14
|
+
evidenceRefs?: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface CorePlanIssue {
|
|
17
|
+
id: string;
|
|
18
|
+
description: string;
|
|
19
|
+
stepIds?: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface CorePlanSnapshot {
|
|
22
|
+
steps: CorePlanStep[];
|
|
23
|
+
issues: CorePlanIssue[];
|
|
24
|
+
}
|
|
25
|
+
export type CorePlanInput = {
|
|
26
|
+
action: "read";
|
|
27
|
+
planId: string;
|
|
28
|
+
} | ({
|
|
29
|
+
action: "create";
|
|
30
|
+
} & CorePlanSnapshot) | ({
|
|
31
|
+
action: "update";
|
|
32
|
+
planId: string;
|
|
33
|
+
expectedRevision: string;
|
|
34
|
+
} & CorePlanSnapshot);
|
|
35
|
+
export interface CoreConfirmationInput {
|
|
36
|
+
/** Immutable prepared-operation reference issued and resolved by the Host. */
|
|
37
|
+
operationRef: string;
|
|
38
|
+
summary: string;
|
|
39
|
+
targets: {
|
|
40
|
+
resourceId: string;
|
|
41
|
+
version?: string;
|
|
42
|
+
}[];
|
|
43
|
+
impacts: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface CoreToolInputs {
|
|
46
|
+
qlogic_ask_user: {
|
|
47
|
+
question: string;
|
|
48
|
+
choices?: string[];
|
|
49
|
+
};
|
|
50
|
+
qlogic_discover_capabilities: {
|
|
51
|
+
cursor?: string;
|
|
52
|
+
};
|
|
53
|
+
qlogic_search_resources: {
|
|
54
|
+
query: string;
|
|
55
|
+
cursor?: string;
|
|
56
|
+
limit?: number;
|
|
57
|
+
};
|
|
58
|
+
qlogic_read_resource: CoreResourceRead;
|
|
59
|
+
qlogic_read_skill: {
|
|
60
|
+
skillId: string;
|
|
61
|
+
resourceId?: string;
|
|
62
|
+
version?: string;
|
|
63
|
+
cursor?: string;
|
|
64
|
+
limit?: number;
|
|
65
|
+
};
|
|
66
|
+
qlogic_update_plan: CorePlanInput;
|
|
67
|
+
qlogic_request_confirmation: CoreConfirmationInput;
|
|
68
|
+
}
|
|
69
|
+
export type CoreToolName = keyof CoreToolInputs;
|
|
70
|
+
export type CoreToolWait<Name extends "qlogic_ask_user" | "qlogic_request_confirmation"> = {
|
|
71
|
+
kind: "wait";
|
|
72
|
+
wait: Omit<CloudToolWait["wait"], "kind"> & {
|
|
73
|
+
kind: Name extends "qlogic_ask_user" ? "input" : "confirmation";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export type CoreToolHandler<Name extends CoreToolName> = (input: Readonly<CoreToolInputs[Name]>, invocation: Readonly<CloudToolInvocation>, signal?: AbortSignal) => Promise<ToolResult | (Name extends "qlogic_ask_user" | "qlogic_request_confirmation" ? CoreToolWait<Name> : never)>;
|
|
77
|
+
export interface CoreToolHost {
|
|
78
|
+
/** Revalidate the actor and exact resource/Skill reference on every invocation.
|
|
79
|
+
* A model-provided reference is never evidence of access or approval.
|
|
80
|
+
*/
|
|
81
|
+
authorize(invocation: Readonly<CloudToolInvocation>, input: Readonly<CoreToolInputs[CoreToolName]>, signal?: AbortSignal): Promise<void>;
|
|
82
|
+
handlers: {
|
|
83
|
+
[Name in CoreToolName]?: CoreToolHandler<Name>;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export interface CoreToolAdapter {
|
|
87
|
+
/** Only explicitly mounted Host handlers are offered to the model. */
|
|
88
|
+
readonly definitions: ToolDefinition[];
|
|
89
|
+
handles(name: string): boolean;
|
|
90
|
+
invoke(invocation: CloudToolInvocation, signal?: AbortSignal): Promise<ToolResult | CloudToolWait>;
|
|
91
|
+
}
|
|
92
|
+
/** Artifact inventory, independent of any product's currently mounted handlers. */
|
|
93
|
+
export declare function getCoreToolDefinitions(): ToolDefinition[];
|
|
94
|
+
/** A typed dispatch adapter for the existing CloudAgent/CloudTask tool loop.
|
|
95
|
+
* The Host owns discovery, data, authorization, plans and user-decision receipts.
|
|
96
|
+
*/
|
|
97
|
+
export declare function createCoreToolAdapter(options: {
|
|
98
|
+
host: CoreToolHost;
|
|
99
|
+
/** Omit to enable the supplied handlers; an explicit list must have every handler. */
|
|
100
|
+
enabledTools?: readonly CoreToolName[];
|
|
101
|
+
}): CoreToolAdapter;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export { createEmbeddedAgent } from "./embedded-agent.js";
|
|
2
2
|
export { prepareSlidingWindowContext } from "./context-projection.js";
|
|
3
3
|
export { corePackageVersion } from "./package-version.js";
|
|
4
|
+
export { getCoreCapabilities } from "./core-capabilities.js";
|
|
5
|
+
export type { CoreCapabilities } from "./core-capabilities.js";
|
|
6
|
+
export { createCoreToolAdapter } from "./core-tools.js";
|
|
7
|
+
export type { CoreToolAdapter, CoreToolHost, CoreToolInputs, CoreToolName, CoreToolHandler, CoreToolWait, CoreResourceRead, CorePlanStep, CorePlanIssue, CorePlanSnapshot, CorePlanInput, CoreConfirmationInput } from "./core-tools.js";
|
|
4
8
|
export { AgentContentBlockValidationError, parseAgentContentBlock, } from "./content-blocks.js";
|
|
5
9
|
export type { ContextAnchor, ContextEnvelope, SemanticToolCapability, ToolIdentity, UsageRecord, UsageSource, AgentLogger, ChatMessage, CreateEmbeddedAgentOptions, EmbeddedAgent, EmbeddedRuntimeOptions, ModelContextPreparation, ModelContextProjection, LLMChunk, LLMRequest, LLMTransport, ModelRetryAuthorization, ToolDefinition, ToolInvoker, ToolInvocationContext, ToolResult, TurnCheckpoint, TokenUsage, TurnConfig, TurnEvent, TurnRequest, } from "./contracts.js";
|
|
6
10
|
export type { ModelOperation, ModelRecoveryProof } from "./model-operation.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiaozhiclaw/qlogicagent-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Shared SaaS Agent inference and durable task runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"dist/",
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "node scripts/build.mjs"
|
|
20
|
+
},
|
|
18
21
|
"publishConfig": {
|
|
19
22
|
"access": "public"
|
|
20
23
|
},
|
|
21
24
|
"engines": {
|
|
22
25
|
"node": ">=24.0.0 <25"
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "node scripts/build.mjs"
|
|
26
26
|
}
|
|
27
|
-
}
|
|
27
|
+
}
|