@granular-software/sdk 0.4.36 → 0.4.37

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.
@@ -40,6 +40,15 @@ interface GranularAgentToolInfo {
40
40
  className?: string;
41
41
  static?: boolean;
42
42
  ready?: boolean;
43
+ inputSchema?: Record<string, unknown>;
44
+ outputSchema?: Record<string, unknown>;
45
+ }
46
+ interface GranularAgentPromptCapabilities {
47
+ executeCode?: boolean;
48
+ readEntities?: boolean;
49
+ workflowHelpers?: string[];
50
+ savedData?: boolean;
51
+ showRecords?: boolean;
43
52
  }
44
53
  interface GranularAgentExecutionCheckpoint {
45
54
  iteration?: number;
@@ -79,6 +88,8 @@ interface HarnessProjectionOptions {
79
88
  }
80
89
  interface BuildGranularAgentSystemPromptInput {
81
90
  domainDocumentation?: string;
91
+ request?: string;
92
+ capabilities?: GranularAgentPromptCapabilities;
82
93
  sessionContext?: GranularAgentSessionContext;
83
94
  heapSummary?: string;
84
95
  referentSummary?: string;
@@ -86,13 +97,37 @@ interface BuildGranularAgentSystemPromptInput {
86
97
  workflowSummary?: string;
87
98
  tools?: GranularAgentToolInfo[];
88
99
  checkpoint?: GranularAgentExecutionCheckpoint | null;
100
+ outputMode?: "agentMessages" | "returnValue";
89
101
  }
90
102
  interface GeneratedJobCodeIssue {
91
- code: "commonjs_require" | "placeholder_after_confirm" | "placeholder_after_ask_user" | "missing_user_reply" | "return_show_not_for_ui";
103
+ code: "commonjs_require" | "process_exit" | "dynamic_import_in_job" | "syntax_error_in_job" | "nested_template_literal_in_job" | "undefined_template_identifier" | "object_spread_in_job" | "missing_loop_import" | "bare_loop_helper_import" | "loop_helper_contract" | "stdout_json_reply" | "return_chat_payload";
92
104
  severity: "error";
93
105
  message: string;
94
106
  }
95
- declare function reviewGeneratedJobCode(code: string): GeneratedJobCodeIssue[];
107
+ interface ReviewGeneratedJobCodeOptions {
108
+ outputMode?: "agentMessages" | "returnValue";
109
+ request?: string;
110
+ tools?: GranularAgentToolInfo[];
111
+ reply?: string;
112
+ systemPrompt?: string;
113
+ }
114
+ interface GranularReasoningTraceChunkResult {
115
+ buffer: string;
116
+ visibleText: string;
117
+ reasoningLines: string[];
118
+ }
119
+ interface GranularReasoningTraceOptions {
120
+ ignoredCommentDirectives?: RegExp[];
121
+ lowSignalReasoningLines?: RegExp[];
122
+ }
123
+ declare function consumeGranularReasoningTraceChunk(buffer: string, chunk: string, options?: GranularReasoningTraceOptions & {
124
+ final?: boolean;
125
+ }): GranularReasoningTraceChunkResult;
126
+ declare function consumeGranularReasoningOnlyChunk(buffer: string, chunk: string, options?: GranularReasoningTraceOptions & {
127
+ final?: boolean;
128
+ }): Pick<GranularReasoningTraceChunkResult, "buffer" | "reasoningLines">;
129
+ declare function stripGranularReasoningTrace(text: string, options?: GranularReasoningTraceOptions): string;
130
+ declare function reviewGeneratedJobCode(code: string, _options?: ReviewGeneratedJobCodeOptions): GeneratedJobCodeIssue[];
96
131
  declare function projectConversationReferentFocus(liveDoc: Record<string, unknown> | null): GranularAgentReferentFocus;
97
132
  declare function projectConversationReferentSummary(liveDoc: Record<string, unknown> | null): string;
98
133
  declare function getCurrentClosureId(liveDoc: Record<string, unknown> | null): string | null;
@@ -123,8 +158,8 @@ declare function buildGranularAgentHeapBlock(heapSummary?: string): string;
123
158
  declare function buildGranularAgentReferentBlock(referentSummary?: string): string;
124
159
  declare function buildGranularAgentLoopBlock(loopSummary?: string): string;
125
160
  declare function buildGranularAgentWorkflowBlock(workflowSummary?: string): string;
126
- declare function buildGranularAgentToolBlock(tools?: GranularAgentToolInfo[]): string;
161
+ declare function buildGranularAgentToolBlock(tools?: GranularAgentToolInfo[], capabilityOverrides?: GranularAgentPromptCapabilities | null): string;
127
162
  declare function buildGranularAgentCheckpointBlock(checkpoint?: GranularAgentExecutionCheckpoint | null): string;
128
163
  declare function buildGranularAgentSystemPrompt(input: BuildGranularAgentSystemPromptInput): string;
129
164
 
130
- export { type BuildGranularAgentSystemPromptInput, type GeneratedJobCodeIssue, type GranularAgentExecutionCheckpoint, type GranularAgentHeapSummaryOptions, type GranularAgentReferentFocus, type GranularAgentSessionContext, type GranularAgentToolInfo, type GranularAgentWorkflowFocus, type HarnessContinuationDecision, type HarnessControllerBudgets, type HarnessProjectionOptions, type HarnessPromptLike, type HarnessVerifierSnapshot, type HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentReferentBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode };
165
+ export { type BuildGranularAgentSystemPromptInput, type GeneratedJobCodeIssue, type GranularAgentExecutionCheckpoint, type GranularAgentHeapSummaryOptions, type GranularAgentPromptCapabilities, type GranularAgentReferentFocus, type GranularAgentSessionContext, type GranularAgentToolInfo, type GranularAgentWorkflowFocus, type GranularReasoningTraceChunkResult, type GranularReasoningTraceOptions, type HarnessContinuationDecision, type HarnessControllerBudgets, type HarnessProjectionOptions, type HarnessPromptLike, type HarnessVerifierSnapshot, type HarnessVerifierSnapshotInput, type ReviewGeneratedJobCodeOptions, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentReferentBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, consumeGranularReasoningOnlyChunk, consumeGranularReasoningTraceChunk, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode, stripGranularReasoningTrace };
@@ -40,6 +40,15 @@ interface GranularAgentToolInfo {
40
40
  className?: string;
41
41
  static?: boolean;
42
42
  ready?: boolean;
43
+ inputSchema?: Record<string, unknown>;
44
+ outputSchema?: Record<string, unknown>;
45
+ }
46
+ interface GranularAgentPromptCapabilities {
47
+ executeCode?: boolean;
48
+ readEntities?: boolean;
49
+ workflowHelpers?: string[];
50
+ savedData?: boolean;
51
+ showRecords?: boolean;
43
52
  }
44
53
  interface GranularAgentExecutionCheckpoint {
45
54
  iteration?: number;
@@ -79,6 +88,8 @@ interface HarnessProjectionOptions {
79
88
  }
80
89
  interface BuildGranularAgentSystemPromptInput {
81
90
  domainDocumentation?: string;
91
+ request?: string;
92
+ capabilities?: GranularAgentPromptCapabilities;
82
93
  sessionContext?: GranularAgentSessionContext;
83
94
  heapSummary?: string;
84
95
  referentSummary?: string;
@@ -86,13 +97,37 @@ interface BuildGranularAgentSystemPromptInput {
86
97
  workflowSummary?: string;
87
98
  tools?: GranularAgentToolInfo[];
88
99
  checkpoint?: GranularAgentExecutionCheckpoint | null;
100
+ outputMode?: "agentMessages" | "returnValue";
89
101
  }
90
102
  interface GeneratedJobCodeIssue {
91
- code: "commonjs_require" | "placeholder_after_confirm" | "placeholder_after_ask_user" | "missing_user_reply" | "return_show_not_for_ui";
103
+ code: "commonjs_require" | "process_exit" | "dynamic_import_in_job" | "syntax_error_in_job" | "nested_template_literal_in_job" | "undefined_template_identifier" | "object_spread_in_job" | "missing_loop_import" | "bare_loop_helper_import" | "loop_helper_contract" | "stdout_json_reply" | "return_chat_payload";
92
104
  severity: "error";
93
105
  message: string;
94
106
  }
95
- declare function reviewGeneratedJobCode(code: string): GeneratedJobCodeIssue[];
107
+ interface ReviewGeneratedJobCodeOptions {
108
+ outputMode?: "agentMessages" | "returnValue";
109
+ request?: string;
110
+ tools?: GranularAgentToolInfo[];
111
+ reply?: string;
112
+ systemPrompt?: string;
113
+ }
114
+ interface GranularReasoningTraceChunkResult {
115
+ buffer: string;
116
+ visibleText: string;
117
+ reasoningLines: string[];
118
+ }
119
+ interface GranularReasoningTraceOptions {
120
+ ignoredCommentDirectives?: RegExp[];
121
+ lowSignalReasoningLines?: RegExp[];
122
+ }
123
+ declare function consumeGranularReasoningTraceChunk(buffer: string, chunk: string, options?: GranularReasoningTraceOptions & {
124
+ final?: boolean;
125
+ }): GranularReasoningTraceChunkResult;
126
+ declare function consumeGranularReasoningOnlyChunk(buffer: string, chunk: string, options?: GranularReasoningTraceOptions & {
127
+ final?: boolean;
128
+ }): Pick<GranularReasoningTraceChunkResult, "buffer" | "reasoningLines">;
129
+ declare function stripGranularReasoningTrace(text: string, options?: GranularReasoningTraceOptions): string;
130
+ declare function reviewGeneratedJobCode(code: string, _options?: ReviewGeneratedJobCodeOptions): GeneratedJobCodeIssue[];
96
131
  declare function projectConversationReferentFocus(liveDoc: Record<string, unknown> | null): GranularAgentReferentFocus;
97
132
  declare function projectConversationReferentSummary(liveDoc: Record<string, unknown> | null): string;
98
133
  declare function getCurrentClosureId(liveDoc: Record<string, unknown> | null): string | null;
@@ -123,8 +158,8 @@ declare function buildGranularAgentHeapBlock(heapSummary?: string): string;
123
158
  declare function buildGranularAgentReferentBlock(referentSummary?: string): string;
124
159
  declare function buildGranularAgentLoopBlock(loopSummary?: string): string;
125
160
  declare function buildGranularAgentWorkflowBlock(workflowSummary?: string): string;
126
- declare function buildGranularAgentToolBlock(tools?: GranularAgentToolInfo[]): string;
161
+ declare function buildGranularAgentToolBlock(tools?: GranularAgentToolInfo[], capabilityOverrides?: GranularAgentPromptCapabilities | null): string;
127
162
  declare function buildGranularAgentCheckpointBlock(checkpoint?: GranularAgentExecutionCheckpoint | null): string;
128
163
  declare function buildGranularAgentSystemPrompt(input: BuildGranularAgentSystemPromptInput): string;
129
164
 
130
- export { type BuildGranularAgentSystemPromptInput, type GeneratedJobCodeIssue, type GranularAgentExecutionCheckpoint, type GranularAgentHeapSummaryOptions, type GranularAgentReferentFocus, type GranularAgentSessionContext, type GranularAgentToolInfo, type GranularAgentWorkflowFocus, type HarnessContinuationDecision, type HarnessControllerBudgets, type HarnessProjectionOptions, type HarnessPromptLike, type HarnessVerifierSnapshot, type HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentReferentBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode };
165
+ export { type BuildGranularAgentSystemPromptInput, type GeneratedJobCodeIssue, type GranularAgentExecutionCheckpoint, type GranularAgentHeapSummaryOptions, type GranularAgentPromptCapabilities, type GranularAgentReferentFocus, type GranularAgentSessionContext, type GranularAgentToolInfo, type GranularAgentWorkflowFocus, type GranularReasoningTraceChunkResult, type GranularReasoningTraceOptions, type HarnessContinuationDecision, type HarnessControllerBudgets, type HarnessProjectionOptions, type HarnessPromptLike, type HarnessVerifierSnapshot, type HarnessVerifierSnapshotInput, type ReviewGeneratedJobCodeOptions, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentReferentBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, consumeGranularReasoningOnlyChunk, consumeGranularReasoningTraceChunk, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode, stripGranularReasoningTrace };