duclaw-cli 2.0.0 → 3.0.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.
Files changed (41) hide show
  1. package/dist/agent/coreHooks.d.ts +38 -0
  2. package/dist/agent/coreHooks.d.ts.map +1 -0
  3. package/dist/agent/createAgentCore.d.ts.map +1 -1
  4. package/dist/agent/duclawAgentConfig.d.ts.map +1 -1
  5. package/dist/agent/duclawCoreHooks.d.ts +5 -0
  6. package/dist/agent/duclawCoreHooks.d.ts.map +1 -0
  7. package/dist/agent/types.d.ts +2 -0
  8. package/dist/agent/types.d.ts.map +1 -1
  9. package/dist/bundle.js +1246 -1190
  10. package/dist/files/fileType.d.ts +2 -0
  11. package/dist/files/fileType.d.ts.map +1 -0
  12. package/dist/main.js +1 -1
  13. package/dist/sdk/core.d.ts +40 -0
  14. package/dist/sdk/core.d.ts.map +1 -0
  15. package/dist/sdk/core.js +40900 -0
  16. package/dist/sdk/createSdkAgent.d.ts +5 -0
  17. package/dist/sdk/createSdkAgent.d.ts.map +1 -0
  18. package/dist/sdk/duclaw.d.ts +15 -0
  19. package/dist/sdk/duclaw.d.ts.map +1 -1
  20. package/dist/sdk/duclaw.js +899 -488
  21. package/dist/sdk/duclawPreset.d.ts +21 -0
  22. package/dist/sdk/duclawPreset.d.ts.map +1 -0
  23. package/dist/sdk/index.d.ts +7 -24
  24. package/dist/sdk/index.d.ts.map +1 -1
  25. package/dist/sdk/index.js +6411 -40161
  26. package/dist/sdk/models/anthropic.d.ts +2 -0
  27. package/dist/sdk/models/anthropic.d.ts.map +1 -0
  28. package/dist/sdk/publicTypes.d.ts +33 -0
  29. package/dist/sdk/publicTypes.d.ts.map +1 -0
  30. package/dist/sdk/storage/memoryStorage.d.ts +3 -0
  31. package/dist/sdk/storage/memoryStorage.d.ts.map +1 -0
  32. package/dist/sdk/tool.d.ts +12 -0
  33. package/dist/sdk/tool.d.ts.map +1 -0
  34. package/dist/tools/Tool.d.ts +13 -7
  35. package/dist/tools/Tool.d.ts.map +1 -1
  36. package/dist/tools/tools/SendFile.d.ts +1 -1
  37. package/dist/tools/tools/SendFile.d.ts.map +1 -1
  38. package/dist/types/context.d.ts +1 -1
  39. package/dist/types/context.d.ts.map +1 -1
  40. package/dist/worker-main.js +1 -1
  41. package/package.json +11 -2
@@ -0,0 +1,2 @@
1
+ export declare const anthropic: (options: import("../../llm/AnthropicAdapter").AnthropicOptions) => import("..").LLMClient;
2
+ //# sourceMappingURL=anthropic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/anthropic.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,4FAAyB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { AgentResult } from "../agent/types";
2
+ import type { LLMClient } from "../llm/LLMClient";
3
+ import type { Storage } from "../storage/Storage";
4
+ import type { Tool } from "../tools/Tool";
5
+ import type { Message } from "../types/message";
6
+ export type SdkContext = {
7
+ userId?: string;
8
+ requestId?: string;
9
+ workspace?: string;
10
+ metadata?: Record<string, unknown>;
11
+ };
12
+ export type SdkRunInput = {
13
+ input: string;
14
+ context?: SdkContext;
15
+ };
16
+ export type SdkRunResult = {
17
+ output: string;
18
+ raw: AgentResult;
19
+ };
20
+ export type SdkModel = LLMClient;
21
+ export type SdkStorage = Storage<Message[]>;
22
+ export type SdkTool = Tool;
23
+ export type SdkAgentConfig = {
24
+ model: SdkModel;
25
+ storage: SdkStorage;
26
+ tools?: SdkTool[];
27
+ system: string;
28
+ maxIterations?: number;
29
+ };
30
+ export type SdkAgent = {
31
+ run(input: string | SdkRunInput): Promise<SdkRunResult>;
32
+ };
33
+ //# sourceMappingURL=publicTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publicTypes.d.ts","sourceRoot":"","sources":["../../src/sdk/publicTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,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() => Storage<T>;
3
+ //# sourceMappingURL=memoryStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryStorage.d.ts","sourceRoot":"","sources":["../../../src/sdk/storage/memoryStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,eAAO,MAAM,aAAa,GAAI,CAAC,OAAK,OAAO,CAAC,CAAC,CAc5C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { JSONSchema, Tool } from "../tools/Tool";
2
+ import type { UserRequest } from "../types/request";
3
+ type ToolBuilderConfig<TInput extends Record<string, unknown>> = {
4
+ name: string;
5
+ description: string;
6
+ inputSchema?: JSONSchema;
7
+ input_schema?: JSONSchema;
8
+ run(input: TInput, request?: UserRequest): Promise<unknown> | unknown;
9
+ };
10
+ export declare const tool: <TInput extends Record<string, unknown> = Record<string, unknown>>(config: ToolBuilderConfig<TInput>) => Tool;
11
+ export {};
12
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/sdk/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,KAAK,iBAAiB,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CACzE,CAAC;AAiBF,eAAO,MAAM,IAAI,GAAI,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjF,QAAQ,iBAAiB,CAAC,MAAM,CAAC,KAClC,IAQD,CAAC"}
@@ -1,16 +1,22 @@
1
1
  import { UserRequest } from "../types/request";
2
2
  /** JSON Schema(Anthropic 标准:input_schema)*/
3
- export type JSONSchema = {
4
- type: 'object';
5
- properties: Record<string, PropertySchema>;
6
- required?: string[];
7
- };
8
- export type PropertySchema = {
3
+ export type JSONSchemaProperty = {
9
4
  type: 'string' | 'number' | 'boolean' | 'array' | 'object';
10
5
  description?: string;
11
- enum?: (string | number)[];
6
+ enum?: (string | number | boolean)[];
12
7
  default?: unknown;
8
+ items?: JSONSchemaProperty;
9
+ properties?: Record<string, JSONSchemaProperty>;
10
+ required?: string[];
11
+ additionalProperties?: boolean | JSONSchemaProperty;
12
+ };
13
+ export type JSONSchema = {
14
+ type: 'object';
15
+ properties: Record<string, JSONSchemaProperty>;
16
+ required?: string[];
17
+ additionalProperties?: boolean | JSONSchemaProperty;
13
18
  };
19
+ export type PropertySchema = JSONSchemaProperty;
14
20
  /** 工具类型(Anthropic 标准)*/
15
21
  export type Tool = {
16
22
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Tool.d.ts","sourceRoot":"","sources":["../../src/tools/Tool.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,4CAA4C;AAC5C,MAAM,MAAM,UAAU,GAAG;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC3D,WAAW,CAAC,EAAE,MAAM,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,GAAG,kBAAkB,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAE9C,wBAAwB;AACxB,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,UAAU,CAAC;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACzF,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { Tool } from "../Tool";
2
- export declare const inferFileType: (fileName: string) => string;
2
+ export { inferFileType } from "../../files/fileType";
3
3
  export declare const sendFile: Tool;
4
4
  //# sourceMappingURL=SendFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SendFile.d.ts","sourceRoot":"","sources":["../../../src/tools/tools/SendFile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAqB/B,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,KAAG,MAGhD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,IA8BtB,CAAA"}
1
+ {"version":3,"file":"SendFile.d.ts","sourceRoot":"","sources":["../../../src/tools/tools/SendFile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAW/B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,eAAO,MAAM,QAAQ,EAAE,IA8BtB,CAAA"}
@@ -2,7 +2,7 @@ export type AgentContext = {
2
2
  platform: string;
3
3
  userId: string;
4
4
  requestId: string;
5
- departmentAgentId: string;
5
+ departmentAgentId?: string;
6
6
  chatType?: `p2p` | 'group';
7
7
  workspacePath?: string;
8
8
  defaultWorkDir?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;CACrC,CAAA"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;CACrC,CAAA"}